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

View File

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

View File

@ -96,7 +96,7 @@
<div class="card">
<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>
<div class="ml-auto">k W/m<sup>2</sup></div>
<div class="ml-auto">k W/</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
@ -296,6 +296,8 @@
var powerids = new Array(0);//當前選擇電站
var Allids = new Array(0);//全部縣市
var status123 = new Array(0);//狀態
var AllidsType = true;
var StatusType = true;
//#region Array.Remove
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
@ -519,9 +521,21 @@
ids = [];
$.each(Allids, function (index, val) {
var cityid = 'cityID_' + val;
document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
ids.push(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');
ids.push(val);
}
});
if (AllidsType) {
AllidsType = false;
AllpoweridsType = false;
} else {
AllidsType = true;
}
getStation(ids);
}
//#endregion
@ -529,9 +543,18 @@
//#region 狀態全選
function AllStatus() {
status123 = [];
for (var i = 1; i <= 3; i++) {
$('#Status_' + i).prop("checked", true);
status123.push(i);
if (StatusType) {
for (var i = 1; i <= 3; i++) {
$('#Status_' + i).prop("checked", false);
}
StatusType = false;
} else {
for (var i = 1; i <= 3; i++) {
$('#Status_' + i).prop("checked", true);
status123.push(i);
}
StatusType = true;
}
getStation(ids);
}