From 64c05b629c3dfa74fbc9e8b145b0d8a8a4c19b08 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Wed, 26 Nov 2025 15:06:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=A4=9A=E5=8F=B0=E8=A2=AB?= =?UTF-8?q?=E6=A3=80=E8=AE=BE=E5=A4=87=E5=90=8C=E6=97=B6=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=EF=BC=8C=E9=80=9A=E9=81=93=E6=B7=B7=E4=B9=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/home/components/channelPairing.vue | 29 +++++++++++++++++-- .../src/views/home/components/compareTest.vue | 5 ++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/home/components/channelPairing.vue b/frontend/src/views/home/components/channelPairing.vue index f43c904..aa2275e 100644 --- a/frontend/src/views/home/components/channelPairing.vue +++ b/frontend/src/views/home/components/channelPairing.vue @@ -37,6 +37,7 @@ import { jwtUtil } from '@/utils/jwtUtil' import { useCheckStore } from '@/stores/modules/check' import { ipc } from '@/utils/ipcRenderer' import { fa, tr } from 'element-plus/es/locale' +import { CheckData } from '@/api/check/interface' const vueFlowElement = ref(442) const checkStore = useCheckStore() const dialogVisible = ref(false) @@ -427,7 +428,7 @@ const standardDevIds = ref() const open = async () => { edges.value = [] - devIds.value = prop.devIdList.map(d => d.id) + //devIds.value = prop.devIdList.map(d => d.id) standardDevIds.value = prop.pqStandardDevList.map(d => d.id) planId.value = prop.planIdKey nodes.value = createNodes(prop.devIdList, prop.pqStandardDevList, prop.deviceMonitor) @@ -447,11 +448,33 @@ const handleNext = async () => { let chnNumList: string[] = [] await edges.value.forEach(edge => { const match = edge.source.split('-') - if (match) { - chnNumList.push(match[2]) + chnNumList.push(match[1] + '-'+ match[2]) } }) + + const connectedDeviceIds = [...new Set(chnNumList.map(item => item.split('-')[0]))] + devIds.value = connectedDeviceIds + //可能存在勾选的被检设备未连线的情况,需要过滤掉 + let devices: CheckData.Device[] = prop.devIdList + .filter((item: any) => connectedDeviceIds.includes(item.id)) + .map((item: any) => { + return { + deviceId: item.id, + deviceName: item.name, + chnNum: item.devChns, + planId: item.planId, + deviceType: item.devType, + devVolt: item.devVolt, + devCurr: item.devCurr, + factorFlag: item.factorFlag, + checkResult: item.checkResult + } + }) + checkStore.clearDevices() + checkStore.addDevices(devices) + + const connections = edges.value.reduce( (map, edge) => { // 从source中提取设备ID和通道号: 被检通道-{deviceId}-{channelNum} => {deviceId}-{channelNum} diff --git a/frontend/src/views/home/components/compareTest.vue b/frontend/src/views/home/components/compareTest.vue index f027830..23d4f36 100644 --- a/frontend/src/views/home/components/compareTest.vue +++ b/frontend/src/views/home/components/compareTest.vue @@ -37,9 +37,9 @@ align="center" >