[前端] 更新修改部分
This commit is contained in:
parent
8dbfa4938a
commit
008e10c439
@ -16,7 +16,17 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-12 col-xl-10">
|
<div class="col-sm-12 col-xl-10">
|
||||||
<div class="row bg-dark p-2 mb-5">
|
<div class="row bg-dark p-2">
|
||||||
|
<div>
|
||||||
|
<div class="py-2 col-12" id="his_building">
|
||||||
|
<div
|
||||||
|
class="item btn-group btn-group-toggle"
|
||||||
|
data-toggle="buttons"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row bg-dark p-2 mb-5 align-items-center">
|
||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" onclick="setDateType('day', this)" class="btn btn-secondary waves-effect waves-themed">日期</button>
|
<button type="button" onclick="setDateType('day', this)" class="btn btn-secondary waves-effect waves-themed">日期</button>
|
||||||
@ -70,9 +80,20 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
var historyTable = null;
|
var historyTable = null;
|
||||||
|
var buildingTag = null;
|
||||||
$(function () {
|
$(function () {
|
||||||
initList();
|
let html = "";
|
||||||
|
for (let building of pageAct.buildList) {
|
||||||
|
html += `<label class="btn btn-secondary">
|
||||||
|
<input type="radio" name="buildingRadio" id="radio_${building.building_tag}" value="${building.building_tag}" onChange="SelectBuild(this,'${building.building_tag}')"> ${building.full_name}
|
||||||
|
</label>`;
|
||||||
|
}
|
||||||
|
$("#his_building").find(".item").empty();
|
||||||
|
$("#his_building").find(".item").append(html);
|
||||||
|
if ($("#his_building .item label").first())
|
||||||
|
$("#his_building .item label").first().click()
|
||||||
|
|
||||||
|
initList();
|
||||||
// default list filter
|
// default list filter
|
||||||
initApp.listFilter($('#js_default_list'), $('#js_default_list_filter'));
|
initApp.listFilter($('#js_default_list'), $('#js_default_list_filter'));
|
||||||
// custom response message
|
// custom response message
|
||||||
@ -161,11 +182,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function initList() {
|
function initList() {
|
||||||
|
$(loadEle).Loading("start");
|
||||||
let sendData = {
|
let sendData = {
|
||||||
building_tag: pageAct.buiTag
|
building_tag: buildingTag
|
||||||
}
|
}
|
||||||
objSendData.Data = sendData;
|
objSendData.Data = sendData;
|
||||||
let url = baseApiUrl + "/api/History/GetMainSub";
|
let url = baseApiUrl + "/api/History/GetMainSub";
|
||||||
@ -232,6 +255,7 @@
|
|||||||
$('#js_nested_list').html(strHtml);
|
$('#js_nested_list').html(strHtml);
|
||||||
$(`[data-tabname="hisListItem"]`).YTTab();
|
$(`[data-tabname="hisListItem"]`).YTTab();
|
||||||
}
|
}
|
||||||
|
$(loadEle).Loading("close");
|
||||||
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
ytAjax = new YourTeam.Ajax(url, objSendData, success, null, "POST").send();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,7 +290,6 @@
|
|||||||
var edt = new Date(new Date().setDate(sdt.getDate() + 1));
|
var edt = new Date(new Date().setDate(sdt.getDate() + 1));
|
||||||
start = start ?? sdt.toLocaleDateString();
|
start = start ?? sdt.toLocaleDateString();
|
||||||
end = end ?? edt.toLocaleDateString();
|
end = end ?? edt.toLocaleDateString();
|
||||||
$(loadEle).Loading("start");
|
|
||||||
callBackFromHistory()
|
callBackFromHistory()
|
||||||
getHistoryDataByBaja(pageAct.deviceNumber + "_" + pageAct.deviceItem,
|
getHistoryDataByBaja(pageAct.deviceNumber + "_" + pageAct.deviceItem,
|
||||||
new Date(start).getTime(),
|
new Date(start).getTime(),
|
||||||
@ -277,9 +300,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function callBackFromHistory(res = '{"count":0,"data":[]}') {
|
function callBackFromHistory(res = '{"count":0,"data":[]}') {
|
||||||
// console.log("@H1",res)
|
|
||||||
res = JSON.parse(res);
|
res = JSON.parse(res);
|
||||||
// console.log("@history",res.data)
|
|
||||||
loadTable(res.data);
|
loadTable(res.data);
|
||||||
if (historyTable != null) {
|
if (historyTable != null) {
|
||||||
let t = $('#historyTable').dataTable();
|
let t = $('#historyTable').dataTable();
|
||||||
@ -288,7 +309,6 @@
|
|||||||
if (res.data.length > 0)
|
if (res.data.length > 0)
|
||||||
t.fnAddData(res.data);
|
t.fnAddData(res.data);
|
||||||
}
|
}
|
||||||
$(loadEle).Loading("close");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setValue(deviceNumber, deviceName, deviceItem, elem) {
|
function setValue(deviceNumber, deviceName, deviceItem, elem) {
|
||||||
@ -388,9 +408,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loadTable(data) {
|
function loadTable(data) {
|
||||||
|
$(loadEle).Loading("start");
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
$.each(data, function (i, v) {
|
$.each(data, function (i, v) {
|
||||||
// console.log("loadTable",pageAct.devicePoiName.split(" ")[0])
|
|
||||||
v.type = pageAct.devicePoiName.split(" ")[0];
|
v.type = pageAct.devicePoiName.split(" ")[0];
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -425,7 +446,6 @@
|
|||||||
"title": "紀錄時間",
|
"title": "紀錄時間",
|
||||||
"data": "timestamp",
|
"data": "timestamp",
|
||||||
"render": function (data) {
|
"render": function (data) {
|
||||||
// console.log(data)
|
|
||||||
return displayDate(data, "datetime");
|
return displayDate(data, "datetime");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -433,6 +453,7 @@
|
|||||||
|
|
||||||
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");
|
||||||
}
|
}
|
||||||
|
$(loadEle).Loading("close");
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportExcel() {
|
function exportExcel() {
|
||||||
@ -450,4 +471,26 @@
|
|||||||
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();
|
}, null, "POST").send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//選擇棟別
|
||||||
|
function SelectBuild(e, building_tag) {
|
||||||
|
checkIsSelectedBuilding();
|
||||||
|
}
|
||||||
|
|
||||||
|
function checkIsSelectedBuilding() {
|
||||||
|
let result = false;
|
||||||
|
let buildingRadios = $("[name=buildingRadio]:checked");
|
||||||
|
buildingTag = null;
|
||||||
|
if (buildingRadios && buildingRadios.length > 0) {
|
||||||
|
$("[name=buildingRadio]").parent().removeClass("btn-info");
|
||||||
|
$("[name=buildingRadio]").parent().addClass("btn-secondary");
|
||||||
|
$("[name=buildingRadio]:checked").parent().removeClass("btn-secondary");
|
||||||
|
$("[name=buildingRadio]:checked").parent().addClass("btn-info");
|
||||||
|
buildingTag = buildingRadios.prop("id").split("_")[1]; //building tag
|
||||||
|
initList();
|
||||||
|
result = true;
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
@ -7,21 +7,17 @@
|
|||||||
<div class="col-sm-12 col-xl-2">
|
<div class="col-sm-12 col-xl-2">
|
||||||
<div class="rounded border border-white">
|
<div class="rounded border border-white">
|
||||||
<!-- nav-menu-reset will reset the font colors -->
|
<!-- nav-menu-reset will reset the font colors -->
|
||||||
<ul
|
<ul class="nav-menu nav-menu-reset nav-menu-compact mb-sm-4 mb-md-0 rounded border border-white"
|
||||||
class="nav-menu nav-menu-reset nav-menu-compact mb-sm-4 mb-md-0 rounded border border-white"
|
data-nav-accordion="true">
|
||||||
data-nav-accordion="true"
|
|
||||||
>
|
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a name="reportTypeRadio" href="javascript:;" data-value="day">
|
<a name="reportTypeRadio" href="javascript:;" data-value="day">
|
||||||
<span class="nav-link-text"> 電錶 - 日報表 </span>
|
<span class="nav-link-text"> 電錶 - 日報表 </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a name="reportTypeRadio"
|
||||||
name="reportTypeRadio"
|
|
||||||
href="javascript:;"
|
href="javascript:;"
|
||||||
data-value="month"
|
data-value="month">
|
||||||
>
|
|
||||||
<span class="nav-link-text"> 電錶 - 月報表 </span>
|
<span class="nav-link-text"> 電錶 - 月報表 </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -31,18 +27,14 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a name="reportTypeRadio"
|
||||||
name="reportTypeRadio"
|
|
||||||
href="javascript:;"
|
href="javascript:;"
|
||||||
data-value="compare"
|
data-value="compare">
|
||||||
>
|
|
||||||
<span class="nav-link-text"> 電錶 - 同期比較 </span>
|
<span class="nav-link-text"> 電錶 - 同期比較 </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div
|
<div class="filter-message js-filter-message m-0 text-left pl-4 py-3 fw-500"></div>
|
||||||
class="filter-message js-filter-message m-0 text-left pl-4 py-3 fw-500"
|
|
||||||
></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-xl-10">
|
<div class="col-12 col-xl-10">
|
||||||
@ -51,106 +43,72 @@
|
|||||||
<div class="col-auto">
|
<div class="col-auto">
|
||||||
<span class="report-type-name"></span>費每度單價
|
<span class="report-type-name"></span>費每度單價
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input type="text"
|
||||||
type="text"
|
|
||||||
id="elecPriceDegree"
|
id="elecPriceDegree"
|
||||||
class="form-control col-1"
|
class="form-control col-1" />
|
||||||
/>
|
<div id="compareTypeBtnsDiv"
|
||||||
<div
|
|
||||||
id="compareTypeBtnsDiv"
|
|
||||||
class="item btn-group btn-group-toggle offset-1"
|
class="item btn-group btn-group-toggle offset-1"
|
||||||
data-toggle="buttons"
|
data-toggle="buttons"
|
||||||
style="display: none"
|
style="display: none">
|
||||||
>
|
<label class="btn btn-outline-success waves-effect active waves-themed">
|
||||||
<label
|
<input type="radio"
|
||||||
class="btn btn-outline-success waves-effect active waves-themed"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="compareTypeRadio"
|
name="compareTypeRadio"
|
||||||
id="compareMonth"
|
id="compareMonth"
|
||||||
value="month"
|
value="month"
|
||||||
checked
|
checked />
|
||||||
/>
|
|
||||||
年度同月比較
|
年度同月比較
|
||||||
</label>
|
</label>
|
||||||
<label
|
<label class="btn btn-outline-success waves-effect waves-themed">
|
||||||
class="btn btn-outline-success waves-effect waves-themed"
|
<input type="radio"
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="radio"
|
|
||||||
name="compareTypeRadio"
|
name="compareTypeRadio"
|
||||||
id="compareDay"
|
id="compareDay"
|
||||||
value="day"
|
value="day" />
|
||||||
/>
|
|
||||||
月份同日比較
|
月份同日比較
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-auto offset-1">
|
<div class="col-auto offset-1">
|
||||||
選擇<span id="elecTimeText">單一月份</span>
|
選擇<span id="elecTimeText">單一月份</span>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input type="text"
|
||||||
type="text"
|
|
||||||
id="elecMonthDate"
|
id="elecMonthDate"
|
||||||
class="form-control col-2"
|
class="form-control col-2" />
|
||||||
/>
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="elecYearDate"
|
id="elecYearDate"
|
||||||
class="form-control col-2"
|
class="form-control col-2"
|
||||||
style="display: none"
|
style="display: none" />
|
||||||
/>
|
<div id="elecStartEndDiv"
|
||||||
<div
|
|
||||||
id="elecStartEndDiv"
|
|
||||||
class="row m-0 align-items-center"
|
class="row m-0 align-items-center"
|
||||||
style="display: none"
|
style="display: none">
|
||||||
>
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="elecSYearDate"
|
id="elecSYearDate"
|
||||||
class="form-control col-4"
|
class="form-control col-4" />
|
||||||
/>
|
|
||||||
<span class="px-2">~</span>
|
<span class="px-2">~</span>
|
||||||
<input
|
<input type="text"
|
||||||
type="text"
|
|
||||||
id="elecEYearDate"
|
id="elecEYearDate"
|
||||||
class="form-control col-4"
|
class="form-control col-4" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div id="elecCompareDiv"
|
||||||
id="elecCompareDiv"
|
|
||||||
class="row m-0 align-items-center"
|
class="row m-0 align-items-center"
|
||||||
style="display: none"
|
style="display: none">
|
||||||
>
|
|
||||||
<div id="elecComYearDiv" class="row m-0 align-items-center">
|
<div id="elecComYearDiv" class="row m-0 align-items-center">
|
||||||
<input
|
<input type="text"
|
||||||
type="text"
|
|
||||||
id="elecCom1YearDate"
|
id="elecCom1YearDate"
|
||||||
class="form-control col-4"
|
class="form-control col-4" />
|
||||||
/>
|
|
||||||
<span class="px-2">、</span>
|
<span class="px-2">、</span>
|
||||||
<input
|
<input type="text"
|
||||||
type="text"
|
|
||||||
id="elecCom2YearDate"
|
id="elecCom2YearDate"
|
||||||
class="form-control col-4"
|
class="form-control col-4" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div id="elecComMonthDiv"
|
||||||
id="elecComMonthDiv"
|
|
||||||
class="row m-0 align-items-center"
|
class="row m-0 align-items-center"
|
||||||
style="display: none"
|
style="display: none">
|
||||||
>
|
<input type="text"
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
id="elecCom1MonthDate"
|
id="elecCom1MonthDate"
|
||||||
class="form-control col-4"
|
class="form-control col-4" />
|
||||||
/>
|
|
||||||
<span class="px-2">、</span>
|
<span class="px-2">、</span>
|
||||||
<input
|
<input type="text"
|
||||||
type="text"
|
|
||||||
id="elecCom2MonthDate"
|
id="elecCom2MonthDate"
|
||||||
class="form-control col-4"
|
class="form-control col-4" />
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</h2>
|
</h2>
|
||||||
@ -158,14 +116,12 @@
|
|||||||
<div class="panel-hdr" style="min-height: auto">
|
<div class="panel-hdr" style="min-height: auto">
|
||||||
<h2 class="py-2 col-12" id="building">
|
<h2 class="py-2 col-12" id="building">
|
||||||
<div class="col-1">棟別</div>
|
<div class="col-1">棟別</div>
|
||||||
<div
|
<div class="item btn-group btn-group-toggle"
|
||||||
class="item btn-group btn-group-toggle"
|
data-toggle="buttons"></div>
|
||||||
data-toggle="buttons"
|
|
||||||
></div>
|
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-hdr" style="min-height: auto">
|
<div class="panel-hdr" style="min-height: auto">
|
||||||
<h2 class="py-2 col-12" id="floors">
|
<!-- <h2 class="py-2 col-12" id="floors">
|
||||||
<div class="col-1">樓層</div>
|
<div class="col-1">樓層</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -188,33 +144,25 @@
|
|||||||
<span class="text-notice notice-noBuilding" style="display: none"
|
<span class="text-notice notice-noBuilding" style="display: none"
|
||||||
>該棟別沒有樓層</span
|
>該棟別沒有樓層</span
|
||||||
>
|
>
|
||||||
</h2>
|
</h2> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex my-2">
|
<div class="d-flex my-2">
|
||||||
<button
|
<button type="button"
|
||||||
type="button"
|
|
||||||
class="btn btn-primary"
|
class="btn btn-primary"
|
||||||
onclick="getMeterData()"
|
onclick="getMeterData()">
|
||||||
>
|
|
||||||
查詢
|
查詢
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button type="button"
|
||||||
type="button"
|
|
||||||
class="btn btn-danger ml-2"
|
class="btn btn-danger ml-2"
|
||||||
onclick="setExportList()"
|
onclick="setExportList()">
|
||||||
>
|
|
||||||
匯出
|
匯出
|
||||||
</button>
|
</button>
|
||||||
<div
|
<div id="tableLoading"
|
||||||
id="tableLoading"
|
|
||||||
class="row m-0 align-items-center"
|
class="row m-0 align-items-center"
|
||||||
style="display: none"
|
style="display: none">
|
||||||
>
|
<div class="spinner-border text-info mx-2"
|
||||||
<div
|
|
||||||
class="spinner-border text-info mx-2"
|
|
||||||
role="status"
|
role="status"
|
||||||
style="width: 1.2rem; height: 1.2rem"
|
style="width: 1.2rem; height: 1.2rem">
|
||||||
>
|
|
||||||
<span class="sr-only">Loading...</span>
|
<span class="sr-only">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
<span id="tableLoadingText">列表讀取中</span>
|
<span id="tableLoadingText">列表讀取中</span>
|
||||||
@ -224,10 +172,8 @@
|
|||||||
<button type="button" class="btn btn-info allbtn ml-2" onclick="LookRealTime()">查看即時資訊</button> -->
|
<button type="button" class="btn btn-info allbtn ml-2" onclick="LookRealTime()">查看即時資訊</button> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table
|
<table id="report_table"
|
||||||
id="report_table"
|
class="table table-bordered table-striped text-center m-0"></table>
|
||||||
class="table table-bordered table-striped text-center m-0"
|
|
||||||
></table>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -970,7 +916,7 @@
|
|||||||
//選擇棟別
|
//選擇棟別
|
||||||
function SelectBuild(e, building_tag) {
|
function SelectBuild(e, building_tag) {
|
||||||
checkIsSelectedBuilding();
|
checkIsSelectedBuilding();
|
||||||
GetFloors(building_tag);
|
// GetFloors(building_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
//取得樓層
|
//取得樓層
|
||||||
|
Loading…
Reference in New Issue
Block a user