From c78f591bafc71ec1969d85af7744c78733617b66 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Fri, 12 Sep 2025 13:35:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=95=B0=E6=8D=AE=E8=BF=87?= =?UTF-8?q?=E4=BA=86=E5=BD=95=E6=B3=A2=E7=8A=B6=E6=80=81=E5=A4=84=E7=90=86?= =?UTF-8?q?=E5=92=8C=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/home/components/compareTest.vue | 24 ++++++++++++++++++- .../plan/planList/components/planPopup.vue | 4 +++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/home/components/compareTest.vue b/frontend/src/views/home/components/compareTest.vue index 769bf72..fbfd49c 100644 --- a/frontend/src/views/home/components/compareTest.vue +++ b/frontend/src/views/home/components/compareTest.vue @@ -349,6 +349,7 @@ watch( // 触发响应式更新 checkResult.splice(0, 0) stopTimeCount() + updatePercentage() break } } @@ -439,6 +440,7 @@ watch( case 25005: { let result: CheckData.ScriptChnItem[] = [] + let message = JSON.parse(newValue.data) // 当收到 25005 消息时,录波项目开始loading if (newValue.code == 25005) { @@ -459,6 +461,7 @@ watch( scriptName: item.scriptName, devices: [] } + // 特殊处理录波项目 - 如果是25005消息且当前项目是录波项目,则使用已设置的状态 if (newValue.code == 25005 && item.code === 'wave_data') { const existingWaveItem = checkResult.find(checkItem => checkItem.scriptType === 'wave_data') @@ -474,9 +477,28 @@ watch( deviceName: msg.deviceName, chnResult: msg.chnResult })) - + // 添加匹配到的设备 temp.devices.push(...matchedDevices) + + // 对于未匹配到的设备,也要添加占位符(特别是录波项目) + if (item.code === 'wave_data') { + deviceList.forEach(device => { + const isDeviceExist = matchedDevices.some((matchedDevice: any) => matchedDevice.deviceId === device.deviceId) + if (!isDeviceExist) { + // 对于录波项目或未匹配到的设备,添加默认状态 + temp.devices.push({ + deviceId: device.deviceId, + deviceName: device.deviceName, + chnResult: new Array(checkStore.chnNumList.length).fill( + item.code === 'wave_data' ? + CheckData.ChnCheckResultEnum.UNKNOWN : + CheckData.ChnCheckResultEnum.UNKNOWN + ) + }) + } + }) + } } result.push(temp) }) diff --git a/frontend/src/views/plan/planList/components/planPopup.vue b/frontend/src/views/plan/planList/components/planPopup.vue index 5fe5093..eb5e700 100644 --- a/frontend/src/views/plan/planList/components/planPopup.vue +++ b/frontend/src/views/plan/planList/components/planPopup.vue @@ -98,10 +98,12 @@ :key="item.id" :label="item.name" :value="item.code || ''" - :disabled="(selectByMode && planType == 0) || allDisabled" + :disabled="(selectByMode && planType == 0) || allDisabled"> + /> +