From 44e94c8b679136c3c5d23ffb2112f658b5265d6c Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Mon, 22 Aug 2022 17:20:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=BB=E7=AB=99=E8=B3=87=E8=A8=8A-=E7=95=B0?= =?UTF-8?q?=E5=B8=B8=E7=B4=80=E9=8C=84:=20=E9=A1=AF=E7=A4=BAloading?= =?UTF-8?q?=E5=9C=96=E7=A4=BA=E3=80=81=E5=85=A8=E9=83=A8=E8=B3=87=E8=A8=8A?= =?UTF-8?q?=E5=8A=A0=E8=BC=89=E5=AE=8C=EF=BC=8C=E6=89=8D=E7=B5=90=E6=9D=9F?= =?UTF-8?q?=E5=A4=A7=E5=9C=88=E5=9C=88(loading)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Implement/OverviewRepository.cs | 2 +- .../StationOverviewInfo.cshtml | 51 +++++++++++++++++-- .../Views/StationOverview/_Exception.cshtml | 2 +- 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/SolarPower/Repository/Implement/OverviewRepository.cs b/SolarPower/Repository/Implement/OverviewRepository.cs index 5c76a83..6687a49 100644 --- a/SolarPower/Repository/Implement/OverviewRepository.cs +++ b/SolarPower/Repository/Implement/OverviewRepository.cs @@ -418,7 +418,7 @@ namespace SolarPower.Repository.Implement { PowerStationId = post.Id, Status = post.Status, - })).ToList(); + }, commandTimeout: 600)).ToList(); } catch (Exception exception) { diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index 7539c01..6f37cc1 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -175,6 +175,13 @@ var selectInverterkwhBarType = 0; var HeapMapXAxis = []; var countOperationRecordFile = 0; + var isloadingdone_uptodate = false; + var isloadingdone_info = false; + var isloadingdone_inverterinfo = false; + var isloadingdone_inverter = false; + var isloadingdone_history = false; + var isloadingdone_exception = false; + var isloadingdone_operation = false; function showLoading() { var i = document.getElementById("loading"); @@ -183,7 +190,10 @@ function hideLoading() { var i = document.getElementById("loading"); - i.style.display = "none"; + if (isloadingdone_uptodate && isloadingdone_info && isloadingdone_inverterinfo && isloadingdone_inverter && isloadingdone_history && isloadingdone_exception && isloadingdone_operation) + { + i.style.display = "none"; + } } $(function () { @@ -262,6 +272,7 @@ }; $.post(url, send_data, function (rel) { if (rel.code != "0000") { + isloadingdone_uptodate = true; hideLoading(); toast_error(rel.msg); return; @@ -320,6 +331,7 @@ $("#money-card-subtitle-total").html("總計"); $("#money-card-subtitle-avg").html("今日"); } + isloadingdone_uptodate = true; hideLoading(); }, 'json'); @@ -757,6 +769,7 @@ } $.post(url, send_data, function (rel) { if (rel.code != "0000") { + isloadingdone_info = true; hideLoading(); toast_error(rel.msg); return; @@ -781,6 +794,7 @@ $("#power_station_select_modal").append($("