From 9989cc98cb430f3efccc1fd2927002ebcd37a9af Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Mon, 26 May 2025 14:41:06 +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 --- frontend/src/api/check/interface/index.ts | 1 + .../src/views/home/components/preTest.vue | 8 + .../home/components/selectTestItemPopup.vue | 3 +- frontend/src/views/home/components/table.vue | 31 ++-- frontend/src/views/home/components/test.vue | 160 ++++++++++-------- .../src/views/home/components/testPopup.vue | 6 +- 6 files changed, 119 insertions(+), 90 deletions(-) diff --git a/frontend/src/api/check/interface/index.ts b/frontend/src/api/check/interface/index.ts index fdd1fe4..e667fcf 100644 --- a/frontend/src/api/check/interface/index.ts +++ b/frontend/src/api/check/interface/index.ts @@ -102,6 +102,7 @@ export namespace CheckData { devVolt: number; //设备电压 devCurr: number; //设备电流 factorFlag: number; //是否支持系数校准 + checkResult:number; //检测结果 } // 用来描述检测脚本类型 diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index 5bc8fd8..3b8b82b 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -597,6 +597,14 @@ watch(webMsgSend, function (newValue, oldValue) { ts.value = 'error' step5.value = 'error' break; + case 'device_error': + ElMessageBox.alert('设备主动关闭连接!', '初始化失败', { + confirmButtonText: '确定', + type: 'error', + }) + ts.value = 'error' + step5.value = 'error' + break; } } }) diff --git a/frontend/src/views/home/components/selectTestItemPopup.vue b/frontend/src/views/home/components/selectTestItemPopup.vue index 0c6d69a..aadac2e 100644 --- a/frontend/src/views/home/components/selectTestItemPopup.vue +++ b/frontend/src/views/home/components/selectTestItemPopup.vue @@ -51,7 +51,8 @@ const open = async () => { // 清空表单内容 const resetFormContent = () => { - Object.assign(formContent, {preTest: true, channelsTest: false, timeTest: false, test: false}) + let hasResult = checkStore.devices.some((device) => device.checkResult === 0) + Object.assign(formContent, {preTest: !hasResult, channelsTest: false, timeTest: false, test: hasResult}) } const handleStart = () => { diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 796c333..5ee39c4 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -651,6 +651,7 @@ const handleSelectionChange = (selection: any[]) => { devVolt: item.devVolt, devCurr: item.devCurr, factorFlag: item.factorFlag, + checkResult: item.checkResult, } }) @@ -1022,23 +1023,25 @@ const handleTest = async (val: string) => { if(appSceneStore.currentScene === '0'){ writeTHPopupRef.value?.open() }else{ - openTestDialog(false) + openTestDialog() } }) .catch((action: Action) => { - ElMessage.success('全部复检') - checkStore.setReCheckType(1) - //openTestDialog(false) - if(appSceneStore.currentScene === '0'){ + if (action === 'cancel') { + ElMessage.success('全部复检') + checkStore.setReCheckType(1) + //openTestDialog(false) + if (appSceneStore.currentScene === '0') { writeTHPopupRef.value?.open() - }else{ - openTestDialog(false) + } else { + openTestDialog() } + } }) + checkStore.setSelectTestItems({preTest: false, timeTest: false, channelsTest: false, test: true}) } else { + openTestDialog() } - - } } if (val === '批量下载') { @@ -1081,14 +1084,12 @@ const handleTest = async (val: string) => { } } -const openTestDialog = (test:boolean) => { - console.log('openTestDialog',test) - if(dialogTitle.value === '手动检测' && appSceneStore.currentScene === '0' && test == true){ - writeTHPopupRef.value?.open() - }else{ +const openTestDialog = () => { + if (appSceneStore.currentScene === '0') { + writeTHPopupRef.value?.open() + } else { testPopup.value?.open(dialogTitle.value) } - } diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index ff40846..af485c5 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -13,63 +13,63 @@ :percentage="percentage" :color="customColors"/> - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + 检测项进度 @@ -145,7 +145,7 @@
- +

- - - - + + + +