From d625ffb16a4cfb5c05f99e5176b3b0cbdf64bfdc Mon Sep 17 00:00:00 2001 From: dev01 Date: Fri, 18 Nov 2022 18:30:19 +0800 Subject: [PATCH] =?UTF-8?q?[Frontend]=20[=E7=B3=BB=E7=B5=B1=E7=9B=A3?= =?UTF-8?q?=E6=8E=A7]=20=E7=87=88=E8=99=9F=E5=BE=8C=E7=AB=AF=E8=B3=87?= =?UTF-8?q?=E6=96=99=E4=B8=B2=E6=8E=A5=20|=20=E4=B8=8A=E6=96=B9=E6=A8=93?= =?UTF-8?q?=E5=B1=A4topbar=E9=AB=98=E5=BA=A6=E8=AA=BF=E7=AA=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_sysMonAll.html | 37 +++++++++++++++---- Frontend/_systemMonitor.html | 12 +++--- Frontend/css/site.css | 6 +++ Frontend/index.html | 23 ++++++++---- .../ApiControllers/DeviceManageController.cs | 2 +- 5 files changed, 57 insertions(+), 23 deletions(-) diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index 25dbb39..e32aeb1 100644 --- a/Frontend/_sysMonAll.html +++ b/Frontend/_sysMonAll.html @@ -1,6 +1,6 @@ 
-
-

-
+
+ +
@@ -47,9 +47,9 @@ if (!res || res.code != "0000" || !res.data) { } else { - let strHtml = ``; + let strHtml = ``; $.each(res.data, (index, floObj) => { - strHtml += ``; + strHtml += ``; }) $("#floList").html(strHtml); floList = res.data; diff --git a/Frontend/css/site.css b/Frontend/css/site.css index 18013f4..9883cbf 100644 --- a/Frontend/css/site.css +++ b/Frontend/css/site.css @@ -3,7 +3,13 @@ background: rgba(0, 0, 0, 0.03); } +.btn-sm-2 { + padding: 2px 19px; +} +.table.dataTable td { + word-break:break-all; +} /* ================================================================ */ /* 單一方法 */ diff --git a/Frontend/index.html b/Frontend/index.html index 0fbc796..6a9123b 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -2077,8 +2077,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li } $(function () { - getSysMonBtnList(); getBuiList(); + getSysMonBtnList(); }) @@ -2095,9 +2095,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li onEvent("active:change", "#sysMonBtnList", function (e, actEle) { if (actEle) { - pageAct.sysMainTag = $(actEle).data("maintag"); - pageAct.sysSubTag = $(actEle).prop("id").split("subSysBtn")[1]; - pageAct.sysSubName = $(actEle).text(); + pageAct.sysMainTag = $(actEle).data("subSysObj").main_system_tag; + pageAct.sysSubTag = $(actEle).data("subSysObj").sub_system_tag; + pageAct.sysSubName = $(actEle).data("subSysObj").full_name; + pageAct.sysSubObj = $(actEle).data("subSysObj"); } $(this).trigger("change"); }) @@ -2115,17 +2116,23 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li function getSysMonBtnList() { let url = baseApiUrl + "/api/Device/GetMainSub"; - ytAjax = new YourTeam.Ajax(url, null, function (res) { + let sendData = { + building_tag: pageAct.buiTag, + }; + objSendData.Data = sendData; + ytAjax = new YourTeam.Ajax(url, objSendData, function (res) { if (!res || res.code != "0000" || !res.data) { } else { - let strHtml = ``; + $("#sysMonBtnList").html() $.each(res.data.history_Main_Systems, (index, mainSysObj) => { $.each(mainSysObj.history_Sub_systems, (index2, subSysObj) => { - strHtml += ``; + let btn = creBtn(subSysObj.full_name, `subSysBtn${subSysObj.sub_system_tag}`, "topFunBtn", ["dropdown-item"], { page: "systemMonitor" }); + subSysObj.main_system_tag = mainSysObj.main_system_tag; + btn.data("subSysObj", subSysObj); + $("#sysMonBtnList").append(btn); }) }) - $("#sysMonBtnList").append(strHtml); } }, null, "POST").send(); } diff --git a/FrontendWebApi/ApiControllers/DeviceManageController.cs b/FrontendWebApi/ApiControllers/DeviceManageController.cs index 17ed926..c6a3e65 100644 --- a/FrontendWebApi/ApiControllers/DeviceManageController.cs +++ b/FrontendWebApi/ApiControllers/DeviceManageController.cs @@ -61,7 +61,7 @@ namespace FrontendWebApi.ApiControllers { var dbsub = await frontendRepository.GetAllAsync( @$"select distinct v1.system_key main_name, v1.system_value main_system_tag, v2.system_key sub_name, v2.system_value sub_system_tag, v1.system_priority, v2.system_priority, - dk.device_normal_color, dk.device_error_color, dk.device_error_color + dk.device_normal_color, dk.device_close_color, dk.device_error_color from role_auth a join auth_page b on a.AuthCode = b.AuthCode join userinfo c on c.role_guid = a.role_guid