删除运行线同步移除轨迹线调整

This commit is contained in:
fan 2023-06-13 16:10:21 +08:00
parent f621cbefd2
commit 00c666b876
2 changed files with 19 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import {
import { RunLineName } from './RunLineName';
import { PathLine } from '../pathLine/PathLine';
import { PathLineDraw } from '../pathLine/PathLineDrawAssistant';
import { getDrawApp } from 'src/drawApp';
export interface IRunLineData extends GraphicData {
get code(): string;
@ -123,6 +124,23 @@ export class RunLine extends JlGraphic {
getEndPoint(): IPointData {
return this.datas.points[this.datas.points.length - 1];
}
onDelete(): void {
super.onDelete();
const app = getDrawApp();
if (!app) return;
if (this.datas.upPathLineId) {
const oldUp = app.queryStore.queryById(this.datas.upPathLineId);
if (oldUp) {
app.deleteGraphics(oldUp);
}
}
if (this.datas.downPathLineId) {
const oldDown = app.queryStore.queryById(this.datas.downPathLineId);
if (oldDown) {
app.deleteGraphics(oldDown);
}
}
}
}
export class RunLineTemplate extends JlGraphicTemplate<RunLine> {

View File

@ -27,7 +27,7 @@ export class StationLineDraw extends GraphicDrawAssistant<
app,
new StationLineTemplate(),
createData,
'svguse:/drawIcon.svg#icon-station',
'svguse: ../../drawIcon.svg#icon-station',
'车站StationLine'
);
this.codeGraph = this.graphicTemplate.new();