diff --git a/Frontend/_sysMonAll.html b/Frontend/_sysMonAll.html index 800c867..0412120 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; } @@ -154,45 +140,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; } @@ -234,18 +183,18 @@
- - `, - group: "device", - onShow: function (tooltipEle, oriEle) { - var tab = new YT.Tab({ tabName: "cardTab" }) - //基本資料tab block - $("#info").append(drawInfoTabBlo(devGuid)) - loadOpeRecTable(); - } - }) + + `, + group:"device", + onShow: function (tooltipEle, oriEle) { + var tab = new YT.Tab({ tabName: "cardTab" }) + //基本資料tab block + $("#info").append(drawInfoTabBlo(devGuid)) + loadOpeRecTable(); + //loadErrRecTable2($(oriEle).data("number")); + loadErrRecTable(); + } }) - function loadOpeRecTable() { let url = "https://api.npoint.io/31e717774a0f5822cc7b"; @@ -286,6 +235,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 - +