[Frontend] 時間格式統一 Y:M:D H:M:S
This commit is contained in:
parent
a18152e23a
commit
c2bb9cb199
@ -1049,7 +1049,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
function refTable(data) {
|
||||
function refTable(data) {
|
||||
let tag = "#alertTable";
|
||||
|
||||
let column_defs = [
|
||||
@ -1109,16 +1109,7 @@
|
||||
title: "發生時間",
|
||||
data: "timestamp",
|
||||
render: function (data) {
|
||||
return (
|
||||
new Date(data).toLocaleString("zh-tw", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
}),
|
||||
displayDate(data, "datetime")
|
||||
);
|
||||
return displayDate(data);
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -1133,9 +1124,7 @@
|
||||
let btnCol = data == "1" ? "warning" : "info";
|
||||
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>`*/;
|
||||
: `<td><span>${displayDate(row.ackedTime)}</span></td>` /*`<td><button class="btn btn-${btnCol}">${confirm}</button></td>`*/;
|
||||
},
|
||||
},
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
4630
Frontend/index.html
4630
Frontend/index.html
File diff suppressed because it is too large
Load Diff
@ -227,46 +227,29 @@ function getOneDeviceAlarmTop10ByBaja(devicePath, callback) {
|
||||
|
||||
var _occurrenceTime = new Date(
|
||||
record.get("timestamp").$cEncStr
|
||||
).toLocaleString("zh-tw", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
)
|
||||
// _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 _ackTime = new Date(
|
||||
record.get("ackTime").$cEncStr
|
||||
).toLocaleString("zh-tw", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
)
|
||||
// _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 _ackText =
|
||||
record.get("ackState") == 0 ? _ackTime : "未確認";
|
||||
record.get("ackState")
|
||||
_ss.push({
|
||||
uuid: _resultUuid[0],
|
||||
msgText: _msgText,
|
||||
ackState: _ackText,
|
||||
timestamp: _occurrenceTime,
|
||||
normalTime: _normalTime,
|
||||
ackedTime: _ackTime
|
||||
});
|
||||
_index++;
|
||||
},
|
||||
|
@ -1001,9 +1001,9 @@ function BajaSubscribeElectricmeterByBql(
|
||||
);
|
||||
|
||||
//使用bql語法
|
||||
// console.log(
|
||||
// `local:|foxs:${port}|station:|slot:/${ordPathForElectricmeter.devicePath}|bql:select name, out, out.value, slotPath, facets from control:ControlPoint`
|
||||
// );
|
||||
console.log(
|
||||
`local:|foxs:${port}|station:|slot:/${ordPathForElectricmeter.devicePath}|bql:select name, out, out.value, slotPath, facets from control:ControlPoint`
|
||||
);
|
||||
baja.Ord.make(
|
||||
`local:|foxs:${port}|station:|slot:/${ordPathForElectricmeter.devicePath}|bql:select name, out, out.value, slotPath, facets from control:ControlPoint`
|
||||
).get(function (table) {
|
||||
|
Loading…
Reference in New Issue
Block a user