代码调整

This commit is contained in:
dong 2023-10-26 10:39:10 +08:00
parent 5ed5273438
commit cbaf4c4d1f

View File

@ -1,6 +1,10 @@
import * as pb_1 from 'google-protobuf'; import * as pb_1 from 'google-protobuf';
import { GraphicDataBase } from './GraphicDataBase'; import { GraphicDataBase } from './GraphicDataBase';
import { ISectionData, Section } from 'src/graphics/section/Section'; import {
ISectionData,
Section,
SectionType,
} from 'src/graphics/section/Section';
import { graphicData } from 'src/protos/stationLayoutGraphics'; import { graphicData } from 'src/protos/stationLayoutGraphics';
import { DisplayObject, FederatedMouseEvent, IPointData } from 'pixi.js'; import { DisplayObject, FederatedMouseEvent, IPointData } from 'pixi.js';
import { import {
@ -167,7 +171,7 @@ export class SectionOperateInteraction extends GraphicInteractionPlugin<Section>
onContextMenu(e: FederatedMouseEvent) { onContextMenu(e: FederatedMouseEvent) {
const target = e.target as DisplayObject; const target = e.target as DisplayObject;
const section = target.getGraphic<Section>(); const section = target.getGraphic<Section>();
if (!section) return; if (!section || section.datas.sectionType != SectionType.Physical) return;
this.app.updateSelected(section); this.app.updateSelected(section);
const simulationId = useLineStore().simulationId || ''; const simulationId = useLineStore().simulationId || '';
const mapId = useLineStore().mapId as number; const mapId = useLineStore().mapId as number;