删除运行线同步移除轨迹线调整
This commit is contained in:
parent
f621cbefd2
commit
00c666b876
@ -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> {
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user