This commit is contained in:
b110212000 2021-08-31 10:15:12 +08:00
parent 19ef696ee1
commit 06d7772dfd
3 changed files with 59 additions and 10 deletions

View File

@ -229,6 +229,8 @@
var record; var record;
var psids; var psids;
var countOperationRecordFile = 0; var countOperationRecordFile = 0;
var AllpoweridsType = true;
var AllidsType = true;
//#region Array.Remove //#region Array.Remove
Array.prototype.remove = function (val) { Array.prototype.remove = function (val) {
@ -338,9 +340,23 @@
ids = []; ids = [];
$.each(Allids, function (index, val) { $.each(Allids, function (index, val) {
var cityid = 'cityID_' + val; var cityid = 'cityID_' + val;
document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
if (AllidsType) {
document.getElementById(cityid).setAttribute("class", 'btn btn-outline-success waves-effect waves-themed ml-2');
ids = [];
powerids = [];
}
else {
document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2'); document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
ids.push(val); ids.push(val);
}
}); });
if (AllidsType) {
AllidsType = false;
AllpoweridsType = false;
} else {
AllidsType = true;
}
var send_data = { var send_data = {
cityid: ids cityid: ids
} }
@ -391,10 +407,21 @@
//#region 電站全選 //#region 電站全選
function Allpowerstation() { function Allpowerstation() {
if (AllpoweridsType) {
AllpoweridsType = false;
} else {
AllpoweridsType = true;
}
powerids = []; powerids = [];
$.each(Allpowerids, function (index, val) { $.each(Allpowerids, function (index, val) {
if (AllpoweridsType) {
$('#check_' + val).prop("checked", true); $('#check_' + val).prop("checked", true);
powerids.push(val); powerids.push(val);
} else {
$('#check_' + val).prop("checked", false);
powerids = [];
}
}) })
ExceptionTable.ajax.reload(); ExceptionTable.ajax.reload();
} }

View File

@ -592,7 +592,6 @@
else { else {
document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2'); document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
ids.push(val); ids.push(val);
} }
}); });
if (AllidsType) { if (AllidsType) {

View File

@ -96,7 +96,7 @@
<div class="card"> <div class="card">
<div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap"> <div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap">
<h4 class="mb-0 font-weight-bold"><span class="fal fa-sun mr-1"></span> 日照度</h4> <h4 class="mb-0 font-weight-bold"><span class="fal fa-sun mr-1"></span> 日照度</h4>
<div class="ml-auto">k W/m<sup>2</sup></div> <div class="ml-auto">k W/</div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="d-flex justify-content-between"> <div class="d-flex justify-content-between">
@ -296,6 +296,8 @@
var powerids = new Array(0);//當前選擇電站 var powerids = new Array(0);//當前選擇電站
var Allids = new Array(0);//全部縣市 var Allids = new Array(0);//全部縣市
var status123 = new Array(0);//狀態 var status123 = new Array(0);//狀態
var AllidsType = true;
var StatusType = true;
//#region Array.Remove //#region Array.Remove
Array.prototype.remove = function (val) { Array.prototype.remove = function (val) {
var index = this.indexOf(val); var index = this.indexOf(val);
@ -519,9 +521,21 @@
ids = []; ids = [];
$.each(Allids, function (index, val) { $.each(Allids, function (index, val) {
var cityid = 'cityID_' + val; var cityid = 'cityID_' + val;
if (AllidsType) {
document.getElementById(cityid).setAttribute("class", 'btn btn-outline-success waves-effect waves-themed ml-2');
ids = [];
}
else {
document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2'); document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
ids.push(val); ids.push(val);
}
}); });
if (AllidsType) {
AllidsType = false;
AllpoweridsType = false;
} else {
AllidsType = true;
}
getStation(ids); getStation(ids);
} }
//#endregion //#endregion
@ -529,10 +543,19 @@
//#region 狀態全選 //#region 狀態全選
function AllStatus() { function AllStatus() {
status123 = []; status123 = [];
if (StatusType) {
for (var i = 1; i <= 3; i++) {
$('#Status_' + i).prop("checked", false);
}
StatusType = false;
} else {
for (var i = 1; i <= 3; i++) { for (var i = 1; i <= 3; i++) {
$('#Status_' + i).prop("checked", true); $('#Status_' + i).prop("checked", true);
status123.push(i); status123.push(i);
} }
StatusType = true;
}
getStation(ids); getStation(ids);
} }
//#endregion //#endregion