From e1d6ecb19c05c9cc00b7d4a29d82cbc546d5cd09 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期五, 02 八月 2024 16:42:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
static/js/worker.js | 41 +++++++++++++++++++++++++++++++----------
1 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/static/js/worker.js b/static/js/worker.js
index 24bb42f..3d0c8d4 100644
--- a/static/js/worker.js
+++ b/static/js/worker.js
@@ -10,8 +10,18 @@
value:null
}
let param = null
+let currentTable = ''
self.onmessage = function(event) {
const data = JSON.parse(event.data);
+ if(currentTable!=data.currentTable){
+ tableList = data.tableList;
+ }
+ currentTable = data.currentTable;
+ if(data.type&&data.type=='saveData'){
+ tableList = data.tableList;
+ param = data.param;
+ return
+ }
code = data.code;
if(tableList){
let str = code.split('-')
@@ -334,10 +344,17 @@
try{
if(comResult==0){
a[b].v.v = 0
+ }else if(a[b].v.ct&&a[b].v.ct.fa&&typeof a[b].v.ct.fa == 'string'&&a[b].v.ct.fa.includes('.')){
+ let num = 0
+ let str = a[b].v.ct.fa.split('.')[1]
+ num = str.length
+ a[b].v.v = comResult?Number(comResult).toFixed(num):comResult
}else{
- let val = parseFloat(comResult.toFixed(3))
- a[b].v.v = isNaN(val) ? '' : val
+ let val = parseFloat(Number(comResult).toFixed(3))
+ a[b].v.v = isNaN(val) ? comResult : val
}
+ // console.log('a[b].v.ct', comResult)
+ // console.log('a[b].v.v', a[b].v.v)
}catch(error){
a[b].v.v = comResult
console.log('error---', error)
@@ -444,14 +461,18 @@
* @returns 杩斿洖澶勭悊鍚庣殑鍙傛暟瀵硅薄
*/
function getParam(){
- for (var b in param){
- param[b].insValue = []
- param[b].comValue = []
- param[b].equipValue = []
- param[b].equipName = []
- param[b].resValue = null
- param[b].insResult = null
- }
+ tableList[0].arr.forEach(a=>{
+ a.forEach(b=>{
+ if(param[b.i]){
+ param[b.i].insValue = []
+ param[b.i].comValue = []
+ param[b.i].equipValue = []
+ param[b.i].equipName = []
+ param[b.i].resValue = null
+ param[b.i].insResult = null
+ }
+ })
+ })
tableList[0].arr.forEach(a => {
a.forEach(b=>{
if (b.v.ps != undefined &&typeof b.v.ps.value =='string'&& b.v.ps.value.includes('妫�楠屽��')) {
--
Gitblit v1.9.3