| | |
| | | }) |
| | | this.getTableLists0(list) |
| | | this.getReportModel(this.currentSample.id) |
| | | this.worker.postMessage(JSON.stringify({ |
| | | type: 'saveData', |
| | | tableList:this.tableList, |
| | | param:this.param, |
| | | currentTable:this.currentTable |
| | | })); |
| | | }else{ |
| | | this.tableLists = [] |
| | | this.tableList = [] |
| | |
| | | try { |
| | | let comValue = JSON.parse(a.insProductResult.comValue) |
| | | for (var i = 0; i < comValue.length; i++) { |
| | | this.param[a.id].comValue[i].v.v = comValue[i].v |
| | | this.param[a.id].comValue[i].v.v = this.toFixed(comValue[i].v,this.param[a.id].comValue[i].v.ct) |
| | | } |
| | | } catch (e) {} |
| | | try { |
| | | let insValue = JSON.parse(a.insProductResult.insValue) |
| | | for (let i = 0; i < insValue.length; i++) { |
| | | if(this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r)){ |
| | | this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = insValue[i].v |
| | | this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.v = this.toFixed(insValue[i].v,this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).v.ct) |
| | | this.param[a.id].insValue.find(m=>m.c==insValue[i].c&&m.r==insValue[i].r).u = insValue[i].u |
| | | // this.param[a.id].insValue[i].v.v = insValue[i].v |
| | | // this.param[a.id].insValue[i].u = insValue[i].u |
| | |
| | | } |
| | | } catch (e) {} |
| | | try { |
| | | this.param[a.id].resValue.v.v = a.lastValue |
| | | this.param[a.id].resValue.v.v = this.toFixed(a.lastValue,this.param[a.id].resValue.v.ct) |
| | | this.param[a.id].insResult.v.v = a.insResult |
| | | } catch (e) {} |
| | | }) |
| | |
| | | }, |
| | | getValue(v){ |
| | | let str = v.v?v.v:(v.v===0?v.v:(v.ct&&v.ct.s?v.ct.s.length>0&&v.ct.s[0].v.replace(new RegExp('\n', 'g'), '<br/>').replace(new RegExp('@', 'g'), '<br/>'):'')) |
| | | if(v.ct&&v.ct.fa&&v.ct.fa.includes('.')&&str){ |
| | | let num = 0 |
| | | let str0 = v.ct.fa.split('.')[1] |
| | | num = str0.length |
| | | str = Number(str).toFixed(num) |
| | | } |
| | | if(v.v&&typeof v.v == 'string'&&v.v.includes('@')){ |
| | | str = v.v.replace(new RegExp('@', 'g'), '<br/>') |
| | | } |
| | | return str |
| | | }, |
| | | getInspectionValueType(id) { |
| | |
| | | } |
| | | }) |
| | | this.getTableLists() |
| | | this.worker.postMessage(JSON.stringify({ |
| | | type: 'saveData', |
| | | tableList:this.tableList, |
| | | param:this.param, |
| | | currentTable:this.currentTable |
| | | })); |
| | | }, |
| | | caretBushing(num){ |
| | | let index = this.currentKey0 + num |
| | |
| | | * @returns 格式化后的字符串或原始数值(若配置不符合要求) |
| | | */ |
| | | toFixed(v,ct){ |
| | | if(v&&ct&&ct.fa&&ct.fa.includes('##')){ |
| | | if(v&&ct&&ct.fa){ |
| | | if(ct.fa.includes('.')){ |
| | | let num = ct.fa.slice(4).length |
| | | return Number(v).toFixed(num) |
| | | }else{ |
| | | return Number(v).toFixed(0) |
| | | return v |
| | | } |
| | | }else{ |
| | | return v |