diff --git a/src/drawApp/index.ts b/src/drawApp/index.ts index baebc11..1f379a9 100644 --- a/src/drawApp/index.ts +++ b/src/drawApp/index.ts @@ -230,6 +230,12 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { SectionLink.Type ); const turnouts = app.queryStore.queryByType(Turnout.Type); + const disvisibleGraphics = [ + ...sections, + ...turnouts, + ...sectionLinks, + ...axleCountingSections, + ]; UndoOptions.handler = () => { app.opRecord.undo(); }; @@ -240,9 +246,17 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp { app.selectAllGraphics(); }; linkOptions.handler = () => { - console.log(222); + disvisibleGraphics.forEach((g) => { + g.visible = false; + }); + sectionLinks.forEach((axleCountingSection) => { + axleCountingSection.visible = true; + }); }; axleCountingSectionOptions.handler = () => { + disvisibleGraphics.forEach((g) => { + g.visible = false; + }); axleCountingSections.forEach((axleCountingSection) => { axleCountingSection.visible = true; }); @@ -400,11 +414,17 @@ export async function loadDrawDatas(app: GraphicApp) { } else { app.loadGraphic([]); } - //隐藏计轴区段 + //隐藏计轴区段--Link const axleCountingSections = app.queryStore.queryByType( AxleCountingSection.Type ); axleCountingSections.forEach((axleCountingSection) => { axleCountingSection.visible = false; }); + const sectionLinks = app.queryStore.queryByType( + SectionLink.Type + ); + sectionLinks.forEach((sectionLink) => { + sectionLink.visible = false; + }); } diff --git a/src/graphics/axleCounting/AxleCountingDrawAssistant.ts b/src/graphics/axleCounting/AxleCountingDrawAssistant.ts index 3c62ab5..85ec97b 100644 --- a/src/graphics/axleCounting/AxleCountingDrawAssistant.ts +++ b/src/graphics/axleCounting/AxleCountingDrawAssistant.ts @@ -14,7 +14,6 @@ import { IAxleCountingData, AxleCounting, AxleCountingTemplate, - AxleCountingConsts, } from './AxleCounting'; import { Section, SectionPort, SectionType } from '../section/Section'; import { Turnout, TurnoutPort } from '../turnout/Turnout'; diff --git a/src/graphics/axleCountingSection/AxleCountingSectionAssistant.ts b/src/graphics/axleCountingSection/AxleCountingSectionAssistant.ts index f48b4ea..4246bf5 100644 --- a/src/graphics/axleCountingSection/AxleCountingSectionAssistant.ts +++ b/src/graphics/axleCountingSection/AxleCountingSectionAssistant.ts @@ -1,7 +1,5 @@ import { FederatedPointerEvent, IHitArea, IPointData, Point } from 'pixi.js'; import { - AbsorbableLine, - AbsorbablePosition, GraphicDrawAssistant, GraphicIdGenerator, GraphicInteractionPlugin,