From 8e3368bd29587b5da5f3b8c87010f52426be285e Mon Sep 17 00:00:00 2001 From: guanj Date: Thu, 21 Aug 2025 09:33:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A3=E5=BC=8F=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/home/components/compareTest.vue | 37 ++++++++++++------- .../home/components/compareTestPopup.vue | 7 +--- .../home/components/deviceConnectionPopup.vue | 28 ++++++++------ 3 files changed, 42 insertions(+), 30 deletions(-) diff --git a/frontend/src/views/home/components/compareTest.vue b/frontend/src/views/home/components/compareTest.vue index fc1940b..34821c8 100644 --- a/frontend/src/views/home/components/compareTest.vue +++ b/frontend/src/views/home/components/compareTest.vue @@ -11,7 +11,7 @@ 检测项进度 - +
= computed(() }) watch(testStatus, function (newValue, oldValue) { - console.log('🚀 ~ newValue:', newValue) if (newValue == 'start' || newValue == 'waiting') { if (!checkStore.selectTestItems.preTest && !checkStore.selectTestItems.channelsTest) { ElMessage.success('初始化开始!') @@ -313,10 +312,8 @@ watch( scriptName: item.scriptName, devices: [] } - let message=JSON.parse(newValue.data) - + let message = JSON.parse(newValue.data) for (let i = 0; i < message?.length; i++) { - temp.devices.push({ deviceId: message[i].deviceId, deviceName: message[i].deviceName, @@ -325,10 +322,25 @@ watch( } result.push(temp) }) - console.log("🚀 ~ result:", result) - Object.assign(checkResult, result) - + testLogList.push({ + type: 'info', + log: `${new Date().toLocaleString()}:` + '检测完成!' + }) + if(testLogList[0].log === '正在检测,请稍等...'){ + testLogList.shift() + } + stopTimeCount() + break + case 25003: + + testLogList.push({ + type: 'error', + log: `${new Date().toLocaleString()}:` + '检测失败!' + }) + if(testLogList[0].log === '正在检测,请稍等...'){ + testLogList.shift() + } stopTimeCount() break default: @@ -337,9 +349,7 @@ watch( type: newValue.code == 10200 ? 'info' : 'error', log: `${new Date().toLocaleString()}:` + newValue.data }) - if (newValue.code == 25003) { - stopTimeCount() - } + updatePercentage() } @@ -485,7 +495,6 @@ const initCheckResult = () => { // 更新检测结果(详细到通道) const updateCheckResult = (data: CheckData.ScriptChnItem) => { - console.log('🚀 ~ updateCheckResult ~ data:', data) const { scriptType } = { ...data } checkResult.forEach(item => { @@ -651,7 +660,7 @@ const handlePause = () => { } const initializeParameters = () => { percentage.value = 0 - testLogList.splice(0, testLogList.length, { type: 'info', log: '暂无数据,等待检测开始' }) + testLogList.splice(0, testLogList.length, { type: 'info', log: '正在检测,请稍等...' }) } const pauseSuccessCallback = () => { @@ -676,6 +685,8 @@ const handleResumeTest = () => { } // onMounted(() => { + console.log(123123); + initializeParameters() }) diff --git a/frontend/src/views/home/components/compareTestPopup.vue b/frontend/src/views/home/components/compareTestPopup.vue index 70eb0fa..342f1dd 100644 --- a/frontend/src/views/home/components/compareTestPopup.vue +++ b/frontend/src/views/home/components/compareTestPopup.vue @@ -367,13 +367,10 @@ watch(TestStatus, function (newValue, oldValue) { }) watch(stepsActiveIndex, function (newValue, oldValue) { - console.log( - '🚀 ~ checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2:', - checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2 - ) - if (checkStore.selectTestItems.test && checkStore.selectTestItems.preTest && newValue == 2) { setTimeout(() => { + console.log(1); + testRef.value.initializeParameters() testRef.value.showTestLog() testRef.value.startTimeCount() diff --git a/frontend/src/views/home/components/deviceConnectionPopup.vue b/frontend/src/views/home/components/deviceConnectionPopup.vue index 14d09db..919d66f 100644 --- a/frontend/src/views/home/components/deviceConnectionPopup.vue +++ b/frontend/src/views/home/components/deviceConnectionPopup.vue @@ -40,7 +40,7 @@ - +