Browse Source

fix: merge next

wzyyy 3 years atrás
parent
commit
ab977d029f

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

@@ -79,7 +79,7 @@ const CardDetail = () => {
               );
               );
               resolve({
               resolve({
                 xValue: sortArray.map((item: any) => item.date),
                 xValue: sortArray.map((item: any) => item.date),
-                data: sortArray.map((item: any) => item.value.toFixed(2)),
+                data: sortArray.map((item: any) => item.value && item.value.toFixed(2)),
               });
               });
             }
             }
           });
           });
@@ -103,7 +103,7 @@ const CardDetail = () => {
       bottom: 0,
       bottom: 0,
     };
     };
     getData(dTime[0], dTime[1]).then((resp) => {
     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);
       setTotal(_total ? _total.toFixed(2) : 0);
       setDayOptions({
       setDayOptions({
         ...DefaultEchartsOptions,
         ...DefaultEchartsOptions,
@@ -145,7 +145,7 @@ const CardDetail = () => {
       });
       });
     });
     });
     getData(mTime[0], mTime[1]).then((resp) => {
     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);
       setMonthTotal(_total ? _total.toFixed(2) : 0);
       setMonthOptions({
       setMonthOptions({
         ...DefaultEchartsOptions,
         ...DefaultEchartsOptions,
@@ -187,7 +187,7 @@ const CardDetail = () => {
       });
       });
     });
     });
     getData(yTime[0], yTime[1]).then((resp) => {
     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);
       setYearTotal(_total ? _total.toFixed(2) : 0);
       setYearOptions({
       setYearOptions({
         ...DefaultEchartsOptions,
         ...DefaultEchartsOptions,

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

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

File diff suppressed because it is too large
+ 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) {
     if (_pId) {
       setPid(_pId);
       setPid(_pId);
     }
     }
-    if (_sortIndex) {
+    if (_sortIndex && id === ':id') {
       setSortIndex(_sortIndex);
       setSortIndex(_sortIndex);
     }
     }
   };
   };
@@ -77,9 +77,9 @@ export default () => {
       {tabKey === 'detail' && (param.id !== ':id' ? data : true) ? (
       {tabKey === 'detail' && (param.id !== ':id' ? data : true) ? (
         <BaseDetail
         <BaseDetail
           data={{
           data={{
+            sortIndex: sortIndex,
             ...data,
             ...data,
             parentId: pId,
             parentId: pId,
-            sortIndex: sortIndex,
           }}
           }}
           basePath={params.get('basePath')}
           basePath={params.get('basePath')}
           onLoad={queryDetail}
           onLoad={queryDetail}

+ 28 - 17
src/pages/system/Menu/Setting/baseMenu.ts

@@ -3228,12 +3228,8 @@ export default [
         url: '/iot-card/Home',
         url: '/iot-card/Home',
         icon: 'icon-shujumoni',
         icon: 'icon-shujumoni',
         status: 1,
         status: 1,
-        permissions: [
-          {
-            permission: 'network-flow',
-            actions: ['query'],
-          },
-        ],
+        showPage: ['network-flow'],
+        permissions: [{ permission: 'network-flow', actions: ['query'] }],
         accessSupport: {
         accessSupport: {
           text: '不支持',
           text: '不支持',
           value: 'unsupported',
           value: 'unsupported',
@@ -3248,12 +3244,8 @@ export default [
         code: 'iot-card/Dashboard',
         code: 'iot-card/Dashboard',
         url: '/iot-card/Dashboard',
         url: '/iot-card/Dashboard',
         icon: 'icon-keshihua',
         icon: 'icon-keshihua',
-        permissions: [
-          {
-            permission: 'network-flow',
-            actions: ['query'],
-          },
-        ],
+        showPage: ['network-flow'],
+        permissions: [{ permission: 'network-flow', actions: ['query'] }],
       },
       },
       {
       {
         path: '5Hpl-O2m8',
         path: '5Hpl-O2m8',
@@ -3265,7 +3257,13 @@ export default [
         url: '/iot-card/CardManagement',
         url: '/iot-card/CardManagement',
         icon: 'icon-chanpinfenlei',
         icon: 'icon-chanpinfenlei',
         status: 1,
         status: 1,
-        permissions: [],
+        showPage: ['network-card'],
+        permissions: [
+          {
+            permission: 'network-card',
+            actions: ['query', 'save', 'delete'],
+          },
+        ],
         buttons: [
         buttons: [
           {
           {
             id: 'sync',
             id: 'sync',
@@ -3375,19 +3373,25 @@ export default [
         level: 2,
         level: 2,
         owner: 'iot',
         owner: 'iot',
         name: '充值管理',
         name: '充值管理',
+        showPage: ['network-card'],
         code: 'iot-card/Recharge',
         code: 'iot-card/Recharge',
         url: '/iot-card/Recharge',
         url: '/iot-card/Recharge',
         icon: 'icon-caidanguanli',
         icon: 'icon-caidanguanli',
         status: 1,
         status: 1,
-        permissions: [],
+        permissions: [
+          {
+            permission: 'network-card',
+            actions: ['query', 'save'],
+          },
+        ],
         buttons: [
         buttons: [
           {
           {
             id: 'pay',
             id: 'pay',
             name: '充值',
             name: '充值',
             permissions: [
             permissions: [
               {
               {
-                permission: 'IotCard-management',
-                actions: ['pay'],
+                permission: 'network-card',
+                actions: ['query', 'save'],
               },
               },
             ],
             ],
           },
           },
@@ -3403,7 +3407,13 @@ export default [
         url: '/iot-card/Platform',
         url: '/iot-card/Platform',
         icon: 'icon-wangguanzishebei',
         icon: 'icon-wangguanzishebei',
         status: 1,
         status: 1,
-        permissions: [],
+        showPage: ['platform'],
+        permissions: [
+          {
+            permission: 'platform',
+            actions: ['save', 'delete', 'query'],
+          },
+        ],
         buttons: [
         buttons: [
           {
           {
             id: 'action',
             id: 'action',
@@ -3467,6 +3477,7 @@ export default [
         url: '/iot-card/Record',
         url: '/iot-card/Record',
         icon: 'icon-rizhifuwu',
         icon: 'icon-rizhifuwu',
         status: 1,
         status: 1,
+        showPage: ['network-card'],
         permissions: [
         permissions: [
           {
           {
             permission: 'network-card',
             permission: 'network-card',