iotgateway/IoTGateway.ViewModel/BasicData/DeviceVMs/DeviceImportVM.cs
2021-12-12 14:55:48 +08:00

45 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using IoTGateway.Model;
namespace IoTGateway.ViewModel.BasicData.DeviceVMs
{
public partial class DeviceTemplateVM : BaseTemplateVM
{
[Display(Name = "名称")]
public ExcelPropety DeviceName_Excel = ExcelPropety.CreateProperty<Device>(x => x.DeviceName);
[Display(Name = "排序")]
public ExcelPropety Index_Excel = ExcelPropety.CreateProperty<Device>(x => x.Index);
[Display(Name = "描述")]
public ExcelPropety Description_Excel = ExcelPropety.CreateProperty<Device>(x => x.Description);
public ExcelPropety Driver_Excel = ExcelPropety.CreateProperty<Device>(x => x.DriverId);
[Display(Name = "自启动")]
public ExcelPropety AutoStart_Excel = ExcelPropety.CreateProperty<Device>(x => x.AutoStart);
[Display(Name = "类型")]
public ExcelPropety DeviceTypeEnum_Excel = ExcelPropety.CreateProperty<Device>(x => x.DeviceTypeEnum);
[Display(Name = "_Admin.Parent")]
public ExcelPropety Parent_Excel = ExcelPropety.CreateProperty<Device>(x => x.ParentId);
protected override void InitVM()
{
Driver_Excel.DataType = ColumnDataType.ComboBox;
Driver_Excel.ListItems = DC.Set<Driver>().GetSelectListItems(Wtm, y => y.DriverName);
Parent_Excel.DataType = ColumnDataType.ComboBox;
Parent_Excel.ListItems = DC.Set<Device>().GetSelectListItems(Wtm, y => y.DeviceName);
}
}
public class DeviceImportVM : BaseImportVM<DeviceTemplateVM, Device>
{
}
}