@@ -233,7 +252,7 @@
-
即時功率:
+
${devItem?.full_name}:${devItem?.unit}
詳細資料
diff --git a/Frontend/index.html b/Frontend/index.html
index 95f51a5..e1ad296 100644
--- a/Frontend/index.html
+++ b/Frontend/index.html
@@ -928,6 +928,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
pageAct.sysSubTag = $(this).data("subSysObj").sub_system_tag;
pageAct.sysSubName = $(this).data("subSysObj").full_name;
pageAct.sysSubObj = $(this).data("subSysObj");
+ getDevItem();
})
onEvent("active:change", "#buiList", function (e, actEle) {
@@ -1350,6 +1351,22 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
$(loadEle).Loading("close");
}
+ function getDevItem() {
+ let url = baseApiUrl + "/api/Device/GetDeviceItem";
+
+ objSendData.Data = {
+ main_system_tag: pageAct.sysMainTag,
+ sub_system_tag: pageAct.sysSubTag,
+ }
+ ytAjax = new YourTeam.Ajax(url, objSendData, function (res) {
+ if (!res || res.code != "0000" || !res.data) {
+
+ } else {
+ pageAct.devItems = res.data;
+ }
+ }, null, "POST").send();
+ }
+
function alarmIconBlink(data) {
if (data?.data.length != 0) {
$(".page-header [name=topFunBtn][data-page=alert] i").addClass("blink");
diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs
index 9278553..1f0e2eb 100644
--- a/FrontendWebApi/ApiControllers/DeviceManageController.cs
+++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs
@@ -872,5 +872,43 @@ namespace FrontendWebApi.ApiControllers
}
return Ok(apiResult);
}
+
+ ///
+ /// 取得 Device Item 系統小類下的點位資訊
+ ///
+ ///
+ ///
+ [HttpPost]
+ [Route("api/Device/GetDeviceItem")]
+ public async Task
>>> GetDeviceItem([FromBody] FindDeviceItem fdi)
+ {
+ ApiResult> apiResult = new ApiResult>();
+
+ if (string.IsNullOrEmpty(fdi.main_system_tag) || string.IsNullOrEmpty(fdi.sub_system_tag))
+ {
+ apiResult.Code = "0002";
+ apiResult.Msg = "需傳入大小類tag";
+ return apiResult;
+ }
+
+ try
+ {
+ var sqlString = $@" SELECT * FROM device_item
+ WHERE deleted = '0' AND device_system_tag = @main_system_tag AND device_name_tag = @sub_system_tag AND points = IFNULL(@points,points)";
+ var param = new { @main_system_tag = fdi.main_system_tag, @sub_system_tag = fdi.sub_system_tag, @points = fdi.points };
+ var fr = await backendRepository.GetAllAsync(sqlString, param);
+
+ apiResult.Code = "0000";
+ apiResult.Data = fr;
+ }
+ catch (Exception exception)
+ {
+ apiResult.Code = "9999";
+ apiResult.Msg = "系統內部錯誤,請聯絡管理者。";
+ Logger.LogError("【" + controllerName + "/" + actionName + "】" + exception.Message);
+ return Ok(apiResult);
+ }
+ return Ok(apiResult);
+ }
}
}
\ No newline at end of file
diff --git a/FrontendWebApi/Models/Device.cs b/FrontendWebApi/Models/Device.cs
index c8db861..0508d4e 100644
--- a/FrontendWebApi/Models/Device.cs
+++ b/FrontendWebApi/Models/Device.cs
@@ -141,4 +141,27 @@ namespace FrontendWebApi.Models
public string device_node_coordinate_3d { get; set; }
public int? forge_dbid { get; set; }
}
+
+ public class DeviceItemViewModel
+ {
+ public int id { get; set; }
+ public short deleted { get; set; }
+ public string full_name { get; set; }
+ public string points { get; set; }
+ public string unit { get; set; }
+ public short is_show { get; set; }
+ public short? is_show_riserDiagram { get; set; }
+ public short is_controll { get; set; }
+ public short is_bool { get; set; }
+ public short is_link { get; set; }
+ public short is_show_history { get; set; }
+ public string device_system_tag { get; set; }
+ public string device_name_tag { get; set; }
+ }
+
+ public class FindDeviceItem : FindDevice
+ {
+ public string points { get; set; }
+
+ }
}