wzyyy 3 лет назад
Родитель
Сommit
467e245fe3

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

@@ -79,7 +79,7 @@ const CardDetail = () => {
               );
               resolve({
                 xValue: sortArray.map((item: any) => item.date),
-                data: sortArray.map((item: any) => item.value),
+                data: sortArray.map((item: any) => item.value && item.value.toFixed(2)),
               });
             }
           });
@@ -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,

+ 1 - 1
src/pages/iot-card/CardManagement/index.tsx

@@ -547,7 +547,7 @@ const CardManagementNode = () => {
         tableStyle={{ minHeight }}
         actionRef={actionRef}
         params={searchParams}
-        options={{ fullScreen: true }}
+        options={{ fullScreen: false }}
         tableClassName={'iot-card-management'}
         columnEmptyText={''}
         request={(params) =>

+ 7 - 7
src/pages/iot-card/Dashboard/index.tsx

@@ -53,7 +53,7 @@ const Dashboard = () => {
             );
             resolve({
               xValue: sortArray.map((item: any) => item.date),
-              data: sortArray.map((item: any) => item.value),
+              data: sortArray.map((item: any) => item.value && item.value.toFixed(2)),
             });
           }
         });
@@ -74,7 +74,7 @@ const Dashboard = () => {
       bottom: 0,
     };
     getData(dTime[0], dTime[1]).then((resp) => {
-      setDayTotal(resp.data.reduce((r, n) => r + n, 0));
+      setDayTotal(resp.data.reduce((r, n) => r + Number(n), 0).toFixed(2));
       setDayOptions({
         ...DefaultEchartsOptions,
         grid,
@@ -115,7 +115,7 @@ const Dashboard = () => {
       });
     });
     getData(mTime[0], mTime[1]).then((resp) => {
-      setMonthTotal(resp.data.reduce((r, n) => r + n, 0));
+      setMonthTotal(resp.data.reduce((r, n) => r + Number(n), 0).toFixed(2));
       setMonthOptions({
         ...DefaultEchartsOptions,
         grid,
@@ -156,7 +156,7 @@ const Dashboard = () => {
       });
     });
     getData(yTime[0], yTime[1]).then((resp) => {
-      setYearTotal(resp.data.reduce((r, n) => r + n, 0));
+      setYearTotal(resp.data.reduce((r, n) => r + Number(n), 0).toFixed(2));
       setYearOptions({
         ...DefaultEchartsOptions,
         grid,
@@ -288,7 +288,7 @@ const Dashboard = () => {
             title="昨日流量消耗"
             value={
               <>
-                <span>{dayTotal.toFixed(2)}</span>
+                <span>{dayTotal}</span>
                 <span>M</span>
               </>
             }
@@ -301,7 +301,7 @@ const Dashboard = () => {
             title="当月流量消耗"
             value={
               <>
-                <span>{monthTotal.toFixed(2)}</span>
+                <span>{monthTotal}</span>
                 <span>M</span>
               </>
             }
@@ -314,7 +314,7 @@ const Dashboard = () => {
             title="本年流量消耗"
             value={
               <>
-                <span>{yearTotal.toFixed(2)}</span>
+                <span>{yearTotal}</span>
                 <span>M</span>
               </>
             }

Разница между файлами не показана из-за своего большого размера
+ 8 - 4
src/pages/rule-engine/Scene/Save/components/TimingTrigger/refactor.tsx


+ 2 - 2
src/pages/system/Menu/Detail/index.tsx

@@ -40,7 +40,7 @@ export default () => {
     if (_pId) {
       setPid(_pId);
     }
-    if (_sortIndex) {
+    if (_sortIndex && id === ':id') {
       setSortIndex(_sortIndex);
     }
   };
@@ -77,9 +77,9 @@ export default () => {
       {tabKey === 'detail' && (param.id !== ':id' ? data : true) ? (
         <BaseDetail
           data={{
+            sortIndex: sortIndex,
             ...data,
             parentId: pId,
-            sortIndex: sortIndex,
           }}
           basePath={params.get('basePath')}
           onLoad={queryDetail}