From 3e5dd101658dc8a22eadd3c6f0bfd430e0f5f4a7 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 5 Dec 2023 13:18:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=85=B3=E8=81=94=E9=9B=86?= =?UTF-8?q?=E4=B8=AD=E7=AB=99=E5=8F=AF=E4=BB=A5=E4=B8=8D=E7=94=BB=E5=B7=A6?= =?UTF-8?q?=E5=8F=B3=E8=BE=B9=E7=95=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/DrawLayout.vue | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue index c2b2bcd..4e867b6 100644 --- a/src/layouts/DrawLayout.vue +++ b/src/layouts/DrawLayout.vue @@ -634,13 +634,14 @@ function oneClickRelateCentralizedStation() { .queryByType(ConcentrationDividingLine.Type) .sort((a, b) => a.datas.points[0].x - b.datas.points[0].x); //需要考虑是否绘制左边界 - if (concentrationDividingLines[0].datas.refLeftStationId) { + const leftBoundary = concentrationDividingLines[0]; + if (leftBoundary.datas.refLeftStationId) { let containDeviceIds: string[] = []; const leftSections: { section: Section; port: graphicData.RelatedRef.DevicePort; }[] = []; - concentrationDividingLines[0].datas.nodeConWithSecs.forEach((node) => { + leftBoundary.datas.nodeConWithSecs.forEach((node) => { if (node.leftSection.id !== '') { leftSections.push({ section: drawApp.queryStore.queryById(node.leftSection.id), @@ -659,7 +660,38 @@ function oneClickRelateCentralizedStation() { containDeviceIds = Array.from(new Set(containDeviceIds)); }); handleContainDevices(containDeviceIds, [ - concentrationDividingLines[0].datas.refLeftStationId, + leftBoundary.datas.refLeftStationId, + ]); + } + //需要考虑是否绘制右边界 + const rightBoundary = + concentrationDividingLines[concentrationDividingLines.length - 1]; + if (rightBoundary.datas.refRightStationId) { + let containDeviceIds: string[] = []; + const rightSections: { + section: Section; + port: graphicData.RelatedRef.DevicePort; + }[] = []; + rightBoundary.datas.nodeConWithSecs.forEach((node) => { + if (node.rightSection.id !== '') { + rightSections.push({ + section: drawApp.queryStore.queryById(node.rightSection.id), + port: node.rightSection.devicePort, + }); + } + }); + containDeviceIds = [...rightSections.map((g) => g.section.id)]; + rightSections.forEach((rightSections) => { + findContainDevice( + rightSections.section, + rightSections.port, + containDeviceIds, + drawApp + ); + containDeviceIds = Array.from(new Set(containDeviceIds)); + }); + handleContainDevices(containDeviceIds, [ + rightBoundary.datas.refRightStationId, ]); } for (let i = 0; i < concentrationDividingLines.length - 1; i++) {