| | |
| | | }, |
| | | result: null, |
| | | worker: null, |
| | | worker0: null, |
| | | wareLength:[], |
| | | dataAcquisitionInfo:{}, |
| | | dataAcquisitionEidt:0, |
| | |
| | | return |
| | | } |
| | | this.dataAcquisitionInfo = res.data |
| | | let list = this.tableList[0].arr |
| | | list.forEach((item,index)=>{ |
| | | let num = 0; |
| | | let str = '' |
| | | item.forEach(m=>{ |
| | | if(m.v.ps&&(m.v.ps.value=='æ£éªå项'||m.v.ps.value=='æ£éªé¡¹')){ |
| | | if(m.v.ps&&m.v.ps.value=='æ£éªé¡¹'){ |
| | | if(num==0){ |
| | | str = m.v.v+',' |
| | | num++ |
| | | } |
| | | } |
| | | if(m.v.ps&&m.v.ps.value=='æ£éªå项'){ |
| | | if(num==1){ |
| | | str = str+m.v.v |
| | | } |
| | | } |
| | | if(this.dataAcquisitionInfo[str]){ |
| | | let num = 0; |
| | | list[index].forEach(n=>{ |
| | | if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('æ£éªå¼')){ |
| | | num++ |
| | | } |
| | | }) |
| | | list[index].forEach((n,i)=>{ |
| | | if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('æ£éªå¼')){ |
| | | let arr = n.v.ps.value.split('å¼') |
| | | if(arr[1] ==this.dataAcquisitionInfo.frequency){ |
| | | setTimeout(()=>{ |
| | | this.$delete(n.v,'v') |
| | | this.$set(n.v,'v',this.dataAcquisitionInfo[str]) |
| | | this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | },1000) |
| | | }else if(Number(this.dataAcquisitionInfo.frequency)>num){ |
| | | if(n.v.ps.value.includes(num)){ |
| | | setTimeout(()=>{ |
| | | this.$delete(n.v,'v') |
| | | this.$set(n.v,'v',this.dataAcquisitionInfo[str]) |
| | | this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | },1000) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | // å Worker åéæ¶æ¯ï¼å¼å§å¤çé»è¾ |
| | | this.worker0.postMessage(JSON.stringify({ |
| | | dataAcquisitionInfo: this.dataAcquisitionInfo, |
| | | list:this.tableList[0].arr |
| | | })); |
| | | // çå¬ Worker è¿åçç»æ |
| | | this.worker0.onmessage = (event) => { |
| | | let result = JSON.parse(event.data); |
| | | if(result.method=='changeInput'){ |
| | | let {list,n} = result.value |
| | | this.$set(this.tableList[0],'arr',list) |
| | | this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | } |
| | | }; |
| | | // let list = this.tableList[0].arr |
| | | // list.forEach((item,index)=>{ |
| | | // let num = 0; |
| | | // let str = '' |
| | | // item.forEach(m=>{ |
| | | // if(m.v.ps&&(m.v.ps.value=='æ£éªå项'||m.v.ps.value=='æ£éªé¡¹')){ |
| | | // if(m.v.ps&&m.v.ps.value=='æ£éªé¡¹'){ |
| | | // if(num==0){ |
| | | // str = m.v.v+',' |
| | | // num++ |
| | | // } |
| | | // } |
| | | // if(m.v.ps&&m.v.ps.value=='æ£éªå项'){ |
| | | // if(num==1){ |
| | | // str = str+m.v.v |
| | | // } |
| | | // } |
| | | // if(this.dataAcquisitionInfo[str]){ |
| | | // let num = 0; |
| | | // list[index].forEach(n=>{ |
| | | // if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('æ£éªå¼')){ |
| | | // num++ |
| | | // } |
| | | // }) |
| | | // list[index].forEach((n,i)=>{ |
| | | // if(n.v.ps&&n.v.ps.value&&typeof n.v.ps.value == 'string'&&n.v.ps.value.includes('æ£éªå¼')){ |
| | | // let arr = n.v.ps.value.split('å¼') |
| | | // if(arr[1] ==this.dataAcquisitionInfo.frequency){ |
| | | // setTimeout(()=>{ |
| | | // this.$delete(n.v,'v') |
| | | // this.$set(n.v,'v',this.dataAcquisitionInfo[str]) |
| | | // this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | // },1000) |
| | | // }else if(Number(this.dataAcquisitionInfo.frequency)>num){ |
| | | // if(n.v.ps.value.includes(num)){ |
| | | // setTimeout(()=>{ |
| | | // this.$delete(n.v,'v') |
| | | // this.$set(n.v,'v',this.dataAcquisitionInfo[str]) |
| | | // this.changeInput('',`${this.currentSample.insProduct[0].templateId}-${n.r}-${n.c}-${n.i}`,n) |
| | | // },1000) |
| | | // } |
| | | // } |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // }) |
| | | // }) |
| | | }) |
| | | }, |
| | | // å¤çº¿ç¨ |
| | | startWorker() { |
| | | if (this.worker) { |
| | | if (this.worker) { |
| | | this.stopWorker(); // ç¡®ä¿ä¹åç Worker 已忢 |
| | | } |
| | | // å建 Worker å®ä¾ |
| | | this.worker = new Worker('/static/js/worker.js'); |
| | | if (this.worker0) { |
| | | this.stopWorker(); // ç¡®ä¿ä¹åç Worker 已忢 |
| | | } |
| | | // å建 Worker å®ä¾ |
| | | this.worker0 = new Worker('/static/js/worker0.js'); |
| | | }, |
| | | stopWorker() { |
| | | if (this.worker) { |
| | | this.worker.terminate(); |
| | | this.worker = null; |
| | | } |
| | | if (this.worker0) { |
| | | this.worker0.terminate(); |
| | | this.worker0 = null; |
| | | } |
| | | }, |
| | | // 温度循ç¯---å¼å§ |
| | | changeItem(row){ |