diff --git a/Frontend/index.html b/Frontend/index.html index e483f55..b92f6b1 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -812,7 +812,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li /*"lib/jquery-validation/dist/additional-methods.min",*/ /* 會影響 messages_zh_TW 文字呈現 */ "lib/jquery-validation/dist/localization/messages_zh_TW", "lib/jquery-ui/jquery-ui.min", - "lib/chart.js_4.1.2/chart.umd", + "lib/chart.js/chart.min", "lib/dropzone/dropzone-min", "lib/jstree-master/jstree.min", "lib/notifications/sweetalert2/sweetalert2.bundle", diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 228f11a..92b8af8 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -10,6 +10,7 @@ using Repository.FrontendRepository.Interface; using System; using System.Collections.Generic; using System.Collections.Specialized; +using System.Data.SqlTypes; using System.Diagnostics; using System.IO; using System.Linq; @@ -261,6 +262,9 @@ namespace FrontendWebApi.ApiControllers { ApiResult> apiResult = new ApiResult>(); + //是否顯示DeviceNode + string sqlStringqueryModuleLightNodeDisplay = $"SELECT system_value FROM variable WHERE system_type = 'module' AND system_key = 'displaynode'"; + string displayNode = await backendRepository.GetOneAsync(sqlStringqueryModuleLightNodeDisplay); if (string.IsNullOrEmpty(fd.sub_system_tag)) { apiResult.Code = "0001"; @@ -317,7 +321,7 @@ namespace FrontendWebApi.ApiControllers f.device_list = dl; } - + apiResult.Module = displayNode; apiResult.Data = fl; apiResult.Code = "0000"; } @@ -751,12 +755,30 @@ namespace FrontendWebApi.ApiControllers @device_name_tag = p.device_name_tag, @device_floor_tag = p.device_floor_tag }; - var d = await backendRepository.GetAllAsync($@"select device_guid,device_number,device_floor_tag,device_coordinate_3d,forge_dbid, full_name + var dl = await backendRepository.GetAllAsync($@"select device_guid,device_number,device_floor_tag,device_coordinate_3d,forge_dbid, full_name from device where deleted = 0 and device_area_tag = @device_area_tag and device_building_tag = @device_building_tag and device_system_tag = @device_system_tag and device_name_tag = @device_name_tag and device_floor_tag = ifnull(@device_floor_tag, device_floor_tag) ", param); - apiResult.Data = d; + foreach (var d in dl) + { + var sql_node = $@"SELECT + dn.device_node_guid, + dn.device_guid, + dn.full_name AS Device_node_full_name, + dn.device_node_coordinate, + dn.priority, + dn.forge_dbid + FROM device_node dn + WHERE dn.deleted = 0 AND dn.device_guid = @device_guid + ORDER BY dn.priority ASC"; + + d.Device_nodes = await backendRepository.GetAllAsync(sql_node, new { device_guid = d.device_guid }); + } + + + + apiResult.Data = dl; apiResult.Code = "0000"; } else diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs index 158ad9e..88e0b3c 100644 --- a/FrontendWebApi/Models/Device.cs +++ b/FrontendWebApi/Models/Device.cs @@ -149,6 +149,7 @@ namespace FrontendWebApi.Models public string device_coordinate_3d { get; set; } public string full_name { get; set; } public int? forge_dbid { get; set; } + public List Device_nodes { get; set; } } public class DevNodeForCor diff --git a/FrontendWebApi/Models/Share.cs b/FrontendWebApi/Models/Share.cs index 0792bf0..7c0e4da 100644 --- a/FrontendWebApi/Models/Share.cs +++ b/FrontendWebApi/Models/Share.cs @@ -202,6 +202,7 @@ namespace FrontendWebApi.Models ErrorCode errorCode = new ErrorCode(); private string msg = string.Empty; public string Code { get; set; } + public string Module { get; set; } public string Msg { get