diff --git a/frontend/src/views/home/components/channelPairing.vue b/frontend/src/views/home/components/channelPairing.vue index 8934040..6d9275f 100644 --- a/frontend/src/views/home/components/channelPairing.vue +++ b/frontend/src/views/home/components/channelPairing.vue @@ -461,20 +461,10 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP - let conditionCount = 0; - let Key; - // 提前创建设备ID集合,优化查找性能 - const validDeviceIds = new Set(inspectionDevices.map(d => d.id)); - for (const { deviceId } of deviceChannelGroups) { - if (validDeviceIds.has(deviceId) && Key !== deviceId) { - conditionCount++; - Key = deviceId; - } - } // 添加被检设备 // let deviceCurrentYPosition = 50; // 与通道计算保持一致的初始位置 - let deviceCurrentYPosition = (vueFlowElement.value - 125 * conditionCount) / 2;; // 与通道计算保持一致的初始位置 + let deviceCurrentYPosition = (vueFlowElement.value - 60 * actualChannelsTotalLength) / 2; // 与通道计算保持一致的初始位置 let lastDeviceId = ''; // 记录上一个处理的设备ID deviceChannelGroups.forEach(({ deviceId, centerY }) => { @@ -513,20 +503,10 @@ const createNodes = (device: Device.ResPqDev[], standardDev: StandardDevice.ResP - let lastStandardDeviceKey = ''; - let channelCount = 0; - const validDeviceKey = new Set(standardDevices.map(d => d.id)); // 提前构建有效ID集合 - - standardChannelGroups.forEach(({ deviceId }) => { - if (validDeviceKey.has(deviceId) && lastStandardDeviceKey !== deviceId) { - channelCount++; - lastStandardDeviceKey = deviceId; - } - }); // 添加标准设备 // let standardDeviceCurrentYPosition = 50; // 与标准通道计算保持一致的初始位置 - let standardDeviceCurrentYPosition = (vueFlowElement.value - 125 * channelCount) / 2;; // 与标准通道计算保持一致的初始位置 + let standardDeviceCurrentYPosition = (vueFlowElement.value - 60 * totalCount) / 2; // 与标准通道计算保持一致的初始位置 let lastStandardDeviceId = ''; // 记录上一个处理的标准设备ID standardChannelGroups.forEach(({ deviceId, centerY }) => {