From dbdc40f3b084afdb3737d29c5d7a1a53a1327ea1 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 24 七月 2024 16:54:54 +0800
Subject: [PATCH] 完善温升、热循环检验
---
static/js/worker.js | 51 +++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/static/js/worker.js b/static/js/worker.js
index 8bcac61..24bb42f 100644
--- a/static/js/worker.js
+++ b/static/js/worker.js
@@ -1,6 +1,6 @@
let code = ''
-let tableList = []
+let tableList = null
let excelMethodList = []
let comparisonList = []
let currentSample = {}
@@ -13,11 +13,32 @@
self.onmessage = function(event) {
const data = JSON.parse(event.data);
code = data.code;
- tableList = JSON.parse(JSON.stringify(data.tableList));
+ if(tableList){
+ let str = code.split('-')
+ let r = str[1]
+ let c = str[2]
+ tableList[0].arr.forEach((item,index)=>{
+ item.forEach((m,i)=>{
+ if(m.c==c&&m.r==r){
+ tableList[0].arr[index] = data.tableList[0].arr[index]
+ }
+ })
+ })
+ }else{
+ tableList = data.tableList;
+ }
+ if(param){
+ let str = code.split('-')
+ let pId = str[3]
+ param[pId] = data.param[pId]
+ }else{
+ param = data.param;
+ }
+ // tableList = data.tableList;
+ // param = data.param;
excelMethodList = JSON.parse(JSON.stringify(data.excelMethodList));
comparisonList = JSON.parse(JSON.stringify(data.comparisonList));
currentSample = JSON.parse(JSON.stringify(data.currentSample));
- param = data.param;
PROJECT = data.PROJECT
changeInput('', code);
};
@@ -38,7 +59,6 @@
let isToExponential = ''
let list2 = []
let isPoint = ''
-
excelMethodList.forEach(item => {
if (item.valueList&&item.valueList.length>0&&item.valueList.find(m => m.r == r && m.c == c)) {
var comValue = {}
@@ -254,6 +274,7 @@
}
// console.log(tableList)
}
+ // console.log('1234567789', tableList,getParam())
result = {
method:'saveInsContext',
value:{
@@ -310,10 +331,13 @@
if (a[0].r == item.r && comResult !== '') {
for (var b in a) {
if (a[b].c == item.c) {
- // console.log('comResult---', comResult)
try{
- let val = parseFloat(comResult.toFixed(3))
- a[b].v.v = isNaN(val) ? '' : val
+ if(comResult==0){
+ a[b].v.v = 0
+ }else{
+ let val = parseFloat(comResult.toFixed(3))
+ a[b].v.v = isNaN(val) ? '' : val
+ }
}catch(error){
a[b].v.v = comResult
console.log('error---', error)
@@ -430,7 +454,7 @@
}
tableList[0].arr.forEach(a => {
a.forEach(b=>{
- if (b.v.ps != undefined && b.v.ps.value === '妫�楠屽��') {
+ if (b.v.ps != undefined &&typeof b.v.ps.value =='string'&& b.v.ps.value.includes('妫�楠屽��')) {
b.i &&b.v.v&& param[b.i].insValue.push(b)
}
if (b.v.ps != undefined && b.v.ps.value === '璁$畻鍊�') {
@@ -526,7 +550,7 @@
let num = null;
let arr = [];
if(val&&val.length>0){
- arr = val.filter(item=>item!=null&&item!=='')
+ arr = val.filter(item=>item!=null&&item!=''&&item!=undefined)
arr.forEach(item=>{
num+=item;
})
@@ -814,7 +838,13 @@
str = str.replace(new RegExp(a, 'g'),arr[a])
}
if(str.includes(',,')){
- str = str.replace(new RegExp(',,', 'g'),'')
+ str = str.replace(new RegExp(',,', 'g'),',')
+ }
+ if(str.includes(',,')){
+ str = str.replace(new RegExp(',,', 'g'),',')
+ }
+ if(str.includes(',,')){
+ str = str.replace(new RegExp(',,', 'g'),',')
}
// console.log('str', str)
if(str.includes('&"/"&')){
@@ -822,6 +852,7 @@
} else if (isPoint) {
return str.replace('ABS', '').replace(/\(|\)/g, '')
}else {
+ console.log('str', str,eval(str))
return eval(str)
}
} catch (error) {
--
Gitblit v1.9.3