運維管理
-
-
-
-
-
-
-
-
+ 能源管理
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+ + - 用電狀況 +
+
+
+
+
+
+
+ 今日耗電量 (kWh)
+
+
+
+
+ 無資料
+
+
+
+
+
+ 用電比較
+
+
+ 無資料
+
+
+
+
+
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
- 自動需量管理
-
-
+
-
+
+
-
- - - 用電狀況 -
-
-
-
-
-
-
- 今日耗電量 (kWh)
-
-
-
-
- 無資料
-
-
-
-
-
- 用電比較
-
-
- 無資料
-
-
-
-
-
+
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
-
- 自動需量管理
- - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
- - 編輯自動需量 -
- -
-
-
-
-
-
+
\ No newline at end of file
diff --git a/Frontend/_historyData.html b/Frontend/_historyData.html
index 2801674..b9f43d1 100644
--- a/Frontend/_historyData.html
+++ b/Frontend/_historyData.html
@@ -1,6 +1,6 @@
+
+
+
+
+
+ + 編輯自動需量 +
+歷史資料
- +
@@ -33,7 +33,7 @@
@@ -76,7 +85,8 @@
-
-
+
@@ -52,7 +52,7 @@
@@ -72,7 +72,7 @@
var historyTable = null;
$(function () {
initList();
-
+
// default list filter
initApp.listFilter($('#js_default_list'), $('#js_default_list_filter'));
// custom response message
@@ -90,21 +90,21 @@
onEvent('change', '#his_startdate', function () {
let today = displayDate(new Date(Date.now()), 'date').replaceAll('/', '-');
- let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-');
+ let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-');
if (pageAct.dateType == 'range') {
if ($('#his_startdate').val() > $('#his_enddate input').val() && ($('#his_startdate').val() != "" && $('#his_enddate input').val() != "")) {
- $('#his_startdate').val($('#his_startdate').data('val'));
- toast_error('不可選擇大於結束時間');
- }
- else {
- $('#his_startdate').data('val', $('#his_startdate').val());
+ $('#his_startdate').val($('#his_startdate').data('val'));
+ toast_error('不可選擇大於結束時間');
+ }
+ else {
+ $('#his_startdate').data('val', $('#his_startdate').val());
$('#his_enddate input').data('val', $('#his_enddate input').val());
- $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
- $(`[onclick="setDateType('today', this)"]`).removeClass('btn-info');
- $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
- $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('today', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
if ($('#his_startdate').val() == $('#his_enddate input').val()) {
if ($('#his_startdate').val() == today) {
@@ -112,55 +112,55 @@
$(`[onclick="setDateType('today', this)"]`).addClass('btn-info');
}
else if ($('#his_startdate').val() == ytd) {
- $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
- $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-info');
- }
- }
- }
- }
+ $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
+ $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-info');
+ }
+ }
+ }
+ }
else if ($(this).val() == today) {
$(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
$(`[onclick="setDateType('today', this)"]`).addClass('btn-info');
- $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
- $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
}
else if ($(this).val() == ytd) {
- $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
- $(`[onclick="setDateType('today', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('today', this)"]`).removeClass('btn-info');
$(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
$(`[onclick="setDateType('ytd', this)"]`).addClass('btn-info');
}
});
- onEvent('change', '#his_enddate input', function () {
- let today = displayDate(new Date(Date.now()), 'date').replaceAll('/', '-');
- let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-');
-
+ onEvent('change', '#his_enddate input', function () {
+ let today = displayDate(new Date(Date.now()), 'date').replaceAll('/', '-');
+ let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-');
+
if ($('#his_startdate').val() > $('#his_enddate input').val() && ($('#his_startdate').val() != "" && $('#his_enddate input').val() != "")) {
- $('#his_enddate input').val($('#his_enddate input').data('val'));
- toast_error('不可選擇大於結束時間');
- }
- else {
- $('#his_startdate').data('val', $('#his_startdate').val());
- $('#his_enddate input').data('val', $('#his_enddate input').val());
+ $('#his_enddate input').val($('#his_enddate input').data('val'));
+ toast_error('不可選擇大於結束時間');
+ }
+ else {
+ $('#his_startdate').data('val', $('#his_startdate').val());
+ $('#his_enddate input').data('val', $('#his_enddate input').val());
- $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
- $(`[onclick="setDateType('today', this)"]`).removeClass('btn-info');
- $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
- $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('today', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
- if ($('#his_startdate').val() == $('#his_enddate input').val()) {
- if ($('#his_startdate').val() == today) {
- $(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
- $(`[onclick="setDateType('today', this)"]`).addClass('btn-info');
- }
- else if ($('#his_startdate').val() == ytd) {
- $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
- $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-info');
- }
- }
- }
- });
+ if ($('#his_startdate').val() == $('#his_enddate input').val()) {
+ if ($('#his_startdate').val() == today) {
+ $(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
+ $(`[onclick="setDateType('today', this)"]`).addClass('btn-info');
+ }
+ else if ($('#his_startdate').val() == ytd) {
+ $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary');
+ $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-info');
+ }
+ }
+ }
+ });
});
function initList() {
@@ -176,19 +176,19 @@
$.each(res.data.history_Main_Systems, function (index, val) {
if (pageAct.mainStatus) {
strHtml += `
-
+
${val.full_name}
`;
});
if (pageAct.mainStatus) {
- strHtml += ` `;
- }
+ strHtml += ` `;
+ }
});
$('#js_nested_list').html(strHtml);
@@ -237,54 +237,54 @@
function devPointsList() {
let sendData = {
- device_number: pageAct.deviceNumber
- }
- objSendData.Data = sendData;
- let url = baseApiUrl + "/api/History/GetDevPoi";
+ device_number: pageAct.deviceNumber
+ }
+ objSendData.Data = sendData;
+ let url = baseApiUrl + "/api/History/GetDevPoi";
function success(res) {
let strHtml = ``;
-
+
$.each(res.data, function (index, val) {
if (index == 0) {
- strHtml += ``;
+ strHtml += ``;
pageAct.deviceItem = val.points;
pageAct.devicePoiName = val.full_name + ' ' + val.points;
pageAct.deviceComName = val.parent_path;
getData();
} else {
- strHtml += ``;
- }
+ strHtml += ``;
+ }
});
$('#devPointsList').html(strHtml);
- }
- ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
- }
+ }
+ ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
+ }
function getData(start = null, end = null) {
var sdt = new Date();
- var edt = new Date(new Date().setDate(sdt.getDate() + 1));
+ var edt = new Date(new Date().setDate(sdt.getDate() + 1));
start = start ?? sdt.toLocaleDateString();
end = end ?? edt.toLocaleDateString();
$(loadEle).Loading("start");
callBackFromHistory()
getHistoryDataByBaja(pageAct.deviceNumber + "_" + pageAct.deviceItem,
- new Date(start).getTime(),
- new Date(end).getTime(),
- pageAct.deviceName,
- pageAct.deviceComName,
- callBackFromHistory);
+ new Date(start).getTime(),
+ new Date(end).getTime(),
+ pageAct.deviceName,
+ pageAct.deviceComName,
+ callBackFromHistory);
}
- function callBackFromHistory(res = '{"count":0,"data":[]}') {
+ function callBackFromHistory(res='{"count":0,"data":[]}') {
// console.log("@H1",res)
res = JSON.parse(res);
// console.log("@history",res.data)
loadTable(res.data);
if (historyTable != null) {
let t = $('#historyTable').dataTable();
-
- t.fnClearTable();
+
+ t.fnClearTable();
if (res.data.length > 0)
t.fnAddData(res.data);
}
@@ -303,7 +303,7 @@
pageAct.devicePoiName = $(elem).text();
pageAct.deviceItem = deviceItem;
getData();
- }
+ }
}
function setDateType(type, elem) {
@@ -320,31 +320,31 @@
$('#his_enddate').css('display', 'none');
$('#getmonth').css('display', 'none');
$('#his_startdate').val(date);
-
+
if (type == "today")
getData(formatDate(now, "date", true), formatDate(tmr, "date", true));
else if (type == "ytd")
getData(formatDate(ytd, "date", true), formatDate(now, "date", true));
else {
- $(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
- $(`[onclick="setDateType('today', this)"]`).addClass('btn-info');
- }
+ $(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary');
+ $(`[onclick="setDateType('today', this)"]`).addClass('btn-info');
+ }
}
else if (type == "range") {
- $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
- $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
$('#his_startdate').css('display', 'block');
$('#his_enddate').css('display', 'block');
$('#getmonth').css('display', 'none');
$('#his_startdate').val(now);
- $('#his_startdate').data('val', now);
+ $('#his_startdate').data('val', now);
$('#his_enddate input').val(tmr);
$('#his_enddate input').data('val', tmr);
}
else if (type == "month") {
- $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
- $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
+ $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).removeClass('btn-info');
+ $(`[onclick="setDateType('today', this)"], [onclick="setDateType('ytd', this)"]`).addClass('btn-secondary');
$('#his_startdate').css('display', 'none');
$('#his_enddate').css('display', 'none');
@@ -352,8 +352,8 @@
$('#getmonth').val(now.substr(0, 7));
}
else if (type == "ytd") {
- $('#his_startdate').css('display', 'block');
- $('#his_enddate').css('display', 'none');
+ $('#his_startdate').css('display', 'block');
+ $('#his_enddate').css('display', 'none');
$('#getmonth').css('display', 'none');
$('#his_startdate').val(ytd);
}
@@ -361,11 +361,11 @@
function searchDate() {
let start = new Date($('#his_startdate').val());
- let end = new Date(new Date().setDate(new Date($('#his_enddate input').val()).getDate() + 1));
-
+ let end = new Date(new Date().setDate(new Date($('#his_enddate input').val()).getDate() + 1));
+
if (pageAct.dateType == "day")
end = new Date(new Date().setDate(start.getDate() + 1));
- else if (pageAct.dateType == "month") {
+ else if (pageAct.dateType == "month") {
start = new Date($('#getmonth').val());
end = new Date(new Date().setDate(start.getDate() + 30));
}
@@ -382,72 +382,72 @@
date = displayDate(date, type);
let month = date.split('/')[1];
let year = date.split('/')[0];
- let day = date.split('/')[2];
+ let day= date.split('/')[2];
return month + "/" + day + "/" + year;
- }
+ }
}
function loadTable(data) {
if (data) {
$.each(data, function (i, v) {
// console.log("loadTable",pageAct.devicePoiName.split(" ")[0])
- v.type = pageAct.devicePoiName.split(" ")[0];
+ v.type = pageAct.devicePoiName.split(" ")[0];
});
}
- let tag = "#historyTable";
-
- let column_defs = [
- { "targets": [0], "width": "20%", "sortable": true },
- { "targets": [1], "width": "20%", "sortable": true },
+ let tag = "#historyTable";
+
+ let column_defs = [
+ { "targets": [0], "width": "20%", "sortable": true },
+ { "targets": [1], "width": "20%", "sortable": true },
{ "targets": [2], "width": "20%", "sortable": true }
- ];
+ ];
let columns = [
{
"title": "類別",
"data": "type"
},
- {
- "title": "設備名稱",
- "data": "deviceName",
- },
- {
- "title": "數值",
+ {
+ "title": "設備名稱",
+ "data": "deviceName",
+ },
+ {
+ "title": "數值",
"data": "value",
"render": function (data) {
- if (isNaN(data)) {
+ if(isNaN(data)){
return data
}
return data.roundDecimal(2);
}
- },
- {
- "title": "紀錄時間",
+ },
+ {
+ "title": "紀錄時間",
"data": "timestamp",
"render": function (data) {
// console.log(data)
- return displayDate(data, "datetime");
- }
+ return displayDate(data, "datetime");
+ }
}
];
- historyTable = new YourTeam.JqDataTables.getTableByStatic(tag, data, columns, column_defs, null, null, null, null, "tpi");
+ historyTable = new YourTeam.JqDataTables.getTableByStatic(tag, data, columns, column_defs, null, null, null, null, "tpi");
}
function exportExcel() {
let url = baseApiUrl + "/History/OpeExportExcel";
objSendData.Data = $('#historyTable').dataTable().fnGetData();
-
+
$.each(objSendData.Data, function (i, v) {
- v.starttime = (pageAct.dateType == "month" ? new Date($('#getmonth').val()) : new Date($('#his_startdate').val()));
+ v.starttime = (pageAct.dateType == "month" ? new Date($('#getmonth').val()) : new Date($('#his_startdate').val()));
v.endtime = $('#his_enddate input').val() === "" ? null : new Date($('#his_enddate input').val());
v.dateType = pageAct.dateType;
});
ytAjax = new YourTeam.Ajax(url, objSendData, function (rel) {
if (rel.code == "0000")
- location.href = baseApiUrl + "/api/df?path=" + rel.data.split('/')[0] + "&fileName=" + rel.data.split('/')[1] + "&token=" + cookies.get("JWT-Authorization");
+ location.href = baseApiUrl + "/api/df?path=" + rel.data.split('/')[0] + "&fileName=" + rel.data.split('/')[1] + "&token=" + cookies.get("JWT-Authorization");
}, null, "POST").send();
}
\ No newline at end of file
diff --git a/Frontend/_operation.html b/Frontend/_operation.html
index a267a96..0e6f5e6 100644
--- a/Frontend/_operation.html
+++ b/Frontend/_operation.html
@@ -8,13 +8,22 @@
-
+
- `;
i1 = (val.history_Sub_systems != null && i1 == null) ? index : null;
- }
+ }
$.each(val.history_Sub_systems, function (index2, val2) {
i2 = (val2.device != null && i2 == null) ? index2 : null;
-
+
strHtml += `
-
-
+
${val2.full_name}
@@ -197,7 +197,7 @@
$.each(val2.device, function (index3, val3) {
strHtml += `
- - + ${val3.full_name} @@ -213,20 +213,20 @@ } } else { - if (index2 == i2 && first) { - first = false; - pageAct.deviceNumber = val3.device_number; - pageAct.deviceName = val3.full_name; - devPointsList(); - } - } + if (index2 == i2 && first) { + first = false; + pageAct.deviceNumber = val3.device_number; + pageAct.deviceName = val3.full_name; + devPointsList(); + } + } }); strHtml += `
-
+
-
-
+
+