From fa0045dec30afff824b1efdafeb437a7b4f21c7e Mon Sep 17 00:00:00 2001
From: rain <167982779@qq.com>
Date: Thu, 16 Jan 2025 10:08:16 +0800
Subject: [PATCH] 打印ws信息

---
 src/store/index.ts |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/src/store/index.ts b/src/store/index.ts
index 0c1c5d0..04f76a7 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -9,6 +9,7 @@
 import createPersistedState from 'vuex-persistedstate' // 导入库
 import map from './map'
 import common from './common'
+import user from './user'
 
 const initStateFunc = () => ({
   Layers: [
@@ -96,7 +97,13 @@
   devicesCmdExecuteInfo: {
   } as DevicesCmdExecuteInfo,
   mqttState: null as any, // mqtt 实例
-  clientId: '', // mqtt 连接 唯一客户端id
+  clientId: '', // mqtt 连接 唯一客户端id,
+  waylineTool: {
+    isShow: false as boolean,
+    selectedPoint: undefined as number | undefined,
+    selectedAction: undefined as any | undefined,
+    kmzPath: '' as string
+  }
 })
 
 export type RootStateType = ReturnType<typeof initStateFunc>
@@ -204,6 +211,15 @@
   SET_CLIENT_ID (state, clientId) {
     state.clientId = clientId
   },
+  // 设置wayline中的信息
+  SET_WAYLINE_INFO (state, { isShow, selectedPoint, selectedAction }) {
+    isShow !== undefined && (state.waylineTool.isShow = isShow)
+    state.waylineTool.selectedPoint = selectedPoint
+    selectedAction !== undefined && (state.waylineTool.selectedAction = selectedAction)
+  },
+  SET_WAYLINE_KMZPATH (state, kmzPath) {
+    state.waylineTool.kmzPath = kmzPath
+  }
 }
 
 const actions: ActionTree<RootStateType, RootStateType> = {
@@ -252,12 +268,13 @@
   actions,
   modules: {
     map,
-    common
+    common,
+    user
   },
   plugins: [createPersistedState({
     storage: window.sessionStorage,
     key: 'drone-client',
-    paths: ['map', 'common'],
+    paths: ['map', 'common', 'user'],
   })]
 }
 

--
Gitblit v1.9.3