框架代码同步后菜单调整

This commit is contained in:
fan 2023-07-21 16:03:55 +08:00
parent 26bdaa0e0a
commit 66ca2e9687
3 changed files with 36 additions and 20 deletions

View File

@ -127,20 +127,33 @@ const axleCountingSectionOptions: MenuItemOptions = {
const LogicSectionOptions: MenuItemOptions = { const LogicSectionOptions: MenuItemOptions = {
name: '图层-逻辑区段', name: '图层-逻辑区段',
}; };
// [
// {
// name: '图层菜单',
// items: [
// AllOptions,
// linkOptions,
// axleCountingSectionOptions,
// LogicSectionOptions,
// ],
// },
// ]
const layerOptions: MenuItemOptions = { const layerOptions: MenuItemOptions = {
name: '图层', name: '图层',
subMenu: [ subMenu: {
{ name: '图层菜单',
name: '图层菜单', groups: [
items: [ {
AllOptions, name: '图层菜单',
linkOptions, items: [
axleCountingSectionOptions, AllOptions,
LogicSectionOptions, linkOptions,
], axleCountingSectionOptions,
}, LogicSectionOptions,
], ],
},
],
},
}; };
export const DefaultCanvasMenu = new ContextMenu({ export const DefaultCanvasMenu = new ContextMenu({

View File

@ -93,12 +93,15 @@ const linkOptions: MenuItemOptions = {
const layerOptions: MenuItemOptions = { const layerOptions: MenuItemOptions = {
name: '图层', name: '图层',
subMenu: [ subMenu: {
{ name: '图层菜单',
name: '图层菜单', groups: [
items: [PhysicsOptions, linkOptions], {
}, name: '图层菜单',
], items: [PhysicsOptions, linkOptions],
},
],
},
}; };
const DefaultCanvasMenu = new ContextMenu({ const DefaultCanvasMenu = new ContextMenu({
name: '图层选择', name: '图层选择',

View File

@ -28,7 +28,7 @@
import { onMounted, ref, computed, onUnmounted, watch } from 'vue'; import { onMounted, ref, computed, onUnmounted, watch } from 'vue';
import { useLineStore } from 'src/stores/line-store'; import { useLineStore } from 'src/stores/line-store';
import { useRoute, useRouter } from 'vue-router'; import { useRoute, useRouter } from 'vue-router';
import { loadLineDatas, getLineApp, destroyLineApp } from 'src/drawApp/lineApp'; import { loadLineDatas, getLineApp } from 'src/drawApp/lineApp';
import { destroySimulation } from 'src/api/Simulation'; import { destroySimulation } from 'src/api/Simulation';
import TrainPage from 'src/pages/TrainPage.vue'; import TrainPage from 'src/pages/TrainPage.vue';
import { Train } from 'src/graphics/train/Train'; import { Train } from 'src/graphics/train/Train';
@ -86,7 +86,7 @@ onMounted(() => {
onUnmounted(() => { onUnmounted(() => {
if (simulationId) { if (simulationId) {
lineStore.setSimulationId(null); lineStore.setSimulationId(null);
destroyLineApp(); lineStore.destroy();
destroySimulation({ simulationId }); destroySimulation({ simulationId });
} }
}); });