一键关联集中站可以不画左右边界

This commit is contained in:
joylink_zhaoerwei 2023-12-05 13:18:11 +08:00
parent d58fb4efab
commit 3e5dd10165

View File

@ -634,13 +634,14 @@ function oneClickRelateCentralizedStation() {
.queryByType<ConcentrationDividingLine>(ConcentrationDividingLine.Type) .queryByType<ConcentrationDividingLine>(ConcentrationDividingLine.Type)
.sort((a, b) => a.datas.points[0].x - b.datas.points[0].x); .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[] = []; let containDeviceIds: string[] = [];
const leftSections: { const leftSections: {
section: Section; section: Section;
port: graphicData.RelatedRef.DevicePort; port: graphicData.RelatedRef.DevicePort;
}[] = []; }[] = [];
concentrationDividingLines[0].datas.nodeConWithSecs.forEach((node) => { leftBoundary.datas.nodeConWithSecs.forEach((node) => {
if (node.leftSection.id !== '') { if (node.leftSection.id !== '') {
leftSections.push({ leftSections.push({
section: drawApp.queryStore.queryById(node.leftSection.id), section: drawApp.queryStore.queryById(node.leftSection.id),
@ -659,7 +660,38 @@ function oneClickRelateCentralizedStation() {
containDeviceIds = Array.from(new Set(containDeviceIds)); containDeviceIds = Array.from(new Set(containDeviceIds));
}); });
handleContainDevices(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++) { for (let i = 0; i < concentrationDividingLines.length - 1; i++) {