diff --git a/src/layouts/DrawLayout.vue b/src/layouts/DrawLayout.vue index 41ef9fd..feec5a4 100644 --- a/src/layouts/DrawLayout.vue +++ b/src/layouts/DrawLayout.vue @@ -686,7 +686,7 @@ function oneClickRelateCentralizedStation() { port: graphicData.RelatedRef.DevicePort; }[] = []; rightDatas.nodeConWithSecs.forEach((node) => { - if (node.rightSection.id) { + if (node.rightSection && node.rightSection.id) { rightSections.push({ section: drawApp.queryStore.queryById(node.rightSection.id), port: node.rightSection.devicePort, @@ -699,7 +699,7 @@ function oneClickRelateCentralizedStation() { const LeftDatas = concentrationDividingLines[j].datas; if (LeftDatas.refLeftStationId == rightDatas.refRightStationId) { LeftDatas.nodeConWithSecs.forEach((node) => { - if (node.leftSection.id) { + if (node.leftSection && node.leftSection.id) { leftSections.push(node.leftSection.id); } }); @@ -767,18 +767,20 @@ function oneClickRelateCentralizedStation() { concentrationDividingLines.forEach((concentrationDividingLine) => { concentrationDividingLine.datas.nodeConWithSecs.forEach( (nodeConWithSec) => { - const ids = [ - nodeConWithSec.leftSection.id, - nodeConWithSec.rightSection.id, - ]; - if (ids[0] && ids[1]) { - if ( - nodeConWithSec.leftSection.deviceType == - graphicData.RelatedRef.DeviceType.Section - ) { - handleNodeConWithSec(nodeConWithSec.leftSection, ids); - } else { - handleNodeConWithSec(nodeConWithSec.rightSection, ids); + if (nodeConWithSec.leftSection && nodeConWithSec.rightSection) { + const ids = [ + nodeConWithSec.leftSection.id, + nodeConWithSec.rightSection.id, + ]; + if (ids[0] && ids[1]) { + if ( + nodeConWithSec.leftSection.deviceType == + graphicData.RelatedRef.DeviceType.Section + ) { + handleNodeConWithSec(nodeConWithSec.leftSection, ids); + } else { + handleNodeConWithSec(nodeConWithSec.rightSection, ids); + } } } } @@ -892,7 +894,7 @@ function oneClickRelateCentralizedStation() { port: graphicData.RelatedRef.DevicePort; }[] = []; leftBoundary.datas.nodeConWithSecs.forEach((node) => { - if (node.leftSection.id) { + if (node.leftSection && node.leftSection.id) { leftSections.push({ section: drawApp.queryStore.queryById(node.leftSection.id), port: node.leftSection.devicePort, @@ -924,7 +926,7 @@ function oneClickRelateCentralizedStation() { port: graphicData.RelatedRef.DevicePort; }[] = []; rightBoundary.datas.nodeConWithSecs.forEach((node) => { - if (node.rightSection.id) { + if (node.rightSection && node.rightSection.id) { rightSections.push({ section: drawApp.queryStore.queryById(node.rightSection.id), port: node.rightSection.devicePort,