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 StoreInfoViewModel : CrudPageViewModel { public StoreInfoViewModel(IBaseStoreInfoService service) : base(service) { PageTitle = "仓库信息管理"; } public override List FieldConfigs => new() { new() { PropertyName = "storeCode", DisplayName = "仓库编号", IsRequired = true }, new() { PropertyName = "storeName", DisplayName = "仓库名称" }, new() { PropertyName = "storeType", DisplayName = "仓库类型", FieldType = FieldType.Number }, new() { PropertyName = "isFlag", DisplayName = "启用", FieldType = FieldType.CheckBox }, new() { PropertyName = "remark", DisplayName = "备注" }, }; protected override Expression>? BuildSearchExpression(string search) => x => x.storeCode.Contains(search) || (x.storeName != null && x.storeName.Contains(search)); public override Avalonia.Controls.Control CreateView() => new Sln.Wcs.UI.Views.Base.StoreInfoListView(); }