From 3080ba8ededbaecd133e09b9e23120d8cf16cdc2 Mon Sep 17 00:00:00 2001 From: b110212000 Date: Tue, 20 Jul 2021 10:11:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StationOverviewController.cs | 5 +++- .../AnalysisStationCombineRepository.cs | 2 +- .../StationOverviewInfo.cshtml | 26 +++++++++---------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/SolarPower/Controllers/StationOverviewController.cs b/SolarPower/Controllers/StationOverviewController.cs index a7d698b..4d5230d 100644 --- a/SolarPower/Controllers/StationOverviewController.cs +++ b/SolarPower/Controllers/StationOverviewController.cs @@ -360,7 +360,10 @@ namespace SolarPower.Controllers { if (string.IsNullOrEmpty(a.FormId)) { - a.Function = @$"填寫表單"; + if(a.Err_status == 1) + { + a.Function = @$"填寫表單"; + } } else { diff --git a/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs b/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs index e470141..6ff9f1a 100644 --- a/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs +++ b/SolarPower/Repository/Implement/AnalysisStationCombineRepository.cs @@ -27,7 +27,7 @@ namespace SolarPower.Repository.Implement { try { - string sql = @"SELECT "; + string sql = @"SELECT AVG(KWHKWP),TOTALMONEY,TOTALKWH,TOTALCARBON,PR"; a = await conn.QueryFirstOrDefaultAsync(sql); diff --git a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml index 12ee429..701c892 100644 --- a/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml +++ b/SolarPower/Views/StationOverview/StationOverviewInfo.cshtml @@ -2171,11 +2171,11 @@ if (val.length != 0) { $('#HistoryDetailTable').append('' + '' + val.timestamp + '' + - '' + val.kwh + '' + - '' + val.diffSOLARHOUR + '' + - '' + val.irradiance + '' + - '' + val.pr + '' + - '' + val.temp + '' + + '' + val.kwh.toFixed(2) + '' + + '' + val.diffSOLARHOUR.toFixed(2) + '' + + '' + val.irradiance.toFixed(2) + '' + + '' + val.pr.toFixed(2) + '' + + '' + val.temp.toFixed(2) + '' + ''); listmonth.push(val.timestamp); listkwh.push(val.kwh); @@ -2197,15 +2197,15 @@ datasets: [{ type: 'line', label: '日照度(kWh/㎡)', - borderColor: listcolor, + borderColor: 'rgba(190, 45, 45,1)', pointRadius: 4, yAxisID: 'B', fill: false, data: listirradiance }, { type: 'bar', - borderColor: listcolor2, - backgroundColor: listcolor2, + borderColor: 'rgba(103, 180, 172, 1)', + backgroundColor: 'rgba(103, 180, 172, 0.2)', borderWidth: 1, label: '發電量(kWh)', yAxisID: 'A', @@ -2259,11 +2259,11 @@ { $('#HistoryTotalTable').append('' + '' + TimestampALL + '' + - '' + kwhALL + '' + - '' + diffSOLARHOURALL + '' + - '' + irradianceALL + '' + - '' + prALL + '' + - '' + tempALL + '' + + '' + kwhALL.toFixed(2) + '' + + '' + diffSOLARHOURALL.toFixed(2) + '' + + '' + irradianceALL.toFixed(2) + '' + + '' + prALL.toFixed(2) + '' + + '' + tempALL.toFixed(2) + '' + ''); } })