1. bug fix

This commit is contained in:
Kai 2021-09-02 16:05:12 +08:00
parent ad87214345
commit 2f76d6d180
4 changed files with 119 additions and 147 deletions

View File

@ -4,7 +4,7 @@
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://localhost:57957/", "applicationUrl": "http://localhost:57957/",
"sslPort": 44361 "sslPort": 0
} }
}, },
"profiles": { "profiles": {

View File

@ -232,15 +232,6 @@
var AllpoweridsType = true; var AllpoweridsType = true;
var AllidsType = true; var AllidsType = true;
//#region Array.Remove
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
//#endregion
$(function () { $(function () {
//#region Date-Picker //#region Date-Picker

View File

@ -213,7 +213,7 @@
{ {
<li class="@(ViewData["MainNum"].ToString() == "2" && <li class="@(ViewData["MainNum"].ToString() == "2" &&
ViewData["SubNum"].ToString() == ViewBag.myPowerStationGroupByCities.IndexOf(MyPowerStationGroupByCity).ToString() && ViewData["SubNum"].ToString() == ViewBag.myPowerStationGroupByCities.IndexOf(MyPowerStationGroupByCity).ToString() &&
ViewData["TagNum"].ToString() == MyPowerStationGroupByCity.MyPowerStations.IndexOf(myPowerStation).ToString() ? "active" : "")" id="li-List-@myPowerStation.PowerStationId"> ViewData["TagNum"].ToString() == MyPowerStationGroupByCity.MyPowerStations.IndexOf(myPowerStation).ToString() ? "active" : "")" id="li-List-@myPowerStation.Id">
<a asp-controller="StationOverview" asp-action="Info" asp-route-stationId="@myPowerStation.Id" title="Sublevel Item" data-filter-tags="utilities menu child sublevel item"> <a asp-controller="StationOverview" asp-action="Info" asp-route-stationId="@myPowerStation.Id" title="Sublevel Item" data-filter-tags="utilities menu child sublevel item">
<span class="nav-link-text" data-i18n="nav.utilities_menu_child_sublevel_item">@myPowerStation.Name</span> <span class="nav-link-text" data-i18n="nav.utilities_menu_child_sublevel_item">@myPowerStation.Name</span>
</a> </a>

View File

@ -14,7 +14,7 @@
<div class="row"> <div class="row">
<div class="col-xl-12"> <div class="col-xl-12">
<div id="panel-5" class="panel"> <div id="panel-5" class="panel">
<div class="panel-container show"> <div class="panel-container">
<div class="panel-content"> <div class="panel-content">
<div class="subheader"> <div class="subheader">
<h1 class="subheader-title"> 電站分佈區域 </h1> <h1 class="subheader-title"> 電站分佈區域 </h1>
@ -24,12 +24,7 @@
<button type="button" class="btn btn-secondary waves-effect waves-themed" onclick="Allcity()">全選</button> <button type="button" class="btn btn-secondary waves-effect waves-themed" onclick="Allcity()">全選</button>
</div> </div>
<div class="pr-3"> <div class="pr-3">
<div class="frame-wrap" id="citytest"> <div class="frame-wrap" id="citytest"></div>
<button type="button" class="btn btn-outline-success waves-effect waves-themed">
新北市
<span class="badge bg-success-700 ml-2" id="acount">4</span>
</button>
</div>
</div> </div>
</div> </div>
<div class="row mb-3 d-flex align-items-top px-3"> <div class="row mb-3 d-flex align-items-top px-3">
@ -74,91 +69,91 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row mb-5 d-flex px-3"> <div class="row mb-5 px-3">
<div class="card-columns">
<div class="card"> <div class="col card px-0 mx-1">
<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-bolt mr-1"></span> 發電量</h4> <h4 class="mb-0 font-weight-bold"><span class="fal fa-bolt mr-1"></span> 發電量</h4>
<div class="ml-auto">kW h</div> <div class="ml-auto">kW h</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>今日發電量</p>
<p><span class="color-info-700" id="today_kwh">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>累積發電量</p>
<p><span class="color-info-700" id="total_kwh">0.00</span></p>
</div>
</div>
</div> </div>
<div class="card irradiance-card"> <div class="card-body">
<div class="card-header bg-fusion-25 py-2 pr-3 d-flex align-items-center flex-wrap"> <div class="d-flex justify-content-between">
<h4 class="mb-0 font-weight-bold"><span class="fal fa-sun mr-1"></span> 日照度</h4> <p>今日發電量</p>
<div class="ml-auto">k W/㎡</div> <p><span class="color-info-700" id="today_kwh">0.00</span></p>
</div> </div>
<div class="card-body"> <div class="d-flex justify-content-between">
<div class="d-flex justify-content-between"> <p>累積發電量</p>
<p>即時平均日照度</p> <p><span class="color-info-700" id="total_kwh">0.00</span></p>
<p><span class="color-info-700" id="today_irradiance">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>平均日照度(30天)</p>
<p><span class="color-info-700" id="avg_irradiance">0.00</span></p>
</div>
</div>
</div>
<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-bolt mr-1"></span> PR值</h4>
<div class="ml-auto">%</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>即時平均 PR 值</p>
<p><span class="color-info-700" id="today_PR">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>平均 PR 值(30天)</p>
<p><span class="color-info-700" id="avg_PR">0.00</span></p>
</div>
</div>
</div>
<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">hr</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>即時平均有效日照時數</p>
<p><span class="color-info-700" id="today_kwhkwp">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>平均有效日照時數(30天)</p>
<p><span class="color-info-700" id="avg_kwhkwp">0.00</span></p>
</div>
</div>
</div>
<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-bolt mr-1"></span> 減碳量</h4>
<div class="ml-auto">kG</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>今日減碳量</p>
<p><span class="color-info-700" id="today_carbon">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>累積減碳量</p>
<p><span class="color-info-700" id="total_carbon">0.00</span></p>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col card px-0 mx-1">
<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/㎡</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>即時平均日照度</p>
<p><span class="color-info-700" id="today_irradiance">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>平均日照度(30天)</p>
<p><span class="color-info-700" id="avg_irradiance">0.00</span></p>
</div>
</div>
</div>
<div class="col card px-0 mx-1">
<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-bolt mr-1"></span> PR值</h4>
<div class="ml-auto">%</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>即時平均 PR 值</p>
<p><span class="color-info-700" id="today_PR">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>平均 PR 值(30天)</p>
<p><span class="color-info-700" id="avg_PR">0.00</span></p>
</div>
</div>
</div>
<div class="col card px-0 mx-1">
<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">hr</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>即時平均有效日照時數</p>
<p><span class="color-info-700" id="today_kwhkwp">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>平均有效日照時數(30天)</p>
<p><span class="color-info-700" id="avg_kwhkwp">0.00</span></p>
</div>
</div>
</div>
<div class="col card px-0 mx-1">
<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-bolt mr-1"></span> 減碳量</h4>
<div class="ml-auto">kG</div>
</div>
<div class="card-body">
<div class="d-flex justify-content-between">
<p>今日減碳量</p>
<p><span class="color-info-700" id="today_carbon">0.00</span></p>
</div>
<div class="d-flex justify-content-between">
<p>累積減碳量</p>
<p><span class="color-info-700" id="total_carbon">0.00</span></p>
</div>
</div>
</div>
</div> </div>
<div class="tab-content p-3"> <div class="p-3">
<div class="row mb-5 d-flex justify-content-between"> <div class="row mb-5 d-flex justify-content-between">
<div class="col-12 text-right"> <div class="col-12 text-right">
<a href="javascript:TableDisplay();" class="btn btn-secondary btn-icon waves-effect waves-themed mr-1" style="width: 47px;"><span class="fal fa-list fa-2x mt-2"></span></a> <a href="javascript:TableDisplay();" class="btn btn-secondary btn-icon waves-effect waves-themed mr-1" style="width: 47px;"><span class="fal fa-list fa-2x mt-2"></span></a>
@ -175,27 +170,40 @@
<h4 id="solarName" class="font-weight-bold" style="line-height: 27px;"> <h4 id="solarName" class="font-weight-bold" style="line-height: 27px;">
新竹巨城站 新竹巨城站
</h4> </h4>
<p class="card-text"><i class="fal fa-cloud-sun-rain fa-2x" id="weathericon"></i></p> <div class="d-flex">
<p id="Temp" class="mr-2">27°C</p><i class="fal fa-cloud-sun-rain fa-2x" id="weathericon"></i>
</div>
</div> </div>
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
<li class="list-group-item px-2"> <li class="list-group-item px-2">
<div class=" d-flex justify-content-between"> <div class=" d-flex justify-content-between">
<p>發電量</p> <div class="d-flex justify-content-between" style="width:60%">
<p><span class="color-primary-400" id="Capacity">185</span> kWh</p> <p>發電量</p>
<p id="Temp">27°C</p> <p><span class="color-primary-400" id="today_kwh">0.00</span> kWh</p>
</div> </div>
<div class=" d-flex justify-content-between">
@if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney"))
{ {
<p>發電金額</p> <div class="d-flex justify-content-end" style="width:40%">
<p><span class="color-primary-400" id="PowerRate">2,5840</span> NT</p> @*<p>發電金額</p>*@
<p><span class="color-primary-400" id="PowerRate">2,5840</span> NT</p>
</div>
} }
<p><span class="color-primary-400" id="stationtype">65</span></p>
</div> </div>
<div class=" d-flex justify-content-between"> <div class=" d-flex justify-content-between">
<p>PR值</p> <div class="d-flex justify-content-between" style="width:60%">
<p><span class="color-primary-400" id="PR">65</span> %</p> <p>裝置容量</p>
<div style="text-align:right"> <p><span class="color-primary-400" id="Capacity">0.00</span> kWp</p>
</div>
<div class="d-flex justify-content-end" style="width:40%">
<p><span class="color-primary-400" id="stationtype">65</span></p>
</div>
</div>
<div class=" d-flex justify-content-between">
<div class="d-flex justify-content-between" style="width:60%">
<p>PR值</p>
<p><span class="color-primary-400" id="PR">65</span> %</p>
</div>
<div class="d-flex justify-content-end" style="width:40%">
<p class="small" id="date">06-30 17:50</p> <p class="small" id="date">06-30 17:50</p>
</div> </div>
</div> </div>
@ -289,21 +297,12 @@
@section Scripts{ @section Scripts{
<script> <script>
var localurl = this.location.href; var localurl = this.location.href;
var tablocation = "";
var ids = new Array(0);//當前選擇縣市 var ids = new Array(0);//當前選擇縣市
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 AllidsType = true;
var StatusType = true; var StatusType = true;
//#region Array.Remove
Array.prototype.remove = function (val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
};
//#endregion
$(function () { $(function () {
status123 = []; status123 = [];
@ -327,30 +326,6 @@
getStation(ids); getStation(ids);
}, 'json'); }, 'json');
@*var Nurl = "/PowerStation/GetSolarCitySummary";
$.post(Nurl, function (rel) {
if (rel.code != "0000") {
toast_error(rel.msg);
return;
}
$('#citytest').empty();
for (var i = 0; i < rel.data.length; i++) {
$('#citytest').append("<button type='button' class='btn btn-success waves-effect waves-themed ml-2' id='" + 'cityID_' + rel.data[i].cityId + "'>" +
rel.data[i].city +
"<span class= 'badge bg-success-700 ml-2' >" + rel.data[i].amount + "</span >" +
"</button >");
ids.push(rel.data[i].cityId);
Allids.push(rel.data[i].cityId);
}
status123.push(1);
status123.push(2);
status123.push(3);
getStation(ids);
}, 'json');*@
}); });
@ -360,12 +335,17 @@
var value = document.getElementById(clickid).className; var value = document.getElementById(clickid).className;
if (value == 'btn btn-outline-success waves-effect waves-themed ml-2') { //選擇 if (value == 'btn btn-outline-success waves-effect waves-themed ml-2') { //選擇
document.getElementById(clickid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2'); document.getElementById(clickid).setAttribute("class", 'btn btn-success waves-effect waves-themed ml-2');
ids.push(Number(classid[1])); if ($.inArray(parseInt(classid[1]), ids) < 0) {
ids.push(parseInt(classid[1]));
}
} }
else { //取消 else { //取消
document.getElementById(clickid).setAttribute("class", 'btn btn-outline-success waves-effect waves-themed ml-2'); document.getElementById(clickid).setAttribute("class", 'btn btn-outline-success waves-effect waves-themed ml-2');
ids.remove(Number(classid[1])); if ($.inArray(parseInt(classid[1]), ids) > -1) {
ids.splice($.inArray(parseInt(classid[1]), ids), 1);
}
} }
getStation(ids); getStation(ids);
}) })
@ -431,7 +411,7 @@
statusicon = 'NULL'; break; statusicon = 'NULL'; break;
} }
$('#card_' + val.id).find('#solarName').html(statusicon + val.name); $('#card_' + val.id).find('#solarName').html(statusicon + val.name);
$('#card_' + val.id).find('#weathericon')[0].setAttribute("class", 'fal fa-' + val.todayWeather + ' fa-2x'); @*$('#card_' + val.id).find('#weathericon')[0].setAttribute("class", 'fal fa-' + val.todayWeather + ' fa-2x');*@
$('#card_' + val.id).find('#Temp').html((val.todayWeatherTemp == -99)? "": val.todayWeatherTemp + '°C'); $('#card_' + val.id).find('#Temp').html((val.todayWeatherTemp == -99)? "": val.todayWeatherTemp + '°C');
var type = ""; var type = "";
switch (val.solarType) { switch (val.solarType) {
@ -447,7 +427,8 @@
var time = new Date(val.createdAt); var time = new Date(val.createdAt);
$('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id); $('#card_' + val.id).find('#editSolarUrl').attr('href', localurl + '/Info?stationId=' + val.id);
$('#card_' + val.id).find('#date').html(time.getMonth() + "/" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes()); $('#card_' + val.id).find('#date').html(time.getMonth() + "/" + time.getDate() + " " + time.getHours() + ":" + time.getMinutes());
$('#card_' + val.id).find('#Capacity').html(val.today_kWh.toFixed(2)); $('#card_' + val.id).find('#today_kwh').html(val.today_kWh.toFixed(2));
$('#card_' + val.id).find('#Capacity').html(val.generatingCapacity.toFixed(2));
@if (ViewBag.myUser.Role.Auths.Contains("ShowMoney")) @if (ViewBag.myUser.Role.Auths.Contains("ShowMoney"))
{ {
<text> <text>
@ -475,7 +456,7 @@
$('#solarTable').find('tbody').append('<tr>' + $('#solarTable').find('tbody').append('<tr>' +
'<td>' + val.code + '</td>' + '<td>' + val.code + '</td>' +
'<td>' + val.name + '</td>' + '<td>' + val.name + '</td>' +
'<td>' + val.generatingCapacity + '</td>' + '<td>' + val.generatingCapacity.toFixed(2) + '</td>' +
'<td>' + val.total_kWh.toFixed(2) + '</td>' + '<td>' + val.total_kWh.toFixed(2) + '</td>' +
'<td>' + val.today_kWh.toFixed(2) + '</td>' + '<td>' + val.today_kWh.toFixed(2) + '</td>' +
'<td>' + val.solarHour.toFixed(2) + '</td>' + '<td>' + val.solarHour.toFixed(2) + '</td>' +