ソースを参照

fix: bug#7710

xieyonghong 3 年 前
コミット
10e63e770a
1 ファイル変更3 行追加3 行削除
  1. 3 3
      src/pages/iot-card/CardManagement/Detail/index.tsx

+ 3 - 3
src/pages/iot-card/CardManagement/Detail/index.tsx

@@ -103,7 +103,7 @@ const CardDetail = () => {
       bottom: 0,
     };
     getData(dTime[0], dTime[1]).then((resp) => {
-      const _total = resp.data.reduce((r, n) => r + n, 0);
+      const _total = resp.data.reduce((r, n) => r + Number(n), 0);
       setTotal(_total ? _total.toFixed(2) : 0);
       setDayOptions({
         ...DefaultEchartsOptions,
@@ -145,7 +145,7 @@ const CardDetail = () => {
       });
     });
     getData(mTime[0], mTime[1]).then((resp) => {
-      const _total = resp.data.reduce((r, n) => r + n, 0);
+      const _total = resp.data.reduce((r, n) => r + Number(n), 0);
       setMonthTotal(_total ? _total.toFixed(2) : 0);
       setMonthOptions({
         ...DefaultEchartsOptions,
@@ -187,7 +187,7 @@ const CardDetail = () => {
       });
     });
     getData(yTime[0], yTime[1]).then((resp) => {
-      const _total = resp.data.reduce((r, n) => r + n, 0);
+      const _total = resp.data.reduce((r, n) => r + Number(n), 0);
       setYearTotal(_total ? _total.toFixed(2) : 0);
       setYearOptions({
         ...DefaultEchartsOptions,