diff --git a/frontend/src/views/home/components/factorTest.vue b/frontend/src/views/home/components/factorTest.vue index bd13eac..7aec451 100644 --- a/frontend/src/views/home/components/factorTest.vue +++ b/frontend/src/views/home/components/factorTest.vue @@ -322,6 +322,12 @@ watch(webMsgSend, function (newValue, oldValue) { type: 'error', }) TableInit(); + } else if (newValue.code == -1) { //todo 10552之后还会发送消息吗? + ElMessageBox.alert('源未知异常', '检测失败', { + confirmButtonText: '确定', + type: 'error', + }) + TableInit(); } else { // ==================== 特定业务消息处理 ==================== diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index 2f1cf9d..8da05be 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -167,7 +167,7 @@ const ts = ref(''); // 内部测试状态,用于向父组件同步 /** * 处理致命错误 - 会终止整个检测流程 * @param stepRef 当前步骤状态引用 - * @param logRef 当前步骤日志引用 + * @param logRef 当前步骤日志引用 * @param message 错误消息 */ function handleFatalError(stepRef: any, logRef: any, message: string) { @@ -199,7 +199,7 @@ function handleWarningError(stepRef: any, logRef: any, message: string) { * 监听WebSocket消息,根据不同的requestId和operateCode处理各种检测状态 * 主要消息类型: * - yjc_ytxjy: 源通讯校验 - * - yjc_sbtxjy: 设备通讯校验 + * - yjc_sbtxjy: 设备通讯校验 * - yjc_xyjy: 协议校验 * - YJC_xujy: 相序校验 */ @@ -358,6 +358,14 @@ watch(webMsgSend, function (newValue, oldValue) { handleFatalError(step4, step4InitLog, '存在已经初始化步骤,执行自动关闭,请重新发起检测!') } else if (newValue.code == 10520) { handleFatalError(step4, step4InitLog, '解析报文异常') + }else if (newValue.code == -1) { + step4.value = 'error' + step4InitLog.value = [{ + type: 'error', + log: '源未知异常!', + }]; + ts.value = 'error' + step5.value = 'error' } break; case 'DATA_REQUEST$02': @@ -389,7 +397,7 @@ watch(webMsgSend, function (newValue, oldValue) { ts.value = 'success' } activeIndex.value = 5 - + break } break; diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index dff21f7..168d17f 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -260,7 +260,7 @@ const checkResultView: ComputedRef = computed(() temp.devices.push({ deviceId: device.deviceId, deviceName: device.deviceName, - chnResult: tempChnBtnResult, + chnResult: tempChnBtnResult }) }) return temp @@ -401,6 +401,16 @@ watch(webMsgSend, function(newValue, oldValue) { log: `${new Date().toLocaleString()}:存在已经初始化步骤,执行自动关闭,请重新发起检测!`, }) emit('update:testStatus', 'test_init_fail') + } else if (newValue.code == -1) { + ElMessageBox.alert('源未知异常!', '检测失败!', { + confirmButtonText: '确定', + type: 'error', + }) + testLogList.push({ + type: 'error', + log: `${new Date().toLocaleString()}:源未知异常!` + }) + emit('update:testStatus', 'error') } else { // ========== 根据请求ID处理不同类型的消息 ========== switch (newValue.requestId) { @@ -637,7 +647,7 @@ watch(webMsgSend, function(newValue, oldValue) { break // 检测结束 case 'Quit': - + break } } @@ -1121,7 +1131,7 @@ const handleResumeTest = () => { startData.value = new Date() testLogList.push({ type: 'info', log: `${new Date().toLocaleString()}:开始重新检测!` }) resumeTimeCount() - + } // ========== 测试项索引管理函数 ========== @@ -1196,13 +1206,13 @@ onBeforeUnmount(() => { clearInterval(timer) timer = null } - + // 清理响应式数组引用,防止内存泄漏 deviceList.splice(0) checkResult.splice(0) testLogList.splice(0) errorCheckItem.splice(0) - + // 重置其他状态 scriptData.splice(0) activeIndex = 0 diff --git a/frontend/src/views/machine/device/components/devicePopup.vue b/frontend/src/views/machine/device/components/devicePopup.vue index 7c8cc42..9e99fc5 100644 --- a/frontend/src/views/machine/device/components/devicePopup.vue +++ b/frontend/src/views/machine/device/components/devicePopup.vue @@ -38,7 +38,7 @@ clearable placeholder="请选择设备类型" @change="handleDevTypeChange" - + > @@ -92,7 +92,7 @@ v-model="formContent.inspectDate" placeholder="请选择定检日期" :disabled-date="disabledDate" - + /> 参数信息 @@ -128,7 +128,7 @@ v-model="formContent.protocol" clearable placeholder="请选择通讯协议" - + > @@ -160,7 +160,7 @@ v-model="formContent.series" placeholder="请输入识别码" show-password - + /> @@ -168,7 +168,7 @@ v-model="formContent.devKey" placeholder="请输入密钥" show-password - + /> @@ -196,7 +196,7 @@ v-model="formContent.cityName" clearable placeholder="请输入所属地市" - + /> @@ -204,7 +204,7 @@ v-model="formContent.gdName" clearable placeholder="请输入所属供电公司" - + /> @@ -212,7 +212,7 @@ v-model="formContent.subName" clearable placeholder="请输入所属电站" - + /> { value: String(i + 1), label: String(i + 1) })) + if(scene.value === '1'){ + if (dev.name.includes('NPQS-581') || dev.name.includes('NPQS-580') || dev.name.includes('PQ-COM')) { + formContent.value.encryptionFlag = 1 + formContent.value.series = 'Pqs&cn870299' + formContent.value.devKey = '!qaz@wsx3edc4rfv' + } else { + formContent.value.encryptionFlag = 0 + formContent.value.series = null + formContent.value.devKey = null + } + } } else { // 默认值处理 formContent.devChns = 1