From ef1b406e8112c097d70deb0e23fc9cec1c9a535f Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期四, 11 七月 2024 12:49:30 +0800
Subject: [PATCH] 修改bug

---
 static/js/worker.js |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/static/js/worker.js b/static/js/worker.js
index 312648a..ff5df25 100644
--- a/static/js/worker.js
+++ b/static/js/worker.js
@@ -71,10 +71,20 @@
           let ask = currentSample.insProduct.find(m => m.id == item.i).ask?currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
           let res = Object.values(comValue)[0]
           let comp = []
+
           if(res==''||res==null||res==undefined||res=='Infinity'){
-            item.v.v = ''
+            item.v.v = null
+            list.forEach(a => {
+              if (a[0].r == item.r) {
+                for (let  b=0; b<a.length; b++) {
+                  if (a[b].c == item.c) {
+                    a[b].v.v = null
+                    break
+                  }
+                }
+              }
+            })
           }else{
-            console.log(ask,res,item.v.f)
             if(ask){
               comp = ask.map((m, i) => {
                 if (m.includes('RTS')) {
@@ -131,7 +141,6 @@
                     return handleMoreParam(res,m,'-')
                   }else{
                     let k = m.split('-')
-                    console.log(k,eval(res),eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1])))
                     return  eval(res) >= eval(handleFraction(k[0])) && eval(res) <= eval(handleFraction(k[1]))
                   }
                 }else if(m.includes('卤')){
@@ -203,7 +212,6 @@
           if(getInspectionValueType(item.i)==1){
             let ask = currentSample.insProduct.find(m => m.id == item.i).ask?currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
             comResult = compute(item.v.f.replace(/=/g, ' '),comValue)
-            console.log(1111,comResult)
             // 瑁呭椤圭洰妫�楠屽�艰浆鍖�
             if (PROJECT === '瑁呭鐢电紗' && ask[0].includes('RTS')) {
               let num2 = new Big(comResult)
@@ -299,10 +307,17 @@
   }
 }
 
+/**
+ * 澶勭悊甯︽湁澶氫釜鍙傛暟鐨勫嚱鏁�
+ *
+ * @param res 瀛楃涓诧紝闇�瑕佽鍒嗗壊骞跺鐞嗙殑瀛楃涓�
+ * @param str 瀛楃涓诧紝涓巖es涓殑姣忎竴椤硅繘琛屾瘮杈冪殑瀛楃涓诧紝鍙兘鏄垎鏁版垨鑰呭甫鏈夋瘮杈冪鍙风殑瀛楃涓�
+ * @param comp 瀛楃涓诧紝琛ㄧず姣旇緝绫诲瀷鐨勫瓧绗︼紙濡� '>'銆�'<'銆�'='銆�'鈮�'銆�'鈮�'銆�'卤'銆�'~'銆�'-'锛�
+ * @returns 杩斿洖甯冨皵鍊硷紝濡傛灉res涓瘡涓�椤归兘婊¤冻涓巗tr鐨勬瘮杈冩潯浠讹紝鍒欒繑鍥瀟rue锛屽惁鍒欒繑鍥瀎alse
+ */
 function handleMoreParam(res,str,comp){
   let arr = res.split('/')
   let arr0 = arr.every(item=>{
-    console.log(comp)
     switch (comp){
       case '>':
         return item > handleFraction(str)
@@ -332,6 +347,11 @@
   }
 }
 
+/**
+ * 鑾峰彇鍙傛暟
+ *
+ * @returns 杩斿洖澶勭悊鍚庣殑鍙傛暟瀵硅薄
+ */
 function getParam(){
   for (var b in param){
     param[b].insValue = []
@@ -669,6 +689,7 @@
   }
 }
 
+
 /**
  * 璁$畻鍑芥暟
  *
@@ -686,8 +707,6 @@
         if(typeof(comValue[a])=='string'&&comValue[a].includes('^')){
           // 璁$畻骞傛
           arr[a] = CalculatePower(comValue[a])
-        } else if (typeof(comValue[a])=='string'&&comValue[a].includes('/')) {
-          arr[a] = comValue[a].split('/')[0] / comValue[a].split('/')[1];
         } else{
           arr[a] = comValue[a]
         }
@@ -734,6 +753,8 @@
     }
     if(str.includes('&"/"&')){
       return str.replaceAll('&"/"&', '/').replaceAll('//','')
+    }else if(str.includes('/')){
+      return str
     }else{
       return eval(str)
     }

--
Gitblit v1.9.3