From f3ee285bc3d4989adca6333fc39ee4e1dc93e57a Mon Sep 17 00:00:00 2001 From: Yuan Date: Fri, 30 Jun 2023 17:04:57 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20-=20=E5=85=B3=E8=81=94=E5=85=B3?= =?UTF-8?q?=E7=B3=BB=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/section/Section.ts | 12 ++++++++---- src/graphics/turnout/Turnout.ts | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/graphics/section/Section.ts b/src/graphics/section/Section.ts index 560dd70..bed4013 100644 --- a/src/graphics/section/Section.ts +++ b/src/graphics/section/Section.ts @@ -34,10 +34,10 @@ export interface ISectionData extends GraphicData { set code(v: string); get points(): IPointData[]; // 线坐标点 set points(points: IPointData[]); - get paRef(): IRelatedRefData; - set paRef(ref: IRelatedRefData); - get pbRef(): IRelatedRefData; - set pbRef(ref: IRelatedRefData); + get paRef(): IRelatedRefData | undefined; + set paRef(ref: IRelatedRefData | undefined); + get pbRef(): IRelatedRefData | undefined; + set pbRef(ref: IRelatedRefData | undefined); get sectionType(): SectionType; set sectionType(type: SectionType); get children(): string[]; @@ -204,6 +204,8 @@ export class Section extends JlGraphic implements ILineGraphic { paDevice.id, paRelation?.getOtherRelationParam(this).param ); + } else { + delete this.datas.paRef; } const pbRelation = this.relationManage .getRelationsOfGraphic(this) @@ -217,6 +219,8 @@ export class Section extends JlGraphic implements ILineGraphic { pbDevice.id, pbRelation?.getOtherRelationParam(this).param ); + } else { + delete this.datas.pbRef; } } diff --git a/src/graphics/turnout/Turnout.ts b/src/graphics/turnout/Turnout.ts index 0269623..745acf8 100644 --- a/src/graphics/turnout/Turnout.ts +++ b/src/graphics/turnout/Turnout.ts @@ -27,12 +27,12 @@ export interface ITurnoutData extends GraphicData { set pointB(point: IPointData[]); get pointC(): IPointData[]; set pointC(point: IPointData[]); - get paRef(): IRelatedRefData; - set paRef(ref: IRelatedRefData); - get pbRef(): IRelatedRefData; - set pbRef(ref: IRelatedRefData); - get pcRef(): IRelatedRefData; - set pcRef(ref: IRelatedRefData); + get paRef(): IRelatedRefData | undefined; + set paRef(ref: IRelatedRefData | undefined); + get pbRef(): IRelatedRefData | undefined; + set pbRef(ref: IRelatedRefData | undefined); + get pcRef(): IRelatedRefData | undefined; + set pcRef(ref: IRelatedRefData | undefined); get kilometerSystem(): KilometerSystem[]; set kilometerSystem(v: KilometerSystem[]); clone(): ITurnoutData; @@ -268,6 +268,8 @@ export class Turnout extends JlGraphic { paDevice.id, paRelation?.getOtherRelationParam(this).param ); + } else { + delete this.datas.paRef; } const pbRelation = this.relationManage .getRelationsOfGraphic(this) @@ -281,6 +283,8 @@ export class Turnout extends JlGraphic { pbDevice.id, pbRelation?.getOtherRelationParam(this).param ); + } else { + delete this.datas.pbRef; } const pcRelation = this.relationManage .getRelationsOfGraphic(this) @@ -294,6 +298,8 @@ export class Turnout extends JlGraphic { pcDevice.id, pcRelation?.getOtherRelationParam(this).param ); + } else { + delete this.datas.pcRef; } }