This commit is contained in:
dong 2023-07-10 16:22:45 +08:00
commit 338d7132b3
3 changed files with 22 additions and 5 deletions

View File

@ -230,6 +230,12 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
SectionLink.Type SectionLink.Type
); );
const turnouts = app.queryStore.queryByType<Turnout>(Turnout.Type); const turnouts = app.queryStore.queryByType<Turnout>(Turnout.Type);
const disvisibleGraphics = [
...sections,
...turnouts,
...sectionLinks,
...axleCountingSections,
];
UndoOptions.handler = () => { UndoOptions.handler = () => {
app.opRecord.undo(); app.opRecord.undo();
}; };
@ -240,9 +246,17 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
app.selectAllGraphics(); app.selectAllGraphics();
}; };
linkOptions.handler = () => { linkOptions.handler = () => {
console.log(222); disvisibleGraphics.forEach((g) => {
g.visible = false;
});
sectionLinks.forEach((axleCountingSection) => {
axleCountingSection.visible = true;
});
}; };
axleCountingSectionOptions.handler = () => { axleCountingSectionOptions.handler = () => {
disvisibleGraphics.forEach((g) => {
g.visible = false;
});
axleCountingSections.forEach((axleCountingSection) => { axleCountingSections.forEach((axleCountingSection) => {
axleCountingSection.visible = true; axleCountingSection.visible = true;
}); });
@ -400,11 +414,17 @@ export async function loadDrawDatas(app: GraphicApp) {
} else { } else {
app.loadGraphic([]); app.loadGraphic([]);
} }
//隐藏计轴区段 //隐藏计轴区段--Link
const axleCountingSections = app.queryStore.queryByType<AxleCountingSection>( const axleCountingSections = app.queryStore.queryByType<AxleCountingSection>(
AxleCountingSection.Type AxleCountingSection.Type
); );
axleCountingSections.forEach((axleCountingSection) => { axleCountingSections.forEach((axleCountingSection) => {
axleCountingSection.visible = false; axleCountingSection.visible = false;
}); });
const sectionLinks = app.queryStore.queryByType<SectionLink>(
SectionLink.Type
);
sectionLinks.forEach((sectionLink) => {
sectionLink.visible = false;
});
} }

View File

@ -14,7 +14,6 @@ import {
IAxleCountingData, IAxleCountingData,
AxleCounting, AxleCounting,
AxleCountingTemplate, AxleCountingTemplate,
AxleCountingConsts,
} from './AxleCounting'; } from './AxleCounting';
import { Section, SectionPort, SectionType } from '../section/Section'; import { Section, SectionPort, SectionType } from '../section/Section';
import { Turnout, TurnoutPort } from '../turnout/Turnout'; import { Turnout, TurnoutPort } from '../turnout/Turnout';

View File

@ -1,7 +1,5 @@
import { FederatedPointerEvent, IHitArea, IPointData, Point } from 'pixi.js'; import { FederatedPointerEvent, IHitArea, IPointData, Point } from 'pixi.js';
import { import {
AbsorbableLine,
AbsorbablePosition,
GraphicDrawAssistant, GraphicDrawAssistant,
GraphicIdGenerator, GraphicIdGenerator,
GraphicInteractionPlugin, GraphicInteractionPlugin,