[Frontend] 修改系統監控告警 ack 狀態 | 運維保養刪除異常編號欄位 | 告警新增維修單時自動抓取該設備

This commit is contained in:
Celeste 2023-10-06 14:37:37 +08:00
parent bca579903b
commit a18152e23a
4 changed files with 3831 additions and 2989 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1629,7 +1629,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
title: "發生/完成時間", title: "發生/完成時間",
data: "finishTime", data: "finishTime",
render: function (data, type, row) { render: function (data, type, row) {
return row.createdAt + "<br>" + data; return row.createdAt + "<br>" + (data.includes("0001")? "未完工": data);
}, },
}, },
]; ];
@ -1758,7 +1758,6 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
// Card - 異常紀錄 Table // Card - 異常紀錄 Table
function callbackForErr(result) { function callbackForErr(result) {
// console.log("@@@",result)
if (errRecTable) { if (errRecTable) {
errRecTable.destroy(); errRecTable.destroy();
} }
@ -1787,8 +1786,8 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
data: "ackState", data: "ackState",
}, },
{ {
title: "發生/完成時間", title: "發生時間",
data: "normalTime", data: "timestamp",
// "render": function (data, type, row) { // "render": function (data, type, row) {
// return row.timestamp + "<br>" + data; // return row.timestamp + "<br>" + data;
// }, // },

View File

@ -212,7 +212,7 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
//{ "count":2,"data": [{ "time": "2022/11/14 15:00:00", "errId": "0001", "ackCheck": "未確認", "errReason": "燈泡故障" }, { "time": "2022/11/14 15:00:00", "errId": "0002", "ackCheck": "未確認", "errReason": "燈泡故障" }]} //{ "count":2,"data": [{ "time": "2022/11/14 15:00:00", "errId": "0001", "ackCheck": "未確認", "errReason": "燈泡故障" }, { "time": "2022/11/14 15:00:00", "errId": "0002", "ackCheck": "未確認", "errReason": "燈泡故障" }]}
require(["baja!"], function (baja) { require(["baja!"], function (baja) {
baja.Ord.make( baja.Ord.make(
"local:|foxs:|alarm:|bql:select top 10 timestamp, ackState, alarmData, alarmData.sourceName, sourceState, uuid, alarmData.msgText, normalTime where alarmData.sourceName like '%" + "local:|foxs:|alarm:|bql:select top 10 timestamp, ackState, ackTime, alarmData, alarmData.sourceName, sourceState, uuid, alarmData.msgText, normalTime where alarmData.sourceName like '%" +
devicePath + devicePath +
"%' order by timestamp desc" "%' order by timestamp desc"
) )
@ -237,8 +237,8 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
// _occurrenceTime += _timestampTemp.getFullYear().toString() + "-" + addzero(_timestampTemp.getMonth() + 1).toString() + "-" + addzero(_timestampTemp.getDate()).toString() + " " + addzero(_timestampTemp.getHours()).toString() + ":" + addzero(_timestampTemp.getMinutes()).toString() + ":" + addzero(_timestampTemp.getSeconds()).toString(); // _occurrenceTime += _timestampTemp.getFullYear().toString() + "-" + addzero(_timestampTemp.getMonth() + 1).toString() + "-" + addzero(_timestampTemp.getDate()).toString() + " " + addzero(_timestampTemp.getHours()).toString() + ":" + addzero(_timestampTemp.getMinutes()).toString() + ":" + addzero(_timestampTemp.getSeconds()).toString();
//var _occurrenceTime = _timestamp.format("yyyy-MM-dd hh:mm:ss");//.toLocaleString(); //var _occurrenceTime = _timestamp.format("yyyy-MM-dd hh:mm:ss");//.toLocaleString();
var _normalTime = new Date( var _ackTime = new Date(
record.get("normalTime").$cEncStr record.get("ackTime").$cEncStr
).toLocaleString("zh-tw", { ).toLocaleString("zh-tw", {
year: "numeric", year: "numeric",
month: "2-digit", month: "2-digit",
@ -248,9 +248,19 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
}); });
// _normalTime += _normaltime.getFullYear().toString() + "-" + addzero(_normaltime.getMonth() + 1).toString() + "-" + addzero(_normaltime.getDate()).toString() + " " + addzero(_normaltime.getHours()).toString() + ":" + addzero(_normaltime.getMinutes()).toString() + ":" + addzero(_normaltime.getSeconds()).toString(); // _normalTime += _normaltime.getFullYear().toString() + "-" + addzero(_normaltime.getMonth() + 1).toString() + "-" + addzero(_normaltime.getDate()).toString() + " " + addzero(_normaltime.getHours()).toString() + ":" + addzero(_normaltime.getMinutes()).toString() + ":" + addzero(_normaltime.getSeconds()).toString();
var _normalTime = new Date(
record.get("normalTime").$cEncStr
).toLocaleString("zh-tw", {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
});
var _msgText = record.get("alarmData").get("msgText"); // == 1 ? _occurrenceTime : "未確認"; var _msgText = record.get("alarmData").get("msgText"); // == 1 ? _occurrenceTime : "未確認";
var _ackText = var _ackText =
record.get("ackState") == 1 ? _occurrenceTime : "未確認"; record.get("ackState") == 0 ? _ackTime : "未確認";
_ss.push({ _ss.push({
uuid: _resultUuid[0], uuid: _resultUuid[0],
msgText: _msgText, msgText: _msgText,