From 44cdb3273c4e6722a51d58cf1f896f5288a8b4ab Mon Sep 17 00:00:00 2001 From: guanj Date: Mon, 22 Sep 2025 15:37:28 +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 --- .../views/home/components/channelPairing.vue | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) 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 }) => {