You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.4 KiB
C#

using System.Collections.Generic;
using System.Linq.Expressions;
using Sln.Wcs.Model.Domain;
using Sln.Wcs.Repository.service;
using Sln.Wcs.UI.ViewModels.Base;
namespace Sln.Wcs.UI.ViewModels.Path;
public class PathDetailsViewModel : CrudPageViewModel<BasePathDetails>
{
public PathDetailsViewModel(IBasePathDetailsService service) : base(service)
{
PageTitle = "路径明细管理";
}
public override List<FieldConfig> FieldConfigs => new()
{
new() { PropertyName = "pathCode", DisplayName = "路径编号" },
new() { PropertyName = "pathName", DisplayName = "路径名称" },
new() { PropertyName = "startPoint", DisplayName = "起点" },
new() { PropertyName = "endPoint", DisplayName = "终点" },
new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Number },
new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox },
new() { PropertyName = "remark", DisplayName = "备注" },
};
protected override Expression<Func<BasePathDetails, bool>>? BuildSearchExpression(string search)
=> x => (x.pathCode != null && x.pathCode.Contains(search))
|| (x.pathName != null && x.pathName.Contains(search));
public override Avalonia.Controls.Control CreateView() => new Sln.Wcs.UI.Views.Path.PathDetailsListView();
}