diff --git a/SolarPower/Views/ExceptionRecord/Index.cshtml b/SolarPower/Views/ExceptionRecord/Index.cshtml index 364f4bb..ff79f8a 100644 --- a/SolarPower/Views/ExceptionRecord/Index.cshtml +++ b/SolarPower/Views/ExceptionRecord/Index.cshtml @@ -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(); } diff --git a/SolarPower/Views/Operation/OperationRecord.cshtml b/SolarPower/Views/Operation/OperationRecord.cshtml index f26b074..9b9a05b 100644 --- a/SolarPower/Views/Operation/OperationRecord.cshtml +++ b/SolarPower/Views/Operation/OperationRecord.cshtml @@ -592,7 +592,6 @@ else { document.getElementById(cityid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2'); ids.push(val); - } }); if (AllidsType) { diff --git a/SolarPower/Views/StationOverview/Index.cshtml b/SolarPower/Views/StationOverview/Index.cshtml index 3961919..6f82410 100644 --- a/SolarPower/Views/StationOverview/Index.cshtml +++ b/SolarPower/Views/StationOverview/Index.cshtml @@ -96,7 +96,7 @@