| | |
| | | const map = { |
| | | state: { |
| | | |
| | | 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 |
| | | } |