From 3845f43c43252185a134566a63670de9d1c2d253 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 28 十月 2024 15:06:45 +0800
Subject: [PATCH] Merge branch 'master' of http://114.132.189.42:9002/r/tx-lims-before into master

---
 src/util/excelFountion.js |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/util/excelFountion.js b/src/util/excelFountion.js
index 1fa318f..05a3e7c 100644
--- a/src/util/excelFountion.js
+++ b/src/util/excelFountion.js
@@ -51,7 +51,7 @@
     let min = null;
     if(val&&val.length>0){
       val = val.filter(item=>item!=null&&item!=='')
-      console.log(val)
+      // console.log(val)
       if(val.length>0){
         min = Math.min(...val)
       }
@@ -269,12 +269,13 @@
       'MAX',
       'MIN',
       'AVERAGE',
-      'APS',
+      'ABS',
     ]
-    f = f.replace(regex, ',')
+    f = f.replace(regex, ',').replace(new RegExp('"&', 'g'),'').replace(new RegExp('&"', 'g'),'')
     fouList.forEach(item=>{
-      f = f.replaceAll(item,',')
+      f = f.replace(new RegExp(item, 'g'),'')
     })
+    // console.log('f',f)
     let arr = f.split(',').filter(item=>{
       return item&& /[a-zA-Z]/.test(item)&&item!='undefined'&&item!='null'
     });
@@ -319,7 +320,9 @@
         if(typeof(comValue[a])=='string'&&comValue[a].includes('^')){
           // 璁$畻骞傛
           arr[a] = CalculatePower(comValue[a])
-        }else{
+        } else if (typeof(comValue[a])=='string'&&comValue[a].includes('/')) {
+          arr[a] = comValue[a]
+        } else{
           arr[a] = comValue[a]
         }
       }
@@ -351,14 +354,14 @@
         obj[item] = item
       }
     })
-    str = str.replaceAll(':', '-')
+    str = str.replace(new RegExp(':', 'g'),'')
     // 鏇挎崲鍙傛暟
     for (var a in obj) {
-      str = str.replaceAll(a, obj[a])
+      str = str.replace(new RegExp(a, 'g'),obj[a])
     }
     // 璁$畻
     for (var a in arr) {
-      str = str.replaceAll(a, arr[a])
+      str = str.replace(new RegExp(a, 'g'),arr[a])
     }
     return eval(str)
   } catch (error) {

--
Gitblit v1.9.3