From 3f7756b417496e8700c1ea3b69d73c5b45873790 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Tue, 25 Feb 2025 16:18:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/components/test.vue | 18 +++++++++--------- .../src/views/home/components/testPopup.vue | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index 3853676..becdb91 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -9,11 +9,11 @@ 检测用时:{{ timeView }} -
+
@@ -662,7 +662,7 @@ const handleEndItem = (code: string, desc: string | undefined, devices: CheckDat } else { let result = getResult(devices) if (desc.length > 150) { - desc = desc.substring(0, 150) + '...' + desc = desc.substring(0,150) + '...' } if (result === 1) { testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:${desc}检测结束:符合`}) @@ -1260,7 +1260,7 @@ const todoItem = (code: string) => { if (testStatus.value !== 'paused') { emit('update:webMsgSend', { requestId: `${code}_Start`, - desc: '输入:频率t=42.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ' + desc: '输入:频率t=42.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0°,Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ' }) } }, 1000) @@ -1268,7 +1268,7 @@ const todoItem = (code: string) => { if (testStatus.value !== 'paused') { emit('update:webMsgSend', { requestId: `${code}_End`, - desc: '输入:频率t=42.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ', + desc: '输入:频率t=42.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0°,Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ', data: [{ chnResult: [1, 1, 1, 1], deviceId: "3250a0ff180845cc8885da4ff628261e", @@ -1281,7 +1281,7 @@ const todoItem = (code: string) => { if (testStatus.value !== 'paused') { emit('update:webMsgSend', { requestId: `${code}_Start`, - desc: '输入:频率t=45.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ' + desc: '输入:频率t=45.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0°,Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ' }) } }, 3000) @@ -1289,7 +1289,7 @@ const todoItem = (code: string) => { if (testStatus.value !== 'paused') { emit('update:webMsgSend', { requestId: `${code}_End`, - desc: '输入:频率t=45.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ', + desc: '输入:频率t=45.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0°,Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ', data: [{ chnResult: [1, 1, 1, 1], deviceId: "3250a0ff180845cc8885da4ff628261e", @@ -1302,7 +1302,7 @@ const todoItem = (code: string) => { if (testStatus.value !== 'paused') { emit('update:webMsgSend', { requestId: `${code}_Start`, - desc: '输入:频率t=50.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ' + desc: '输入:频率t=50.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0°,Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ' }) } }, 6000) @@ -1310,7 +1310,7 @@ const todoItem = (code: string) => { if (testStatus.value !== 'paused') { emit('update:webMsgSend', { requestId: `${code}_End`, - desc: '输入:频率t=50.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ', + desc: '输入:频率t=50.5Hz Ua=57.74%Un,相角=0.0° Ub=57.74%Un,相角=-120.0° Uc=57.74%Un,相角=120.0° Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0°,Ia=0.0%In,相角=0.0° Ib=0.0%In,相角=0.0° Ic=0.0%In,相角=0.0° ', data: [{ chnResult: [1, 1, 1, 1], deviceId: "3250a0ff180845cc8885da4ff628261e", diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index 1ce95e6..e4c1bdf 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -23,7 +23,7 @@ 跳过 开始检测 @@ -273,7 +273,7 @@ watch(ActiveStatue, function (newValue, oldValue) { // stepsActiveIndex.value = stepsTotalNum.value + 2 nextStepText.value = '检测失败' } - if (newValue === 'success' && stepsActive.value === stepsTotalNum.value-1) { + if (newValue === 'success' && stepsActiveIndex.value === stepsTotalNum.value-1) { stepsActiveIndex.value += 2 nextStepText.value = '检测完成' } From ad850ca4ee60d0d99397a81e4407bdd6968bcdd4 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Wed, 26 Feb 2025 10:00:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/components/test.vue | 47 ++++++++++--------- .../src/views/home/components/testPopup.vue | 14 +++--- 2 files changed, 34 insertions(+), 27 deletions(-) diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index becdb91..7cfae79 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -51,12 +51,12 @@ - 重新检测 - + + + + + + 检测完成 @@ -328,16 +328,19 @@ watch(testStatus, function (newValue, oldValue) { showTestLog() - if (oldValue == 'error') { - testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:开始重新检测!`}) - handleReCheck() - } + // if (oldValue == 'recheck' || oldValue == 'error' || oldValue == 'test_init_fail' || oldValue == 'connect_timeout' || oldValue == 'pause_timeout' || oldValue == 'error_flow_end') { + // handleReCheck() + // } emit('update:testStatus', 'test_init') //startTimer() // todo 可移除 startData.value = new Date(); timeDifference.value = 0; testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`}) } + + if (newValue == 'recheck' || newValue == 'error' || newValue == 'test_init_fail' || newValue == 'connect_timeout' || newValue == 'pause_timeout' || oldValue == 'error_flow_end') { + stopTimeCount() + } }) // 次数 @@ -429,7 +432,8 @@ watch(webMsgSend, function (newValue, oldValue) { type: 'error', log: `${new Date().toLocaleString()}:存在已经初始化步骤,执行自动关闭,请重新发起检测!` }) - emit('update:testStatus', 'test_recheck') + // emit('update:testStatus', 'recheck') + emit('update:testStatus', 'test_init_fail') } else { switch (newValue.requestId) { case 'server_error': @@ -552,7 +556,7 @@ watch(webMsgSend, function (newValue, oldValue) { case 'Resume_Success': ElMessage.success('开始继续检测') emit('update:testStatus', 'process') - handleResumeTest() + //handleResumeTest() break; // case 'Resume_Fail': // ElMessage.error('无法继续检测') @@ -1336,11 +1340,8 @@ const todoItem = (code: string) => { const handleResumeTest = () => { //activeIndex++ startData.value = new Date(); - testLogList.push({ - type: 'info', - log: `${new Date().toLocaleString()}:继续检测`, - }) - //startTimer() + testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:开始重新检测!`}) + startTimer() resumeTimeCount() console.log('开始继续检测') }; @@ -1353,10 +1354,12 @@ const handleReCheck = () => { timeView.value = '00:00:00' timeDifference.value = 0 testLogList.length = 0 + errorCheckItem.length = 0 count = 0 showTestLog() + handleResumeTest() } // 获取当前执行的大测试项序号 @@ -1382,10 +1385,12 @@ const getNextActiveIndex = (code: string = ''): number => { return -1 } const startTimeCount = () => { - timer = setInterval(() => { - timeCount.value = timeCount.value + 1 - timeView.value = secondToTime(timeCount.value) - }, 1000) + if(!timer){ + timer = setInterval(() => { + timeCount.value = timeCount.value + 1 + timeView.value = secondToTime(timeCount.value) + }, 1000) + } } const stopTimeCount = () => { diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index e4c1bdf..11c2c3e 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -23,7 +23,7 @@ 跳过 开始检测 @@ -37,7 +37,7 @@ 继续检测 - 重新检测 + @@ -230,10 +230,11 @@ const handleSubmit = () => { } else if (TestStatus.value == 'paused') { // 发送继续指令 sendResume() - } else if (TestStatus.value == 'test_recheck') { - // 发送重新检测指令 - sendReCheck() } + // else if (TestStatus.value == 'recheck') { + // // 发送重新检测指令 + // sendReCheck() + // } // else if (TestStatus.value == 'success') { // handleClose() // } @@ -287,7 +288,8 @@ watch(ActiveStatue, function (newValue, oldValue) { } if (newValue === 'pause_timeout' && stepsActive.value === 4) { stepsActiveIndex.value += 2 - nextStepText.value = '结束测试' + // nextStepText.value = '结束测试' + nextStepText.value = '暂停超时' } if (newValue === 'success' && nextStepText.value === '下一步') { nextStep() // 实现自动点击,进入下一个测试内容 From b8492dfbe62fc8644d65e133e5513421cf60b2b0 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Wed, 26 Feb 2025 10:42:01 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/home/components/testPopup.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index 11c2c3e..f773d2e 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -37,7 +37,7 @@ 继续检测 - + @@ -65,7 +65,7 @@