一键关联集中站可以不画左右边界
This commit is contained in:
parent
d58fb4efab
commit
3e5dd10165
@ -634,13 +634,14 @@ function oneClickRelateCentralizedStation() {
|
||||
.queryByType<ConcentrationDividingLine>(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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user