From 5fa15dbec10527ae779053c2bf500027ee3bb6e6 Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Mon, 1 Aug 2022 14:53:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9B=BB=E7=AB=99=E7=B8=BD=E6=94=AC-=E9=81=8E?= =?UTF-8?q?=E6=BF=BE=E6=A2=9D=E4=BB=B6=E9=81=B8=E6=93=87=E5=BE=8C=EF=BC=8C?= =?UTF-8?q?=E6=B8=85=E7=A9=BA=E4=B8=8B=E6=96=B9=E7=95=AB=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Views/StationOverview/Index.cshtml | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/SolarPower/Views/StationOverview/Index.cshtml b/SolarPower/Views/StationOverview/Index.cshtml index da41265..2925935 100644 --- a/SolarPower/Views/StationOverview/Index.cshtml +++ b/SolarPower/Views/StationOverview/Index.cshtml @@ -366,6 +366,22 @@ getStation(ids); }) + function emptyCardAndTable() { + $('#areaCard').empty(); + $('#solarTable').find('tbody').empty(); + $("#today_kwh").html(0); + $("#total_kwh").html(0); + $("#today_irradiance").html(0); + $("#avg_irradiance").html(0); + $("#today_PR").html(0); + $("#avg_PR").html(0); + $("#today_kwhkwp").html(0); + $("#avg_kwhkwp").html(0); + $("#today_carbon").html(0); + $("#total_carbon").html(0); + $("#update_at").html(0); + } + function getStation(ids) { @*var kwh = $('#kwh_order').val(); var pr = $('#pr_order').val(); @@ -387,26 +403,13 @@ prOrderBy: $('#pr_order').val() } + emptyCardAndTable(); + @*ids.sort(function (a, b) { return a - b; }); ids.sort();*@ - if (ids.length == 0 || selectedStatus.length == 0) { - $('#areaCard').empty(); - $('#solarTable').find('tbody').empty(); - $("#today_kwh").html(0); - $("#total_kwh").html(0); - $("#today_irradiance").html(0); - $("#avg_irradiance").html(0); - $("#today_PR").html(0); - $("#avg_PR").html(0); - $("#today_kwhkwp").html(0); - $("#avg_kwhkwp").html(0); - $("#today_carbon").html(0); - $("#total_carbon").html(0); - $("#update_at").html(0); - } - else { + if (ids.length != 0 && selectedStatus.length != 0) { showLoading(); var Nurl = "/StationOverview/GetPowerStationByFilter"; $.post(Nurl, send_data, function (rel) {