From 22686249d05921f62a033819f0294c6586d46bf3 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期五, 09 八月 2024 16:57:25 +0800
Subject: [PATCH] 修改数采bug
---
static/js/worker.js | 14 +++++++++++++-
static/js/worker0.js | 17 ++++++++++++++++-
src/main.js | 2 +-
src/components/do/b1-inspect-order-plan/Inspection.vue | 23 +++++++++++++++++++----
4 files changed, 49 insertions(+), 7 deletions(-)
diff --git a/src/components/do/b1-inspect-order-plan/Inspection.vue b/src/components/do/b1-inspect-order-plan/Inspection.vue
index dd3fb7d..713522c 100644
--- a/src/components/do/b1-inspect-order-plan/Inspection.vue
+++ b/src/components/do/b1-inspect-order-plan/Inspection.vue
@@ -1057,6 +1057,7 @@
getDataIndex:[],
getDataIndexLoading:false,
changeType:null,
+ getDataTypeId:''
}
},
computed: {
@@ -1397,6 +1398,7 @@
// 鍚� Worker 鍙戦�佹秷鎭紝寮�濮嬪鐞嗛�昏緫
this.getDataIndexLoading = false
this.dataGetDia = false
+ this.getDataTypeId = ''
this.worker0.postMessage(JSON.stringify({
dataAcquisitionInfo: this.dataAcquisitionInfo,
list:this.tableList[0].arr
@@ -1412,6 +1414,8 @@
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)
+ }else if(result.getDataTypeId){
+ this.getDataTypeId = result.getDataTypeId
}
};
},
@@ -2680,7 +2684,7 @@
let str = code.split('-')
let pId = str[3]
for(let i =0;i<this.currentSample.insProduct.length;i++){
- if(this.currentSample.insProduct[i].id==pId&&(this.currentSample.insProduct[i].ask=='-'||this.currentSample.insProduct[i].ask=='/')){
+ if(this.currentSample.insProduct[i].id==pId&&(this.currentSample.insProduct[i].ask=='-'||this.currentSample.insProduct[i].ask=='/'||this.currentSample.insProduct[i].ask=='鈥�')){
this.tableList[0].arr.forEach(item=>{
item.forEach(m=>{
if(m.i==pId&&m.v.ps&&m.v.ps.value=='缁撹'){
@@ -2722,15 +2726,20 @@
currentSample:this.currentSample,
PROJECT:this.PROJECT,
param:this.param,
- currentTable:this.currentTable
+ currentTable:this.currentTable,
+ getDataTypeId:this.getDataTypeId
}));
} catch (error) {
console.log(444,error);
}
+ let getDataType = false
// 鐩戝惉 Worker 杩斿洖鐨勭粨鏋�
this.worker.onmessage = (event) => {
this.result = JSON.parse(event.data);
+ if(this.result.value.getDataTypeId){
+ getDataType = true
+ }
switch (this.result.method){
case 'saveInsContext':
this.$nextTick(()=>{
@@ -2746,7 +2755,13 @@
}
}
}
- this.saveInsContext()
+ if(this.isGet&&!this.dataAcquisitionEidtAble&&!getDataType){
+ return
+ }
+ setTimeout(()=>{
+ this.saveInsContext()
+ },2000)
+ // this.saveInsContext()
})
break;
case 'tableList':
@@ -3140,8 +3155,8 @@
return
},
saveInsContext() {
- console.log(1111,this.param)
try {
+ console.log(1111,this.param)
if(this.param){
this.$axios.post(this.$api.insOrderPlan.saveInsContext, {
param: JSON.stringify(this.param)
diff --git a/src/main.js b/src/main.js
index c3b1ea1..ddc5532 100644
--- a/src/main.js
+++ b/src/main.js
@@ -20,7 +20,7 @@
//鏈湴
// Vue.prototype.LOCATIONVUE = "http://127.0.0.1:80";
// const javaApi = 'http://127.0.0.1:8001';
-const javaApi = 'http://192.168.0.104:8001';
+const javaApi = 'http://192.168.92.249:8001';
//浜�
// Vue.prototype.LOCATIONVUE = "http://114.132.189.42:8080";
// const javaApi = 'http://114.132.189.42:1234';
diff --git a/static/js/worker.js b/static/js/worker.js
index f8d2e8d..aec7253 100644
--- a/static/js/worker.js
+++ b/static/js/worker.js
@@ -12,6 +12,7 @@
}
let param = null
let currentTable = ''
+let getDataTypeId = null
self.onmessage = function(event) {
const data = JSON.parse(event.data);
if(currentTable!=data.currentTable){
@@ -30,6 +31,11 @@
return
}
code = data.code;
+ if(data.getDataTypeId){
+ getDataTypeId = data.getDataTypeId
+ }else{
+ getDataTypeId = null
+ }
if(tableList){
let str = code.split('-')
let r = str[1]
@@ -292,11 +298,17 @@
// console.log(5555,tableList)
}
// console.log('1234567789', tableList,getParam())
+ console.log('1234567789', item)
+ let getDataType0 = false
+ if(item.i==getDataTypeId){
+ getDataType0 = true
+ }
result = {
method:'saveInsContext',
value:{
tableList,
- param:getParam()
+ param:getParam(),
+ getDataTypeId:getDataType0?getDataTypeId:''
}
}
self.postMessage(JSON.stringify(result))
diff --git a/static/js/worker0.js b/static/js/worker0.js
index d3ae118..370ec75 100644
--- a/static/js/worker0.js
+++ b/static/js/worker0.js
@@ -4,12 +4,15 @@
method:'',
value:null
}
-
+let arrSpecial = []
+let numSpecial = 0;
self.onmessage = function(event) {
const data = JSON.parse(event.data);
dataAcquisitionInfo = data.dataAcquisitionInfo;
list = data.list;
// console.log(111,dataAcquisitionInfo)
+ arrSpecial = []
+ numSpecial = 0
handleData()
}
@@ -43,6 +46,8 @@
if(Array.isArray(dataAcquisitionInfo[str].value)){
for (let i = 0; i < dataAcquisitionInfo[str].value.length; i++) {
if(i+1==arr[1]){
+ arrSpecial.push(n.i)
+ numSpecial++
setTimeout(()=>{
let num0 = 0
if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
@@ -65,6 +70,8 @@
}
}else{
if(arr[1] ==dataAcquisitionInfo[str].frequency){
+ arrSpecial.push(n.i)
+ numSpecial++
setTimeout(()=>{
let num0 = 0
if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
@@ -85,6 +92,8 @@
},2000)
}else if(Number(dataAcquisitionInfo[str].frequency)>num){
if(n.v.ps.value.includes(num)){
+ arrSpecial.push(n.i)
+ numSpecial++
setTimeout(()=>{
let num0 = 0
if(n.v.ct&&n.v.ct.fa&&typeof n.v.ct.fa == 'string'&&n.v.ct.fa.includes('.')){
@@ -112,4 +121,10 @@
}
})
})
+ if(arrSpecial[numSpecial-1]){
+ result = {
+ getDataTypeId:arrSpecial[numSpecial-1],
+ }
+ self.postMessage(JSON.stringify(result))
+ }
}
--
Gitblit v1.9.3