diff --git a/projects/Application/Domain/IoTCenter/IoTData.cs b/projects/Application/Domain/IoTCenter/IoTData.cs index 52378d74..228cd25c 100644 --- a/projects/Application/Domain/IoTCenter/IoTData.cs +++ b/projects/Application/Domain/IoTCenter/IoTData.cs @@ -2,9 +2,6 @@ using Infrastructure.Domain; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Text.Encodings.Web; -using System.Text.Json; -using System.Text.Unicode; namespace Application.Domain.Entities { @@ -23,7 +20,7 @@ namespace Application.Domain.Entities [Display(Name = "名称")] public string Name { get; set; } - [Display(Name = "数据类型")] + [Display(Name = "数据分类")] public IoTDataType DataType { get; set; } [Display(Name = "数值类型")] diff --git a/projects/IoT.Shared/Application/Models/EditIoTDataModel.cs b/projects/IoT.Shared/Application/Models/EditIoTDataModel.cs index 6349b2c4..60498562 100644 --- a/projects/IoT.Shared/Application/Models/EditIoTDataModel.cs +++ b/projects/IoT.Shared/Application/Models/EditIoTDataModel.cs @@ -1,9 +1,9 @@ -using Infrastructure.Application; using Application.Domain.Entities; +using Infrastructure.Application; using IoT.Shared.Areas.IoTCenter.Controlls; using System; -using System.ComponentModel.DataAnnotations; using System.ComponentModel; +using System.ComponentModel.DataAnnotations; namespace IoT.Shared.Application.Models { @@ -38,11 +38,14 @@ namespace IoT.Shared.Application.Models [Required(ErrorMessage = nameof(RequiredAttribute))] public string Name { get; set; } - [Display(Name = "数据类型")] + + [SelectList] + [Display(Name = "数据分类")] [ReadOnlyForEdit] [Required(ErrorMessage = nameof(RequiredAttribute))] public IoTDataType? DataType { get; set; } + [SelectList] [Display(Name = "数值类型")] [ReadOnlyForEdit] [Required(ErrorMessage = nameof(RequiredAttribute))] @@ -54,7 +57,6 @@ namespace IoT.Shared.Application.Models [Description("描述枚举、对象和数组的类型定义")] public string ValueSchema { get; set; } - [Display(Name = "单位")] [ReadOnlyForEdit] public string Unit { get; set; } @@ -63,6 +65,7 @@ namespace IoT.Shared.Application.Models [ReadOnlyForEdit] public string Description { get; set; } + [SkipSearch] [Display(Name = "时间戳")] [ReadOnlyForEdit] [Required(ErrorMessage = nameof(RequiredAttribute))] diff --git a/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs b/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs index 56042e93..5b240be3 100644 --- a/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs +++ b/projects/Platform/Areas/IoTCenter/Controllers/IoTDataController.cs @@ -66,6 +66,7 @@ namespace IoT.Shared.Areas.IoTCenter.Controlls .WhereIf(!string.IsNullOrEmpty(model.Query.Name), o => o.Name.Contains(model.Query.Name)) .WhereIf(!string.IsNullOrEmpty(model.Query.Key), o => o.Key.Contains(model.Query.Key)) .WhereIf(!string.IsNullOrEmpty(model.Query.Value), o => o.Value.Contains(model.Query.Value)) + .WhereIf(model.Query.DataType.HasValue, o => o.DataType == model.Query.DataType.Value) .WhereIf(model.Query.ValueType.HasValue, o => o.ValueType == model.Query.ValueType.Value) .WhereIf(!string.IsNullOrEmpty(model.Query.Unit), o => o.Unit.Contains(model.Query.Unit)) .WhereIf(!string.IsNullOrEmpty(model.Query.Description), o => o.Description.Contains(model.Query.Description))