psl按钮接口重复调用调整

This commit is contained in:
fan 2023-10-20 16:04:27 +08:00
parent 62544cdafb
commit 3bf6e09acb

View File

@ -1,6 +1,7 @@
import { defineStore } from 'pinia';
import { initPslScene } from 'src/drawApp/pslScene';
import { getLineApp } from 'src/drawApp/lineApp';
import { GraphicApp } from 'src/jl-graphic/app/JlGraphicApp';
export const usePslStore = defineStore('psl', {
state: () => ({
@ -10,10 +11,12 @@ export const usePslStore = defineStore('psl', {
}),
actions: {
getPslScene() {
const lineApp = getLineApp();
const lineApp = getLineApp() as GraphicApp;
if (!lineApp) return;
const pslScene = initPslScene(lineApp, 'psl');
return pslScene;
if (lineApp.scenes.get('psl')) {
return lineApp.getScene('psl');
}
return initPslScene(lineApp, 'psl');
},
setPslParam(gatedBoxId: string, pslMapCode: string) {
this.gatedBoxId = gatedBoxId;