修改生成link报错问题

This commit is contained in:
dong 2023-09-14 17:14:59 +08:00
parent d6e8d8a7e8
commit 87d276c73d

View File

@ -184,14 +184,14 @@ export async function loadLinkDatas(app: IDrawApp) {
length: link.length, length: link.length,
index: link.index, index: link.index,
aRelatedRef: new graphicData.RelatedRef({ aRelatedRef: new graphicData.RelatedRef({
id: link.aRelatedRef.id, id: link.aRelatedRef?.id,
deviceType: link.aRelatedRef.deviceType, deviceType: link.aRelatedRef?.deviceType,
devicePort: link.aRelatedRef.devicePort || 0, devicePort: link.aRelatedRef?.devicePort || 0,
}), }),
bRelatedRef: new graphicData.RelatedRef({ bRelatedRef: new graphicData.RelatedRef({
id: link.bRelatedRef.id, id: link.bRelatedRef?.id,
deviceType: link.bRelatedRef.deviceType, deviceType: link.bRelatedRef?.deviceType,
devicePort: link.bRelatedRef.devicePort || 0, devicePort: link.bRelatedRef?.devicePort || 0,
}), }),
devicePositions: ((): graphicData.CalculateLink.DevicePosition[] => { devicePositions: ((): graphicData.CalculateLink.DevicePosition[] => {
const dps: graphicData.CalculateLink.DevicePosition[] = []; const dps: graphicData.CalculateLink.DevicePosition[] = [];