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.Task; public class TaskDetailViewModel : CrudPageViewModel { public TaskDetailViewModel(ILiveTaskDetailService service) : base(service) { PageTitle = "任务明细管理"; } public override List FieldConfigs => new() { new() { PropertyName = "taskCode", DisplayName = "任务编号" }, new() { PropertyName = "pathCode", DisplayName = "路径编号" }, new() { PropertyName = "materialCode", DisplayName = "物料编号" }, new() { PropertyName = "palletBarcode", DisplayName = "托盘条码" }, new() { PropertyName = "materialBarcode", DisplayName = "物料条码" }, new() { PropertyName = "materialCount", DisplayName = "物料数量", FieldType = FieldType.Number }, new() { PropertyName = "taskType", DisplayName = "任务类型", FieldType = FieldType.Number }, new() { PropertyName = "taskCategory", DisplayName = "任务类别", FieldType = FieldType.Number }, new() { PropertyName = "startPoint", DisplayName = "起始位置" }, new() { PropertyName = "endPoint", DisplayName = "结束位置" }, new() { PropertyName = "deviceType", DisplayName = "设备类型", FieldType = FieldType.Number }, new() { PropertyName = "isValidate", DisplayName = "校验物料", FieldType = FieldType.CheckBox }, new() { PropertyName = "taskStatus", DisplayName = "任务状态", FieldType = FieldType.Number }, new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox }, new() { PropertyName = "remark", DisplayName = "备注" }, }; protected override Expression>? BuildSearchExpression(string search) => x => (x.taskCode != null && x.taskCode.Contains(search)) || (x.materialCode != null && x.materialCode.Contains(search)); public override Avalonia.Controls.Control CreateView() => new Sln.Wcs.UI.Views.Task.TaskDetailListView(); }