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
);
const turnouts = app.queryStore.queryByType<Turnout>(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>(
AxleCountingSection.Type
);
axleCountingSections.forEach((axleCountingSection) => {
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,
AxleCounting,
AxleCountingTemplate,
AxleCountingConsts,
} from './AxleCounting';
import { Section, SectionPort, SectionType } from '../section/Section';
import { Turnout, TurnoutPort } from '../turnout/Turnout';

View File

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