From 7dcd8cac177ed3d612ad7072c73bad846aff4093 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 21 Sep 2023 15:32:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=86=E9=80=89bugfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/line-net-store.ts | 5 +++-- src/stores/line-store.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/stores/line-net-store.ts b/src/stores/line-net-store.ts index 0585e5f..9f0e25d 100644 --- a/src/stores/line-net-store.ts +++ b/src/stores/line-net-store.ts @@ -5,6 +5,7 @@ import { getLineNetApp, destroyLineNetApp, } from 'src/drawApp/lineNetApp'; +import { markRaw } from 'vue'; export interface AlarmInfo { id: string; level: string; @@ -57,8 +58,8 @@ export const useLineNetStore = defineStore('lineNet', { }, initLineNetApp() { const app = initLineNetApp(); - app.on('graphicselected', () => { - this.selectedGraphics = app.selectedGraphics; + app.on('graphicselected', (graphics) => { + this.selectedGraphics = markRaw(graphics); }); this.selectedGraphics = []; return app; diff --git a/src/stores/line-store.ts b/src/stores/line-store.ts index 6940ed0..a58caa7 100644 --- a/src/stores/line-store.ts +++ b/src/stores/line-store.ts @@ -1,6 +1,7 @@ import { defineStore } from 'pinia'; import { IJlCanvas, JlGraphic, IGraphicApp } from 'src/jl-graphic'; import { initLineApp, getLineApp, destroyLineApp } from 'src/drawApp/lineApp'; +import { markRaw } from 'vue'; export const useLineStore = defineStore('line', { state: () => ({ @@ -39,8 +40,8 @@ export const useLineStore = defineStore('line', { initLineApp(lineId: number) { this.setLineId(lineId); const app = initLineApp(lineId); - app.on('graphicselectedchange', () => { - this.selectedGraphics = app.selectedGraphics; + app.on('graphicselected', (graphics) => { + this.selectedGraphics = markRaw(graphics); }); this.selectedGraphics = []; return app;