From 223334b156c655a60eb11c63d06eef4c7e9c5848 Mon Sep 17 00:00:00 2001 From: gaoluyang <gaoluyang@rengu.cc> Date: 星期四, 11 七月 2024 13:42:47 +0800 Subject: [PATCH] 科学计数法逻辑修改 --- static/js/worker.js | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/static/js/worker.js b/static/js/worker.js index 5d77047..76eb25b 100644 --- a/static/js/worker.js +++ b/static/js/worker.js @@ -35,6 +35,9 @@ break } } + let isToExponential = '' + let list2 = [] + excelMethodList.forEach(item => { if (item.valueList.find(m => m.r == r && m.c == c)) { var comValue = {} @@ -50,6 +53,8 @@ break } } + 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('/')){ @@ -85,6 +90,7 @@ } }) }else{ + // console.log(ask,res,item.v.f) if(ask){ comp = ask.map((m, i) => { if (m.includes('RTS')) { @@ -141,6 +147,7 @@ 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('卤')){ @@ -212,9 +219,10 @@ 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; comResult = compute(item.v.f.replace(/=/g, ' '),comValue) // 瑁呭椤圭洰妫�楠屽�艰浆鍖� - if (PROJECT === '瑁呭鐢电紗' && ask[0].includes('RTS')) { + if (PROJECT === '瑁呭鐢电紗' && isToExponential === true) { let num2 = new Big(comResult) comResult = num2.toExponential() } -- Gitblit v1.9.3