| | |
| | | import createPersistedState from 'vuex-persistedstate' // 导入库 |
| | | import map from './map' |
| | | import common from './common' |
| | | import user from './user' |
| | | |
| | | const initStateFunc = () => ({ |
| | | Layers: [ |
| | |
| | | clientId: '', // mqtt 连接 唯一客户端id, |
| | | waylineTool: { |
| | | isShow: false as boolean, |
| | | wayline: {} as any, |
| | | selectedPoint: undefined as number | undefined, |
| | | selectedAction: undefined as any | undefined, |
| | | kmzPath: '' as string |
| | | } |
| | | }) |
| | |
| | | state.clientId = clientId |
| | | }, |
| | | // 设置wayline中的信息 |
| | | SET_WAYLINE_INFO (state, { isShow, wayline }) { |
| | | state.waylineTool.isShow = isShow |
| | | state.waylineTool.wayline = 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 |
| | |
| | | actions, |
| | | modules: { |
| | | map, |
| | | common |
| | | common, |
| | | user |
| | | }, |
| | | plugins: [createPersistedState({ |
| | | storage: window.sessionStorage, |
| | | key: 'drone-client', |
| | | paths: ['map', 'common'], |
| | | paths: ['map', 'common', 'user'], |
| | | })] |
| | | } |
| | | |