From 1f1a01ede353e763f1e585202dff046b3982d67f Mon Sep 17 00:00:00 2001 From: wanli Date: Thu, 17 Nov 2022 09:36:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?[Frontend]=20=E7=9B=A3=E6=8E=A7=E7=B3=BB?= =?UTF-8?q?=E7=B5=B1>=E9=9B=BB=E6=A2=AF=E7=B3=BB=E7=B5=B1>=E5=8D=B3?= =?UTF-8?q?=E6=99=82=E8=B3=87=E6=96=99=E5=92=8C=E7=95=B0=E5=B8=B8=E8=B3=87?= =?UTF-8?q?=E6=96=99=EF=BC=8C=E6=94=BE=E5=85=A5=E6=B8=AC=E8=A9=A6=E8=B3=87?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Frontend/_sysMonAll.html | 152 +++++++++++------- Frontend/index.html | 15 +- Frontend/js/n4js/alarmbaja.js | 12 +- .../js/yourteam/yourteam.jquery.datatables.js | 44 ++--- 4 files changed, 130 insertions(+), 93 deletions(-) diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index 1f537fb..896e0f5 100644 --- a/Frontend/_sysMonAll.html +++ b/Frontend/_sysMonAll.html @@ -72,6 +72,7 @@ strHtml += `` $.each(floObj.device_list, (index2, devObj) => { + console.log(">>>> url: " + baseImgUrl + " , img: " + varPathImg + ", icon: " + devObj.device_master_icon); strHtml += `
... @@ -87,26 +88,11 @@ } function drawStateTabBlo() { - let strHtml = ` - - - - - - - - - - - - - - - - - - -
電壓 V113
電流 A8
功率 W203
今日用電 kWh58
` + let strHtml = ` + +
` return strHtml; } @@ -155,45 +141,8 @@ } function drawErrRecTabBlo() { - let strHtml = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + let strHtml = `
設備編號B01-B2-19F-CR-0013D 座標113
設備名稱A區迴路001forge dbid101
廠牌飛利浦 PhilipIP192.168.1.105
型號BH065
原廠文件2022使用手冊.pdf
型號BH065
+
` return strHtml; } @@ -236,9 +185,11 @@
`, group:"device", onShow: function (tooltipEle, oriEle) { - console.log($(oriEle).data("number")) + console.log( "ori: " + $(oriEle).data("number")) var tab = new YT.Tab({ tabName: "cardTab" }) loadOpeRecTable(); + //loadErrRecTable2($(oriEle).data("number")); + loadErrRecTable(); } }) @@ -281,6 +232,87 @@ opeRecTable = new YourTeam.JqDataTables.getTableByAjax(url, tag, null, columns, column_defs, callback, null, null, null, null, null, "tpi"); } + + function loadErrRecTable() { + let tag = "#errRecTable"; + let datas; + //getOneDeviceAlarmTop10ByBaja(_devicePath, callback); + + let column_defs = [ + { "targets": [0], "width": "8%", "sortable": true }, + { "targets": [1], "width": "8%", "sortable": true }, + { "targets": [2], "width": "7%", "sortable": true }, + { "targets": [3], "width": "7%", "sortable": true }, + ]; + + let columns = [ + { + "title": "異常ID", + "data": "uuid", + }, + { + "title": "異常原因", + "data": "msgText", + }, + { + "title": "ACK確認", + "data": "ackState", + }, + { + "title": "發生/賦歸時間", + "data": "timestamp", + }, + + ]; + + //let callback = function (result) { + // datas = result; + //} + let result = '{"count": 2,"data":[{ "uuid": "43dc7846-bd96-4be2-ab35-f11aec729c60","msgText": "","ackState": "1","timestamp": "2022-Nov-16 10:30:24.951 AM UTC+08:00"},{"uuid": "7c309846-d862-4a8b-803b-cdc8e0efa092","msgText": "","ackState": "1","timestamp": "2022-Nov-16 10:00:24.893 AM UTC+08:00"}]}'; + let json_object = JSON.parse(result); + datas = json_object['data']; + errRecTable = new YourTeam.JqDataTables.getTableByStatic(tag, datas, columns, column_defs); + } + + //function loadErrRecTable2(allPath) { + // if (allPath != undefined && allPath != null) { + // let _pathArr = allPath.split("_");//TPE_B1_ELEV_EL_R2F_NA_ELEV1_N1 + // let _devicePath = _pathArr[0] + "_" + _pathArr[1] + "_" + _pathArr[2] + "_" + _pathArr[3] + "_" + _pathArr[4] + "_" + _pathArr[5]; + // //getOneDeviceAlarmTop10ByBaja(_devicePath, callback); + // console.log("devicePath: " + _devicePath); + // let result = '{"count": 2,"0": { "uuid": "43dc7846-bd96-4be2-ab35-f11aec729c60","timestamp": "2022-Nov-16 10:30:24.951 AM UTC+08:00","sourceName": "TPE_B1_ELEV_EL_R2F_NA_ELEV1_N1_TRIP","sourceState": "1","msgText": "","ackState": "1","normalTime": "1970-Jan-1 08:00:00.000 AM UTC+08:00"},"1": {"uuid": "7c309846-d862-4a8b-803b-cdc8e0efa092","timestamp": "2022-Nov-16 10:00:24.893 AM UTC+08:00","sourceName": "TPE_B1_ELEV_EL_R2F_NA_ELEV1_N1_TRIP","sourceState": "0","msgText": "","ackState": "1","normalTime": "2022-Nov-16 10:15:24.939 AM UTC+08:00"}}'; + // let result_Json = JSON.parse(result) + // var eachTable = $('.each-table tbody'); + + // for (var i = 0; i < result_Json['count']; i++) + // { + // item = result_Json[i.toString()]; + // eachTable.append( + // '' + + // '' + item.uuid + '' + + // '' + item.msgText + '' + + // '' + (item.ackState = 1 ? item.normalTime : '未確認') + '' + + // '' + item.timestamp + '' + + // ''); + // } + + // } + + // let callback = function (result) { + // var eachTable = $('.each-table tbody'); + // $.each(result, function (index, element) { + // eachTable.append( + // '' + + // '' + element[index].uuid + '' + + // '' + element[index].msgText + '' + + // '' + (element[index].ackState = 1 ? element[index].normalTime : '未確認') + '' + + // '' + element[index].timestamp + '' + + // ''); + // }); + // } + //} } + + \ No newline at end of file diff --git a/Frontend/index.html b/Frontend/index.html index ade6287..40bf6c9 100644 --- a/Frontend/index.html +++ b/Frontend/index.html @@ -1116,10 +1116,10 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li @@ -2064,11 +2064,12 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li - +