diff --git a/src/components/rangeConfig.vue b/src/components/rangeConfigApp/RangeConfig.vue similarity index 90% rename from src/components/rangeConfig.vue rename to src/components/rangeConfigApp/RangeConfig.vue index dbf651a..01a351b 100644 --- a/src/components/rangeConfig.vue +++ b/src/components/rangeConfigApp/RangeConfig.vue @@ -1,5 +1,5 @@ diff --git a/src/layouts/RangeConfigLayout.vue b/src/layouts/RangeConfigLayout.vue new file mode 100644 index 0000000..1d0ef67 --- /dev/null +++ b/src/layouts/RangeConfigLayout.vue @@ -0,0 +1,74 @@ + + + diff --git a/src/pages/PublishManage.vue b/src/pages/PublishManage.vue index 06c38c5..af92d1a 100644 --- a/src/pages/PublishManage.vue +++ b/src/pages/PublishManage.vue @@ -30,9 +30,15 @@ + import('layouts/LineLayout.vue'), }, + { + path: '/rangeConfig/:id', + name: 'rangeConfig', + component: () => import('layouts/RangeConfigLayout.vue'), + }, // { // path: '/line/monitor/:lineId', // name: 'linemonitor', diff --git a/src/stores/range-config-store.ts b/src/stores/range-config-store.ts new file mode 100644 index 0000000..b632774 --- /dev/null +++ b/src/stores/range-config-store.ts @@ -0,0 +1,27 @@ +import { defineStore } from 'pinia'; +import { initRangeConfigApp } from 'src/drawApp/rangeConfigApp'; +import { JlGraphic } from 'src/jl-graphic'; + +export const useRangeConfigStore = defineStore('rangeConfig', { + state: () => ({ + lineName: '', + lineId: NaN, + selectedGraphics: [] as JlGraphic[], + }), + actions: { + initRangeConfigApp(dom: HTMLElement) { + const app = initRangeConfigApp(dom); + app.on('graphicselectedchange', () => { + this.selectedGraphics = app.selectedGraphics; + }); + this.selectedGraphics = []; + return app; + }, + setLineId(id: number) { + this.lineId = id; + }, + setLineName(name: string) { + this.lineName = name; + }, + }, +});