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" >