husq
2023-09-05 be84102dc381d0c1925e477f15a431d6c327c0d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { MutationTree } from 'vuex'
const state = () => ({
  // 项目中心点设置
  centerConfig: {
    // true为开启在地图中获取坐标
    type: false,
    latitude: null as number | null,
    longitude: null as number | null,
  },
  // 所有项目中心点
  pointList: [],
})
interface longitude {
  longitude:number
  latitude: number
}
export type RootStateType = ReturnType<typeof state>
const mutations: MutationTree<RootStateType> = {
  // 开启设置地图坐标标识
  SET_CENTER_CONFIG_TYPE (state, type: boolean) {
    state.centerConfig.type = type
  },
  // 设置经纬度
  SET_CENTER_CONFIG_LATITUDE (state, data:longitude) {
    state.centerConfig.longitude = data.longitude
    state.centerConfig.latitude = data.latitude
  }
}
export default {
  state,
  mutations
}