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.Base; public class LocationInfoViewModel : CrudPageViewModel { public LocationInfoViewModel(IBaseLocationInfoService service) : base(service) { PageTitle = "库位信息管理"; } public override List FieldConfigs => new() { new() { PropertyName = "locationCode", DisplayName = "库位编号" }, new() { PropertyName = "locationName", DisplayName = "库位名称" }, new() { PropertyName = "locationArea", DisplayName = "库位区域" }, new() { PropertyName = "storeCode", DisplayName = "所属仓库" }, new() { PropertyName = "locationRows", DisplayName = "排", FieldType = FieldType.Number }, new() { PropertyName = "locationColumns", DisplayName = "列", FieldType = FieldType.Number }, new() { PropertyName = "locationLayers", DisplayName = "层", FieldType = FieldType.Number }, new() { PropertyName = "agvPosition", DisplayName = "AGV定位" }, new() { PropertyName = "materialCode", DisplayName = "物料编号" }, new() { PropertyName = "palletBarcode", DisplayName = "托盘条码" }, new() { PropertyName = "stackCount", DisplayName = "库存数量" }, new() { PropertyName = "locationStatus", DisplayName = "库位状态", FieldType = FieldType.Number }, new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox }, new() { PropertyName = "remark", DisplayName = "备注" }, }; protected override Expression>? BuildSearchExpression(string search) => x => (x.locationCode != null && x.locationCode.Contains(search)) || (x.locationName != null && x.locationName.Contains(search)); public override Avalonia.Controls.Control CreateView() => new Sln.Wcs.UI.Views.Base.LocationInfoListView(); }