Browse Source

修改bug

Renxy 1 năm trước cách đây
mục cha
commit
3f885046b8

+ 2 - 2
.umirc.ts

@@ -27,8 +27,8 @@ export default defineConfig({
   headScripts: [`/rem.js`],
   proxy: {
     '/api': {
-      // target: 'http://47.96.12.136:8888/',
-      target: 'http://47.96.12.136:8788/',
+      target: 'http://47.96.12.136:8888/',
+      // target: 'http://47.96.12.136:8788/',
       // target: 'http://120.55.44.4:8903/',
       // target: 'https://work.greentech.com.cn/',
       changeOrigin: true,

+ 8 - 9
src/pages/EqSelfInspection/index.js

@@ -97,15 +97,14 @@ const EqSelfInspection = (props) => {
       `/self-inspection/detail/${projectId}/${id}?JWT-TOKEN=${GetTokenFromUrl()}`,
     );
   };
-
-  // useEffect(() => {
-  //   UnityAction.on('notiZiJian', (id) => {
-  //     handleJumpDetail(id);
-  //   });
-  //   //自检页面加载完毕
-  //   UnityAction.sendMsg('pageInited');
-  //   return () => UnityAction.off('notiZiJian');
-  // }, []);
+  useEffect(() => {
+    UnityAction.on('notiZiJian', (id) => {
+      handleJumpDetail(id);
+    });
+    //自检页面加载完毕
+    UnityAction.sendMsg('pageInited');
+    return () => UnityAction.off('notiZiJian');
+  }, []);
 
   useEffect(() => {
     if (routeId) {

+ 5 - 10
src/pages/Home/ChemCostComparison.js

@@ -84,17 +84,12 @@ const CostComparison = (props) => {
     // 大于100,保留一位
     // 大于1000,不保留
     let fixed = 0;
+    if (maxValue === 0) return fixed;
     if (maxValue < 1) {
-      const decimal = maxValue.toFixed(100).toString().split('.')[1];
-      const decimalArr = decimal.split('');
-      for (let index = 0; index < decimalArr.length; index++) {
-        if (decimalArr[index] === '0') {
-          fixed++;
-        } else {
-          break;
-        }
-      }
-      fixed += 2;
+      //maxValue + 1 防止maxValue过小自动转科学计数法
+      const decimal = (maxValue + 1).toString().split('.')[1];
+      const num = decimal.split('').findIndex((num) => num > 0);
+      fixed = num + 3;
     } else if (maxValue < 10) {
       fixed = 3;
     } else if (maxValue < 100) {

+ 1 - 1
src/pages/MessageCenter/index.js

@@ -39,7 +39,7 @@ const MessageCenter = () => {
       UnityAction.sendMsg('OpenTaskModal', `mandate_id=${item.MandateId}`);
       // }
     } else {
-      UnityAction.sendMsg('notiZiJian', item.ID);
+      if (item?.PatrolId) UnityAction.sendMsg('notiZiJian', item.PatrolId);
     }
   };