From 7c0ec5844a0dac8616342358c3f5a0598b138f59 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Mon, 29 Sep 2025 14:49:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/home/components/comparePreTest.vue | 313 ++++++++---------- .../src/views/home/components/compareTest.vue | 53 ++- 2 files changed, 170 insertions(+), 196 deletions(-) diff --git a/frontend/src/views/home/components/comparePreTest.vue b/frontend/src/views/home/components/comparePreTest.vue index 43b7408..b0d0e04 100644 --- a/frontend/src/views/home/components/comparePreTest.vue +++ b/frontend/src/views/home/components/comparePreTest.vue @@ -226,184 +226,161 @@ watch(webMsgSend, function (newValue, oldValue) { } switch (newValue.requestId) { case 'yjc_sbtxjy': - switch (newValue.operateCode) { - case 'INIT_GATHER$02': - if (newValue.code == 10200) { - step1InitLog.value.push({ - type: 'info', - log: newValue.data, - }) - - } else if (newValue.code == 10201) { - step1.value = 'process' - step1InitLog.value = [{ - type: 'wait', - log: '正在进行设备通讯校验.....', - }]; - } else if (newValue.code == 10551) { - step1InitLog.value.push({ - type: 'error', - log: newValue.data + '设备触发报告异常!', - }) - step1.value = 'error' - ts.value = 'error' - step5.value = 'error' - } else if (newValue.code == 10552) { - step1InitLog.value = [{ - type: 'error', - log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!', - }]; - step1.value = 'error' - ts.value = 'error' - step5.value = 'error' - } else if (newValue.code == 25001) { - activeIndex.value = 1 - step1.value = 'success' - step2.value = 'process' - } - break; - case 'INIT_GATHER$03': - if (newValue.code == 10200) { - step1InitLog.value.push({ - type: 'info', - log: newValue.data, - }) - }else if (newValue.code == 25001) { - step1InitLog.value.push({ - type: 'info', - log: newValue.data, - }) - activeIndex.value = 1 - step1.value = 'success' - step2.value = 'process' - } - break; - case 'DATA_REQUEST$03': - if (newValue.code == 25001) { - activeIndex.value = 1 - step1.value = 'success' - step2.value = 'process' - } - break; + if (newValue.code == 10200) { + step1InitLog.value.push({ + type: 'info', + log: newValue.data, + }) + } + if (newValue.code == 10201) { + step1.value = 'process' + step1InitLog.value = [{ + type: 'wait', + log: '正在进行设备通讯校验.....', + }]; + } + if (newValue.code == 10551) { + step1InitLog.value.push({ + type: 'error', + log: newValue.data + '设备触发报告异常!', + }) + step1.value = 'error' + ts.value = 'error' + step5.value = 'error' + } + if (newValue.code == 10552) { + step1InitLog.value = [{ + type: 'error', + log: '存在已经初始化步骤,执行自动关闭,请重新发起检测!', + }]; + step1.value = 'error' + ts.value = 'error' + step5.value = 'error' + } + if (newValue.code == 25001) { + step1InitLog.value.push({ + type: 'info', + log: newValue.data, + }) + activeIndex.value = 1 + step1.value = 'success' + step2.value = 'process' } break; case 'record_wave_step1': - switch (newValue.operateCode) { - case 'DATA_REQUEST$03': - if (newValue.code == 25002) { //某一路录波校验失败 - step1InitLog.value.push({ - type: 'error', - log: newValue.data , - }) - }else if (newValue.code == 25003) { //最终失败 - step1.value = 'error' - ts.value = 'error' - step5.value = 'error' - } + if (newValue.code == 25002) { //某一路录波校验失败 + step1InitLog.value.push({ + type: 'error', + log: newValue.data, + }) + } else if (newValue.code == 25003) { //最终失败 + step1.value = 'error' + ts.value = 'error' + step5.value = 'error' } break; case 'yjc_mxyzxjy': - switch (newValue.operateCode){ - case 'DATA_REQUEST$02': - if (newValue.code == 10200) { //单个监测点成功 - step2InitLog.value.push({ - type: 'info', - log: newValue.data + '模型一致性检验成功!', - }) - }else if (newValue.code == 10201) { - step2.value = 'process' - step2InitLog.value = [{ - type: 'wait', - log: '正在进行模型一致性校验.....', - }]; - } else if (newValue.code == 25002) { //单个监测点失败 - step2InitLog.value.push({ - type: 'error', - log: newValue.data +'模型一致性检验失败!', - }) - }else if (newValue.code == 25001) { //最终成功 - step2.value = 'success' - step3.value = 'process' - activeIndex.value = 2 - }else if (newValue.code == 25003) { //最终失败 - step2.value = 'error' - ts.value = 'error' - step5.value = 'error' - } - break; + if (newValue.code == 10200) { //单个监测点成功 + step2InitLog.value.push({ + type: 'info', + log: newValue.data + '模型一致性检验成功!', + }) } - break; + if (newValue.code == 10201) { + step2.value = 'process' + step2InitLog.value = [{ + type: 'wait', + log: '正在进行模型一致性校验.....', + }]; + } + if (newValue.code == 25002) { //单个监测点失败 + step2InitLog.value.push({ + type: 'error', + log: newValue.data + '模型一致性检验失败!', + }) + } + if (newValue.code == 25001) { //最终成功 + step2.value = 'success' + step3.value = 'process' + activeIndex.value = 2 + } + if (newValue.code == 25003) { //最终失败 + step2.value = 'error' + ts.value = 'error' + step5.value = 'error' + } + break; case 'yjc_align': - switch (newValue.operateCode){ - case 'DATA_REQUEST$02': - if (newValue.code == 10200) { //单个监测点成功 - step3InitLog.value.push({ - type: 'info', - log: newValue.data +'实时数据对齐检验成功!', - }) - }else if (newValue.code == 10201) { - step3.value = 'process' - step3InitLog.value = [{ - type: 'wait', - log: '正在进行实时数据对齐检验.....', - }]; - }else if (newValue.code == 25002) { //单个监测点失败 - - step3InitLog.value.push({ - type: 'error', - log: newValue.data + '实时数据对齐检验失败!', - }) - }else if (newValue.code == 25001 && newValue.data) { //最终成功 - isShowDialog.value = true - step3.value = 'success' - step4.value = 'process' - activeIndex.value = 3 - testDataStructure.value = newValue.data - }else if (newValue.code == 25003) { //最终失败 - - isShowDialog.value = true - step3.value = 'error' - ts.value = 'error' - step5.value = 'error' - testDataStructure.value = newValue.data - } - break; + if (newValue.code == 10200) { //单个监测点成功 + step3InitLog.value.push({ + type: 'info', + log: newValue.data + '数据对齐检验成功!', + }) } - break; + if (newValue.code == 10201) { + step3.value = 'process' + step3InitLog.value = [{ + type: 'wait', + log: '正在进行数据对齐检验.....', + }]; + } + if (newValue.code == 25002) { //单个监测点失败 + + step3InitLog.value.push({ + type: 'error', + log: newValue.data + '数据对齐检验失败!', + }) + } + if (newValue.code == 25001 && newValue.data) { //最终成功 + isShowDialog.value = true + step3.value = 'success' + step4.value = 'process' + activeIndex.value = 3 + testDataStructure.value = newValue.data + } + if (newValue.code == 25003) { //最终失败 + + isShowDialog.value = true + step3.value = 'error' + ts.value = 'error' + step5.value = 'error' + testDataStructure.value = newValue.data + } + break; case 'YJC_xujy': - switch (newValue.operateCode) { - case 'DATA_REQUEST$02': - if (newValue.code == 10200) { - step4InitLog.value.push({ - type: 'info', - log: newValue.data, - }) - }else if (newValue.code == 10201) { - step4.value = 'process' - step4InitLog.value = [{ - type: 'wait', - log: '正在进行相序性检.....', - }]; - } else if(newValue.code == 25002){ - step4InitLog.value.push({ - type: 'error', - log: newValue.data, - }) - } else if (newValue.code == 25003) { - step4InitLog.value.push({ - type: 'error', - log: newValue.data, - }) - step4.value = 'error' - ts.value = 'error' - step5.value = 'error' - } else if (newValue.code == 25001) { - step4.value = 'success' - step5.value = 'success' - ts.value = 'success' - activeIndex.value = 4 - } - break + if (newValue.code == 10200) { + step4InitLog.value.push({ + type: 'info', + log: newValue.data, + }) + } + if (newValue.code == 10201) { + step4.value = 'process' + step4InitLog.value = [{ + type: 'wait', + log: '正在进行相序性检.....', + }]; + } + if (newValue.code == 25002) { + step4InitLog.value.push({ + type: 'error', + log: newValue.data, + }) + } + if (newValue.code == 25003) { + step4InitLog.value.push({ + type: 'error', + log: newValue.data, + }) + step4.value = 'error' + ts.value = 'error' + step5.value = 'error' + } + if (newValue.code == 25001) { + step4.value = 'success' + step5.value = 'success' + ts.value = 'success' + activeIndex.value = 4 } break; case 'quit': diff --git a/frontend/src/views/home/components/compareTest.vue b/frontend/src/views/home/components/compareTest.vue index d43d290..4667e23 100644 --- a/frontend/src/views/home/components/compareTest.vue +++ b/frontend/src/views/home/components/compareTest.vue @@ -394,31 +394,24 @@ watch( setLogList('error', '设备主动关闭连接!') stopTimeCount() break - case 'yjc_xyjy' : - switch (newValue.operateCode) { - - case 'INIT_GATHER$03': - if (newValue.code == 10552) { - ElMessageBox.alert('重复的初始化操作!', '检测失败', { - confirmButtonText: '确定', - type: 'error', - }) - setLogList('error', '重复的初始化操作!') - stopTimeCount() - } - } - break; + case 'yjc_xyjy' : + if (newValue.code == 10552) { + ElMessageBox.alert('重复的初始化操作!', '检测失败', { + confirmButtonText: '确定', + type: 'error', + }) + setLogList('error', '重复的初始化操作!') + stopTimeCount() + } + break; case 'yjc_sbtxjy' : - switch (newValue.operateCode) { - case 'INIT_GATHER$02': - ElMessageBox.alert('重复的初始化操作!', '检测失败', { - confirmButtonText: '确定', - type: 'error', - }) - setLogList('error', '重复的初始化操作!') - stopTimeCount() - } - break; + ElMessageBox.alert('重复的初始化操作!', '检测失败', { + confirmButtonText: '确定', + type: 'error', + }) + setLogList('error', '重复的初始化操作!') + stopTimeCount() + break; } if (checkStore.selectTestItems.preTest == false && newValue.requestId != 'formal_real') { if (testLogList[0].log == '正在检测,请稍等...' || testLogList[0].log == '暂无数据,等待检测开始') { @@ -431,7 +424,7 @@ watch( : newValue.requestId == 'yjc_mxyzxjy' ? '模型一致性检验' : newValue.requestId == 'yjc_align' - ? '实时数据对齐检验' + ? '数据对齐检验' : newValue.requestId == 'YJC_xujy' ? '相序校验' : '' @@ -462,12 +455,13 @@ watch( switch (newValue.code) { case 25001: case 25005: + case 25006: { let result: CheckData.ScriptChnItem[] = [] let message = JSON.parse(newValue.data) - // 当收到 25005 消息时,录波项目开始loading - if (newValue.code == 25005) { + // 当收到 25005/25006 消息时,录波项目开始loading + if (newValue.code == 25005 || newValue.code == 25006) { // 设置录波项目为LOADING状态 const waveResultItem = checkResult.find(item => item.code === 'wave_data') @@ -487,7 +481,7 @@ watch( } // 特殊处理录波项目 - 如果是25005消息且当前项目是录波项目,则使用已设置的状态 - if (newValue.code == 25005 && item.code === 'wave_data') { + if ((newValue.code == 25005||newValue.code == 25006) && item.code === 'wave_data') { const existingWaveItem = checkResult.find(checkItem => checkItem.scriptType === 'wave_data') if (existingWaveItem) { temp.devices = [...existingWaveItem.devices] // 保留已设置的devices @@ -536,6 +530,9 @@ watch( if(newValue.code == 25005){ setLogList("error", '实时数据校验失败!开始录波校验...') } + if(newValue.code == 25006){ + setLogList("error", '统计数据校验失败!开始录波校验...') + } break }