车次窗bug修复
This commit is contained in:
parent
8b46178f57
commit
932409e700
@ -59,12 +59,14 @@ export class TrainWindow extends JlGraphic {
|
|||||||
}
|
}
|
||||||
loadRealtions(): void {
|
loadRealtions(): void {
|
||||||
const sectionId = this.datas.sectionId;
|
const sectionId = this.datas.sectionId;
|
||||||
const section = this.queryStore.queryById<Section>(sectionId);
|
if (sectionId) {
|
||||||
if (section) {
|
const section = this.queryStore.queryById<Section>(sectionId);
|
||||||
this.relationManage.addRelation(
|
if (section) {
|
||||||
this,
|
this.relationManage.addRelation(
|
||||||
new GraphicRelationParam(section, section.datas.id)
|
this,
|
||||||
);
|
new GraphicRelationParam(section, section.datas.id)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getRelatedSections(): Section[] {
|
getRelatedSections(): Section[] {
|
||||||
|
@ -171,7 +171,6 @@ function buildAbsorbablePositions(
|
|||||||
|
|
||||||
export class TrainWindowInteraction extends GraphicInteractionPlugin<TrainWindow> {
|
export class TrainWindowInteraction extends GraphicInteractionPlugin<TrainWindow> {
|
||||||
static Name = 'TrainWindow_transform';
|
static Name = 'TrainWindow_transform';
|
||||||
static trainWindow: TrainWindow;
|
|
||||||
constructor(app: JlDrawApp) {
|
constructor(app: JlDrawApp) {
|
||||||
super(TrainWindowInteraction.Name, app);
|
super(TrainWindowInteraction.Name, app);
|
||||||
}
|
}
|
||||||
@ -184,7 +183,6 @@ export class TrainWindowInteraction extends GraphicInteractionPlugin<TrainWindow
|
|||||||
.map((g) => g as TrainWindow);
|
.map((g) => g as TrainWindow);
|
||||||
}
|
}
|
||||||
bind(g: TrainWindow): void {
|
bind(g: TrainWindow): void {
|
||||||
TrainWindowInteraction.trainWindow = g;
|
|
||||||
g.eventMode = 'static';
|
g.eventMode = 'static';
|
||||||
g.cursor = 'pointer';
|
g.cursor = 'pointer';
|
||||||
g.scalable = true;
|
g.scalable = true;
|
||||||
@ -199,10 +197,9 @@ export class TrainWindowInteraction extends GraphicInteractionPlugin<TrainWindow
|
|||||||
g.off('selected', this.onSelected, this);
|
g.off('selected', this.onSelected, this);
|
||||||
}
|
}
|
||||||
onSelected(): void {
|
onSelected(): void {
|
||||||
|
const trainWindow = this.app.selectedGraphics[0] as TrainWindow;
|
||||||
this.app.setOptions({
|
this.app.setOptions({
|
||||||
absorbablePositions: buildAbsorbablePositions(
|
absorbablePositions: buildAbsorbablePositions(trainWindow),
|
||||||
TrainWindowInteraction.trainWindow
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user