From 71a0be260fefbcd18a988d978b128e54e2f26fbb Mon Sep 17 00:00:00 2001 From: "wanling040@gmail.com" Date: Thu, 11 Aug 2022 18:25:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A0=B1=E8=A1=A8=E6=9F=A5=E8=A9=A2:=20?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=A0=B1=E8=A1=A8=E4=B8=8D=E9=A1=AF=E7=A4=BA?= =?UTF-8?q?=E5=95=8F=E9=A1=8C(=E8=B3=87=E6=96=99=E6=9C=89null=EF=BC=8C?= =?UTF-8?q?=E5=8A=A0=E5=88=A4=E6=96=B7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SolarPower/Views/StationReport/Index.cshtml | 46 ++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/SolarPower/Views/StationReport/Index.cshtml b/SolarPower/Views/StationReport/Index.cshtml index 9ea1e96..6159fb9 100644 --- a/SolarPower/Views/StationReport/Index.cshtml +++ b/SolarPower/Views/StationReport/Index.cshtml @@ -1024,12 +1024,12 @@ sta += "" + toThousands(Number(inverter[i]).toFixed(2)) + ""; } }); - sta += "" + toThousands(Number(inverter.hourKWH).toFixed(2)) + ""; - sta += "" + toThousands(Number(inverter.hourKWHp).toFixed(2)) + ""; - sta += "" + toThousands(Number(inverter.irrDayHour).toFixed(2)) + ""; // body 小時平均日照度 irradiance - sta += "" + toThousands(Number(inverter.temperature).toFixed(2)) + ""; //body 小時平均模組溫度 + sta += "" + ((inverter.hourKWH == null) ? 0 : toThousands(Number(inverter.hourKWH).toFixed(2))) + ""; + sta += "" + ((inverter.hourKWHp == null) ? 0 : toThousands(Number(inverter.hourKWHp).toFixed(2))) + ""; + sta += "" + ((inverter.irrDayHour == null) ? 0 : toThousands(Number(inverter.irrDayHour).toFixed(2))) + ""; // body 小時平均日照度 irradiance + sta += "" + ((inverter.temperature == null) ? 0 : toThousands(Number(inverter.temperature).toFixed(2))) + "";//body 小時平均模組溫度 if (showmoney == 1) { - sta += "" + toThousands((Number(inverter.hourmoney).toFixed(2))) + ""; + sta += "" + ((inverter.hourmoney == null) ? 0 : toThousands(Number(inverter.hourmoney).toFixed(2))) + ""; } sta += ""; if (index < rel.data.length - 1) { @@ -1100,15 +1100,15 @@ sta += "" + toThousands(inverter[i].toFixed(2)) + ""; } }); - sta += "" + toThousands(inverter.dayKWH.toFixed(2)) + ""; + sta += "" + ((inverter.dayKWH == null) ? 0 : toThousands(inverter.dayKWH.toFixed(2))) + ""; sta += "" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp.toFixed(2))) + ""; - sta += "" + inverter.tothour.toFixed(2) + ""; - sta += "" + toThousands(inverter.KWHKWP.toFixed(2)) + ""; + sta += "" + ((inverter.tothour == null) ? 0 : toThousands(inverter.tothour.toFixed(2))) + ""; + sta += "" + ((inverter.KWHKWP == null) ? 0 : toThousands(inverter.KWHKWP.toFixed(2))) + ""; sta += "" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + ""; sta += "" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay.toFixed(2))) + ""; - sta += "" + inverter.temperature.toFixed(2) + ""; + sta += "" + ((inverter.temperature == null) ? 0 : toThousands(inverter.temperature.toFixed(2))) + ""; if (showmoney == 1) { - sta += "" + toThousands(inverter.soldmoney.toFixed(2)) + ""; + sta += "" + ((inverter.soldmoney == null) ? 0 : toThousands(inverter.soldmoney.toFixed(2))) + ""; } sta += ""; if (index < rel.data.length - 1) { @@ -1236,15 +1236,15 @@ sta += "" + toThousands(inverter[i].toFixed(2)) + ""; } }); - sta += "" + toThousands(inverter.dayKWH.toFixed(2)) + ""; - sta += "" + toThousands(inverter.dayKWHp.toFixed(2)) + ""; - sta += "" + toThousands(inverter.tothour.toFixed(2)) + ""; - sta += "" + toThousands(inverter.KWHKWP.toFixed(2)) + ""; - sta += "" + toThousands(inverter.PR.toFixed(2)) + ""; - sta += "" + toThousands(inverter.irradiance.toFixed(2)) + ""; - sta += "" + toThousands(inverter.temperature.toFixed(2)) + ""; + sta += "" + ((inverter.dayKWH == null) ? 0 : toThousands(inverter.dayKWH.toFixed(2))) + ""; + sta += "" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp.toFixed(2))) + ""; + sta += "" + ((inverter.tothour == null) ? 0 : toThousands(inverter.tothour.toFixed(2))) + ""; + sta += "" + ((inverter.KWHKWP == null) ? 0 : toThousands(inverter.KWHKWP.toFixed(2))) + ""; + sta += "" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + ""; + sta += "" + ((inverter.irradiance == null) ? 0 : toThousands(inverter.irradiance.toFixed(2))) + ""; + sta += "" + ((inverter.temperature == null) ? 0 : toThousands(inverter.temperature.toFixed(2))) + ""; if (showmoney == 1) { - sta += "" + toThousands(inverter.soldmoney.toFixed(2)) + ""; + sta += "" + ((inverter.soldmoney == null) ? 0 : toThousands(inverter.soldmoney.toFixed(2))) + ""; } sta += ""; avghour += inverter.tothour ? inverter.tothour : 0; @@ -1370,15 +1370,15 @@ sta += "" + toThousands(inverter[i].toFixed(2)) + ""; } }); - sta += "" + toThousands(inverter.dayKWH.toFixed(2)) + ""; + sta += "" + ((inverter.dayKWH == null) ? 0 : toThousands(inverter.dayKWH.toFixed(2))) + ""; sta += "" + ((inverter.dayKWHp == null) ? 0 : toThousands(inverter.dayKWHp.toFixed(2))) + ""; - sta += "" + toThousands(inverter.tothour.toFixed(2)) + ""; - sta += "" + toThousands(inverter.KWHKWP.toFixed(2)) + ""; + sta += "" + ((inverter.tothour == null) ? 0 : toThousands(inverter.tothour.toFixed(2))) + ""; + sta += "" + ((inverter.KWHKWP == null) ? 0 : toThousands(inverter.KWHKWP.toFixed(2))) + ""; sta += "" + ((inverter.PR == null) ? 0 : toThousands(inverter.PR.toFixed(2))) + ""; sta += "" + ((inverter.IrrDay == null) ? 0 : toThousands(inverter.IrrDay.toFixed(2))) + ""; - sta += "" + toThousands(inverter.temperature.toFixed(2)) + ""; + sta += "" + ((inverter.temperature == null) ? 0 : toThousands(inverter.temperature.toFixed(2))) + ""; if (showmoney == 1) { - sta += "" + toThousands(inverter.soldmoney.toFixed(2)) + ""; + sta += "" + ((inverter.soldmoney == null) ? 0 : toThousands(inverter.soldmoney.toFixed(2))) + ""; } sta += ""; avghour += inverter.tothour ? inverter.tothour : 0;