diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index aa11a81..b2e7ea7 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -278,6 +278,20 @@ watch(webMsgSend,function (newValue,oldValue){ type: 'wait', log: '正在进行设备通讯校验.....', }]; + } else if (newValue.code == 10550) { + step2InitLog.value.push({ + type: 'error', + log: newValue.data+'设备连接异常!', + }) + step2.value = 'error' + ts.value = 'error' + }else if (newValue.code == 10551) { + step2InitLog.value.push({ + type: 'error', + log: newValue.data+'设备触发报告异常!', + }) + step2.value = 'error' + ts.value = 'error' } else if (newValue.code == 10552) { //ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!") step2InitLog.value = [{ @@ -310,7 +324,21 @@ watch(webMsgSend,function (newValue,oldValue){ type: 'wait', log: '正在进行通讯协议校验.....', }]; - } else if (newValue.code == 10552) { + } else if (newValue.code == 10550) { + step3InitLog.value.push({ + type: 'error', + log: newValue.data+'设备连接异常!', + }) + step3.value = 'error' + ts.value = 'error' + }else if (newValue.code == 10551) { + step3InitLog.value.push({ + type: 'error', + log: newValue.data+'设备触发报告异常!', + }) + step3.value = 'error' + ts.value = 'error' + }else if (newValue.code == 10552) { step3.value = 'error' //ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!") step3InitLog.value = [{ @@ -333,6 +361,20 @@ watch(webMsgSend,function (newValue,oldValue){ type: 'wait', log: '正在进行通讯协议校验.....', }]; + }else if (newValue.code == 10550) { + step3InitLog.value.push({ + type: 'error', + log: newValue.data+'设备连接异常!', + }) + step3.value = 'error' + ts.value = 'error' + }else if (newValue.code == 10551) { + step3InitLog.value.push({ + type: 'error', + log: newValue.data+'设备触发报告异常!', + }) + step3.value = 'error' + ts.value = 'error' } else if (newValue.code == 10552) { step3.value = 'error' //ElMessage.error("存在已经初始化步骤,已经自动关闭,请重新发起检测!") @@ -352,6 +394,20 @@ watch(webMsgSend,function (newValue,oldValue){ } else if (newValue.code == 10201) { step3.value = 'process' + }else if (newValue.code == 10550) { + step3InitLog.value.push({ + type: 'error', + log: newValue.data+'设备连接异常!', + }) + step3.value = 'error' + ts.value = 'error' + }else if (newValue.code == 10551) { + step3InitLog.value.push({ + type: 'error', + log: newValue.data+'设备触发报告异常!', + }) + step3.value = 'error' + ts.value = 'error' } else if (newValue.code == 10552) { //ElMessage.error("当前步骤已经初始化,执行自动关闭,请重新发起检测!") step3.value = 'error' @@ -425,7 +481,6 @@ watch(webMsgSend,function (newValue,oldValue){ break } - break; case 'quit': break; @@ -448,21 +503,17 @@ watch(webMsgSend,function (newValue,oldValue){ ts.value = 'error' break; } - - break; } - - }) watch(activeIndex, function (newValue, oldValue) { - if (newValue <= activeTotalNum.value - 2) - + if (newValue <= activeTotalNum.value - 2){ collapseActiveName.value = (newValue+1).toString() - else + } else{ collapseActiveName.value = (newValue - 1).toString() + } }) //监听goods_sn的变化 diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index 177333b..35ab4df 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -147,11 +147,18 @@ const detectionOptions = ref([ const isTimeCheck = ref(false) const preTestRef = ref(null); + const devIdArr = ref([]) + const planId = ref('') + // 打开弹窗,可能是新增,也可能是编辑 const open = (selection: Device.ResPqDev[],title: string,time:boolean) => { const checkStates = selection.map(item => item.checkState); + devIdArr.value = selection.map(item => item.id); + planId.value =selection[0].planId + console.log('wwwwwwwwwwwwwwwww',selection) + const allCheckStatesEqual = new Set(checkStates).size <= 1; if (!allCheckStatesEqual) { @@ -196,26 +203,6 @@ const detectionOptions = ref([ } - - /* else if(res.code === 10200){ - switch (res.operateCode){ - case 'INIT_GATHER': - - break - - } - - }else if(res.code === 10201){ - switch (res.operateCode){ - case 'INIT_GATHER': - //开始进入源初始化检测 - - - break - - } - - }*/ }); @@ -238,12 +225,11 @@ const detectionOptions = ref([ })*/ startPreTest({ userPageId: "cdf", - devIds:["5eaba83670ff4d9daf892a62a5e13ea3","80b4b4f52a4c4064a18319525f8ac13c"], - planId:"31cc203f3fa94fa39323ae7cc411cd66" + devIds:devIdArr.value, + planId:planId.value }).then(res=>{ - }) break; case 1: