From 20bc6e3ab5266479cbb5732f2607140cb2f04ce7 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Fri, 26 Jun 2026 08:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E6=A3=80=E6=B5=8B-=E8=BF=87?= =?UTF-8?q?=E8=BD=BD=E6=B5=8B=E8=AF=95=E6=98=BE=E7=A4=BA=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/components/test.vue | 33 +++++++++++++++++++ .../src/views/home/components/testPopup.vue | 9 +++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index 96a88c3..a5def51 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -415,6 +415,39 @@ watch(webMsgSend, function(newValue, oldValue) { } else { // ========== 根据请求ID处理不同类型的消息 ========== switch (newValue.requestId) { + // 源过载测试 + case 'overloadTest': + if (newValue.code === 1) { + ElMessageBox.alert('电压过载!', '初始化失败', { + confirmButtonText: '确定', + type: 'error', + }) + testLogList.push({ type: 'error', log: `${new Date().toLocaleString()}:电压过载!` }) + emit('update:testStatus', 'test_init_fail') + count++ + } + if (newValue.code === 2) { + ElMessageBox.alert('电流过载!', '初始化失败', { + confirmButtonText: '确定', + type: 'error', + }) + testLogList.push({ type: 'error', log: `${new Date().toLocaleString()}:电流过载!` }) + emit('update:testStatus', 'test_init_fail') + count++ + } + if (newValue.code === 3) { + ElMessageBox.alert('电压和电流过载!', '初始化失败', { + confirmButtonText: '确定', + type: 'error', + }) + testLogList.push({ type: 'error', log: `${new Date().toLocaleString()}:电压和电流过载!` }) + emit('update:testStatus', 'test_init_fail') + count++ + } + if (newValue.code === 4) { + testLogList.push({ type: 'info', log: `${new Date().toLocaleString()}:过载测试成功!` }) + } + break; // 服务端错误 case 'server_error': if (newValue.operateCode === 'server_error' && count === 0) { diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index 14d8a2d..bfaada9 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -133,7 +133,8 @@ (ActiveStatue === 'success' || ActiveStatue === 'error' || ActiveStatue === 'connect_timeout' || - ActiveStatue === 'pause_timeout') + ActiveStatue === 'pause_timeout'|| + ActiveStatue === 'test_init_fail') " @click="nextStep" > @@ -472,7 +473,11 @@ watch(TestStatus, function (newValue, oldValue) { // 监听总体状态变化,处理步骤切换和错误状态 watch(ActiveStatue, function (newValue, oldValue) { - + //初始化失败 + if(newValue==='test_init_fail'){ + stepsActiveIndex.value = stepsTotalNum.value + 1 // 跳到最后一步 + nextStepText.value = '初始化失败' + } // 处理错误状态 if (newValue === 'error') {