gaoluyang
2024-07-11 b403195a75a452b54fe2112158b454f6d80c0e11
科学计数法逻辑修改
已修改1个文件
16 ■■■■■ 文件已修改
static/js/worker.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
static/js/worker.js
@@ -54,7 +54,6 @@
                  }
                }
                list2.push(c.v.v)
                isToExponential = list2.some(val => val.includes('e+'))
                if(getInspectionValueType(item.i)==1&&!isNaN(parseFloat(c.v.v))){
                  let n = String(c.v.v)
                  if(n.includes('/')){
@@ -218,11 +217,17 @@
        let comResult = ''
        try {
          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;
            let tell = currentSample.insProduct.find(m => m.id == item.i).tell?currentSample.insProduct.find(m => m.id == item.i).tell.split('&'):null;
            // let ask = currentSample.insProduct.find(m => m.id == item.i).ask?currentSample.insProduct.find(m => m.id == item.i).ask.split('&'):null;
            // let tell = currentSample.insProduct.find(m => m.id == item.i).tell?currentSample.insProduct.find(m => m.id == item.i).tell.split('&'):null;
            comResult = compute(item.v.f.replace(/=/g, ' '),comValue)
            let list3 = []
            list2.forEach(val => {
              val = val.toString()
              list3.push(val)
            })
            isToExponential = list3.some(val => val.includes('e+'))
            // 装备项目检验值转化
            if (PROJECT === '装备电缆' && isToExponential === true) {
            if (PROJECT === '装备电缆' && isToExponential) {
              let num2 = new Big(comResult)
              comResult = num2.toExponential()
            }
@@ -248,6 +253,7 @@
            comResult = str
          }
        } catch (error) {
          console.log('error---', error)
        }
        try {
          list.forEach(a => {
@@ -267,7 +273,7 @@
          })
          changeInput(comResult, `${id}-${item.r}-${item.c}-${pId}`) //改变最终值
        } catch (error) {
          console.log('error---', error)
        }
      }
    }