From 3bf6e09acb5a97f2861c14f49715efd2f98d4d4e Mon Sep 17 00:00:00 2001 From: fan Date: Fri, 20 Oct 2023 16:04:27 +0800 Subject: [PATCH] =?UTF-8?q?psl=E6=8C=89=E9=92=AE=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=B0=83=E7=94=A8=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/psl-store.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/stores/psl-store.ts b/src/stores/psl-store.ts index e8d3a57..aee55e8 100644 --- a/src/stores/psl-store.ts +++ b/src/stores/psl-store.ts @@ -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;