车次窗bug修复
This commit is contained in:
parent
8b46178f57
commit
932409e700
@ -59,6 +59,7 @@ export class TrainWindow extends JlGraphic {
|
|||||||
}
|
}
|
||||||
loadRealtions(): void {
|
loadRealtions(): void {
|
||||||
const sectionId = this.datas.sectionId;
|
const sectionId = this.datas.sectionId;
|
||||||
|
if (sectionId) {
|
||||||
const section = this.queryStore.queryById<Section>(sectionId);
|
const section = this.queryStore.queryById<Section>(sectionId);
|
||||||
if (section) {
|
if (section) {
|
||||||
this.relationManage.addRelation(
|
this.relationManage.addRelation(
|
||||||
@ -67,6 +68,7 @@ export class TrainWindow extends JlGraphic {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
getRelatedSections(): Section[] {
|
getRelatedSections(): Section[] {
|
||||||
return this.queryRelationByType('Section').map((rl) =>
|
return this.queryRelationByType('Section').map((rl) =>
|
||||||
rl.getOtherGraphic<Section>(this)
|
rl.getOtherGraphic<Section>(this)
|
||||||
|
@ -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