guoshilong
2023-10-13 744f3b89a2ed8832f669f322ace820d65cba33fc
src/store/common.ts
@@ -3,6 +3,13 @@
const state = () => ({
  projectId: null as string | null,
  dockSns: null as string | null,
  snList: [] as string[],
  projectName: '' as string,
  // 地图setting
  mapSetting: {
    mode: 0, // 0为标准地图, 1为卫星地图
    roadLine: true,
  },
})
export type RootStateType = ReturnType<typeof state>
const mutations: MutationTree<RootStateType> = {
@@ -12,6 +19,21 @@
  SET_DOCK_SN (state, dockSns: string) {
    state.dockSns = dockSns
  },
  SET_SN_LIST (state, snList: string[]) {
    state.snList = snList
  },
  SET_PROJECT_NAME (state, projectName: string) {
    state.projectName = projectName
  },
  // 设置地图模式
  SET_MAP_SETTING_MODE (state, mode: number) {
    state.mapSetting.mode = mode
  },
  // 设置地图路网
  SET_MAP_SETTING_ROAD_LINE (state, roadLine: boolean) {
    state.mapSetting.roadLine = roadLine
  }
}
export default {