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.
30 lines
1.2 KiB
C#
30 lines
1.2 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.Base;
|
|
|
|
public class StoreInfoViewModel : CrudPageViewModel<BaseStoreInfo>
|
|
{
|
|
public StoreInfoViewModel(IBaseStoreInfoService service) : base(service)
|
|
{
|
|
PageTitle = "仓库信息管理";
|
|
}
|
|
|
|
public override List<FieldConfig> 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<Func<BaseStoreInfo, bool>>? 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();
|
|
}
|