diff --git a/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 b/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 index cd20bf8..f1ee907 100644 Binary files a/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 and b/.vs/IoTGateway/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/IoTGateway/project-colors.json b/.vs/IoTGateway/project-colors.json index ab40e60..aba7690 100644 --- a/.vs/IoTGateway/project-colors.json +++ b/.vs/IoTGateway/project-colors.json @@ -135,7 +135,17 @@ "ProjectGuid": "89de240e-5393-4dd4-87c9-3ad9d44b6e7e", "DisplayName": "WalkingTec.Mvvm.Core", "ColorIndex": 9 + }, + "e63c22d5-5f9b-4671-b115-40721b27f09f": { + "ProjectGuid": "e63c22d5-5f9b-4671-b115-40721b27f09f", + "DisplayName": "IoTGateway.ViewModel", + "ColorIndex": 10 + }, + "44619988-9f09-4714-9532-a44faf8275fe": { + "ProjectGuid": "44619988-9f09-4714-9532-a44faf8275fe", + "DisplayName": "IoTGateway.Model", + "ColorIndex": 11 } }, - "NextColorIndex": 10 + "NextColorIndex": 12 } \ No newline at end of file diff --git a/.vs/IoTGateway/v17/.futdcache.v1 b/.vs/IoTGateway/v17/.futdcache.v1 index 2553807..5cfc7a7 100644 Binary files a/.vs/IoTGateway/v17/.futdcache.v1 and b/.vs/IoTGateway/v17/.futdcache.v1 differ diff --git a/.vs/IoTGateway/v17/.suo b/.vs/IoTGateway/v17/.suo index 0b1a2b5..93918d5 100644 Binary files a/.vs/IoTGateway/v17/.suo and b/.vs/IoTGateway/v17/.suo differ diff --git a/.vs/IoTGateway/v17/fileList.bin b/.vs/IoTGateway/v17/fileList.bin index b905989..f18580b 100644 Binary files a/.vs/IoTGateway/v17/fileList.bin and b/.vs/IoTGateway/v17/fileList.bin differ diff --git a/IoTGateway.Model/DeviceVariable.cs b/IoTGateway.Model/DeviceVariable.cs index 544fe3f..26b9d7d 100644 --- a/IoTGateway.Model/DeviceVariable.cs +++ b/IoTGateway.Model/DeviceVariable.cs @@ -29,7 +29,7 @@ namespace IoTGateway.Model public ProtectTypeEnum ProtectType { get; set; } public Device Device { get; set; } - [Display(Name = "采集点")] + [Display(Name = "设备")] public Guid? DeviceId { get; set; } } } \ No newline at end of file diff --git a/IoTGateway.ViewModel/BasicData/DeviceVMs/DeleteDevices.cs b/IoTGateway.ViewModel/BasicData/DeviceVMs/DeleteDevices.cs index 9263bfc..e9416a3 100644 --- a/IoTGateway.ViewModel/BasicData/DeviceVMs/DeleteDevices.cs +++ b/IoTGateway.ViewModel/BasicData/DeviceVMs/DeleteDevices.cs @@ -7,6 +7,7 @@ using System.Threading.Tasks; using WalkingTec.Mvvm.Core; using WalkingTec.Mvvm.Core.Extensions; using IoTGateway.Model; +using Microsoft.EntityFrameworkCore; namespace IoTGateway.ViewModel.BasicData.DeviceVMs { @@ -19,7 +20,7 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs { try { - var daps = DC.Set().Where(x => Ids.Contains(x.ID)).ToList(); + var daps = DC.Set().Include(x => x.Children).Where(x => Ids.Contains(x.ID)).ToList(); foreach (var dap in daps) { @@ -28,9 +29,9 @@ namespace IoTGateway.ViewModel.BasicData.DeviceVMs deleteRet.Message = "采集点不存在,可能已经被删除了"; return deleteRet; } - else if (dap.DeviceTypeEnum == DeviceTypeEnum.Group) + else if (dap.DeviceTypeEnum == DeviceTypeEnum.Group && dap.Children.Count() != 0) { - deleteRet.Message = "有风险,暂不支持组删除"; + deleteRet.Message = "组内还有设备,暂不支持组删除"; return deleteRet; } else diff --git a/IoTGateway/Areas/BasicData/Views/DeviceConfig/Create.cshtml b/IoTGateway/Areas/BasicData/Views/DeviceConfig/Create.cshtml index e895873..3683df8 100644 --- a/IoTGateway/Areas/BasicData/Views/DeviceConfig/Create.cshtml +++ b/IoTGateway/Areas/BasicData/Views/DeviceConfig/Create.cshtml @@ -3,11 +3,11 @@ + -