切换场景,右键bug修复

This commit is contained in:
joylink_zhaoerwei 2023-10-09 13:08:29 +08:00
parent decd348c04
commit 5cf29df992
2 changed files with 4 additions and 2 deletions

View File

@ -92,8 +92,8 @@ export class RelayState extends GraphicStateBase implements IRelayState {
const setOpen: MenuItemOptions = { name: '驱动落下' };
const setClose: MenuItemOptions = { name: '驱动吸起' };
const RelayOperationMenu: ContextMenu = ContextMenu.init({
name: 'Turnout操作',
export const RelayOperationMenu: ContextMenu = ContextMenu.init({
name: 'Relay操作',
groups: [{ items: [setOpen, setClose] }],
});

View File

@ -59,6 +59,7 @@ import { ApiError } from 'src/boot/axios';
import { layerList } from 'src/drawApp/lineScene';
import { IGraphicScene } from 'src/jl-graphic';
import { ISceneName, getSceneName } from 'src/drawApp/lineApp';
import { RelayOperationMenu } from 'src/drawApp/relayCabinetGraphics/RelayInteraction';
const $q = useQuasar();
const canvasWidth = ref(0);
@ -191,6 +192,7 @@ function switchScene(val: MapInfo) {
sceneName = getSceneNameFn(val);
lineStore.setSceneName(sceneName);
scene = lineApp.getScene(sceneName);
scene.registerMenu(RelayOperationMenu);
const dom = document.getElementById('line-app-container');
if (dom) {
scene.bindDom(dom);