框选bugfix

This commit is contained in:
joylink_zhaoerwei 2023-09-21 15:32:29 +08:00
parent 01f2e9cccf
commit 7dcd8cac17
2 changed files with 6 additions and 4 deletions

View File

@ -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;

View File

@ -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;