[Frontend][alert]已確認按鈕修正為顯示acked時間

This commit is contained in:
Celeste6666 2023-01-30 14:12:23 +08:00
parent e43389724f
commit 26cec1a136
4 changed files with 25 additions and 17 deletions

View File

@ -249,7 +249,10 @@
/*launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMTEwLm53ZA==');*/ /*launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMTEwLm53ZA==');*/
/*更新B1F + B2F鐵捲門替換空調風機為三菱指定型號*/ /*更新B1F + B2F鐵捲門替換空調風機為三菱指定型號*/
launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMTE2Lm53ZA") /* launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMTE2Lm53ZA")*/
/*新增軌道燈軌道*/
launchViewer("dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dGEzaHFzZmZ6cWJub3V4a3BsZGt1a3NldzRzajIxdzUtYmltc19tb2RlbHMvJUUzJTgwJTkwJUU1JThGJUIwJUU1JThDJTk3JUU0JUI4JUFEJUU4JThGJUIxJUU1JUE0JUE3JUU2JUE4JTkzJUUzJTgwJTkxQVJDJUU5JTlCJTk5JUU2JUE4JUExJUU1JUJDJThGK01FUCVFNiU4QiU4NiVFNyVCMyVCQiVFNyVCNSVCMV8wMTE5Lm53ZA")
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlFX2ZvcmdlX3Rlc3QvJUUzJFTgwJTkwQVJDJUUzJTgwJTkxXzIwMjJfMTJfMTMubndk');//new ARC //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlFX2ZvcmdlX3Rlc3QvJUUzJFTgwJTkwQVJDJUUzJTgwJTkxXzIwMjJfMTJfMTMubndk');//new ARC
//launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwTUVQJUUzJTgwJTkxXzIwMjJfMTJfMTMubndj');//new MEP //launchViewer('dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dnNjb2RlX2ZvcmdlX3Rlc3QvJUUzJTgwJTkwTUVQJUUzJTgwJTkxXzIwMjJfMTJfMTMubndj');//new MEP

View File

@ -694,15 +694,17 @@
return data.split(':')[0]; return data.split(':')[0];
} }
}, },
{ {
"title": "Ack 確認", "title": "Ack 確認",
"data": "ackState", "data": "ackState",
"render": function (data, type, row, meta) { "render": function (data, type, row, meta) {
let confirm = data == "1" ? "未確認" : "確認"; let confirm = data == "1" ? "未確認" : "確認";
let btnCol = data == "1" ? "warning" : "info"; let btnCol = data == "1" ? "warning" : "info";
return data == "1" ? `<td><button onclick="chgAck('${row.uuid}')" class="btn btn-${btnCol}">${confirm}</button></td>` : `<td><button class="btn btn-${btnCol}">${confirm}</button></td>`; return data == "1" ? `<td><button onclick="chgAck('${row.uuid}')" class="btn btn-${btnCol}">${confirm}</button></td>` :
} `<td><span>${new Date(row.ackedTime
}, ).toLocaleString('zh-tw')}</span></td>` /*`<td><button class="btn btn-${btnCol}">${confirm}</button></td>`*/;
}
},
{ {
"title": "派工/維運單號", "title": "派工/維運單號",
"data": "formId", "data": "formId",

View File

@ -801,7 +801,7 @@ License: You must have a valid license purchased only from wrapbootstrap.com (li
/*"lib/jquery-validation/dist/additional-methods.min",*/ /* 會影響 messages_zh_TW 文字呈現 */ /*"lib/jquery-validation/dist/additional-methods.min",*/ /* 會影響 messages_zh_TW 文字呈現 */
"lib/jquery-validation/dist/localization/messages_zh_TW", "lib/jquery-validation/dist/localization/messages_zh_TW",
"lib/jquery-ui/jquery-ui.min", "lib/jquery-ui/jquery-ui.min",
"lib/chart.js_4.1.2/chart.umd", "lib/chart.js/chart.min",
"lib/dropzone/dropzone-min", "lib/dropzone/dropzone-min",
"lib/jstree-master/jstree.min", "lib/jstree-master/jstree.min",
"lib/notifications/sweetalert2/sweetalert2.bundle", "lib/notifications/sweetalert2/sweetalert2.bundle",

View File

@ -95,7 +95,7 @@ function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, i
var _ackState = isAck ? "= 'acked'" : "= 'unacked'"; var _ackState = isAck ? "= 'acked'" : "= 'unacked'";
console.log("local:|foxs:|alarm:|bql:select timestamp, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp asc") console.log("local:|foxs:|alarm:|bql:select timestamp, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp asc")
require(['baja!'], function (baja) { require(['baja!'], function (baja) {
baja.Ord.make("local:|foxs:|alarm:|bql:select timestamp, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp asc").get() baja.Ord.make("local:|foxs:|alarm:|bql:select timestamp, ackTime, ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where alarmClass = '" + alarmClass + "' and timestamp.millis > " + startDate_millisecond + " and timestamp.millis < " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp asc").get()
.then(function (table) { .then(function (table) {
return table.cursor({ return table.cursor({
each: function (record) { each: function (record) {
@ -104,9 +104,11 @@ function getAlarmByBaja(startDate_millisecond, endDate_millisecond, isRecover, i
_sourceName = _sourceTmp[7] + "-" + _sourceTmp[8]; _sourceName = _sourceTmp[7] + "-" + _sourceTmp[8];
if (_index == 0) if (_index == 0)
_ss += '{"buildingFloorName_zh":"' + _bfName + '", "uuid":"' + record.get('uuid') + '", "timestamp":"' + record.get('timestamp') + '", "alarmClass":"' + record.get('alarmClass') + '", "sourceName_zh":"' + _sourceName + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "normalTime":"' + record.get('normalTime') + '"}'; _ss += '{"buildingFloorName_zh":"' + _bfName + '", "uuid":"' + record.get('uuid') + '", "timestamp":"' + record.get('timestamp') + '", "alarmClass":"' + record.get('alarmClass') + '", "sourceName_zh":"' + _sourceName + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "normalTime":"' + record.get('normalTime') + '","ackedTime":"' + record.get('ackTime').$cEncStr
+ '"}';
else else
_ss += ',{"buildingFloorName_zh":"' + _bfName + '", "uuid":"' + record.get('uuid') + '", "timestamp":"' + record.get('timestamp') + '", "alarmClass":"' + record.get('alarmClass') + '", "sourceName_zh":"' + _sourceName + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "normalTime":"' + record.get('normalTime') + '"}'; _ss += '{"buildingFloorName_zh":"' + _bfName + '", "uuid":"' + record.get('uuid') + '", "timestamp":"' + record.get('timestamp') + '", "alarmClass":"' + record.get('alarmClass') + '", "sourceName_zh":"' + _sourceName + '", "msgText":"' + record.get('alarmData').get('msgText') + '", "ackState":"' + record.get('ackState') + '", "normalTime":"' + record.get('normalTime') + '","ackedTime":"' + record.get('ackTime').$cEncStr
+ '"}';
_index++; _index++;
}, },
after: function () { after: function () {
@ -574,9 +576,9 @@ function getAllDeviceAlarmByBaja(startDate_millisecond, endDate_millisecond, isR
if (startDate_millisecond) { if (startDate_millisecond) {
startUrl = "timestamp.millis >= " + startDate_millisecond + " and "; startUrl = "timestamp.millis >= " + startDate_millisecond + " and ";
} }
console.log("local:|foxs:|alarm:|bql:select timestamp, priority ,ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where " + startUrl + "timestamp.millis <= " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp desc"); console.log("local:|foxs:|alarm:|bql:select timestamp, ackTime, priority ,ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where " + startUrl + "timestamp.millis <= " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp desc");
baja.Ord.make("local:|foxs:|alarm:|bql:select timestamp, priority ,ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where " + startUrl + "timestamp.millis <= " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp desc").get() baja.Ord.make("local:|foxs:|alarm:|bql:select timestamp, ackTime, priority ,ackState, alarmClass, alarmClassDisplayName, alarmValue, alarmData, alarmData.sourceName, uuid, alarmData.msgText, alarmData.numericValue, alarmData.presentValue, alarmData.status, alarmData.toState, normalTime from openAlarms where " + startUrl + "timestamp.millis <= " + endDate_millisecond + " and normalTime " + _recoverState + " and ackState " + _ackState + " order by timestamp desc").get()
.then(function (table) { .then(function (table) {
return table.cursor({ return table.cursor({
each: function (record) { each: function (record) {
@ -597,7 +599,8 @@ function getAllDeviceAlarmByBaja(startDate_millisecond, endDate_millisecond, isR
main.devicePath = _sourceTmp.slice(0, 8).join("_");; main.devicePath = _sourceTmp.slice(0, 8).join("_");;
main.msgText = record.get('alarmData').get('msgText'); main.msgText = record.get('alarmData').get('msgText');
main.normalTime = record.get('normalTime'); main.normalTime = record.get('normalTime');
main.priority = record.get('priority'); main.priority = record.get('priority');
main.ackedTime = record.get('ackTime').$cEncStr;
_result.data.push(main); _result.data.push(main);
_index++; _index++;
}, },