suerprisePlus
2024-10-14 f521ebc2551d468c4c478783a18d4b0714394d61
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
33
34
35
36
37
38
39
40
41
42
import Cookies from 'js-cookie';
import busEvent from '@/utils/busEvent';
const state = {
    layerTree: [],
    defaultLayer: [],
    mapInfo: [],
    msgList:[ ]
 
};
 
const mutations = {
    CHANGE_LAYERTREE: (state, res) => {
        state.layerTree = res;
    },
    CHANGE_DEFAULTLAYER: (state, res) => {
        state.defaultLayer = res;
    },
    CHANGE_MAPINFO: (state, res) => {
        state.mapInfo = res;
        busEvent.$emit('CHANGE_MAPINFO',  state.mapInfo);
    
    },
};
 
const actions = {
    changeLayerTree({ commit }, obj) {
        commit('CHANGE_LAYERTREE', obj);
    },
    changeDefaultLayer({ commit }, obj) {
        commit('CHANGE_DEFAULTLAYER', obj);
    },
    changeMapInfo({ commit }, obj) {
        commit('CHANGE_MAPINFO', obj);
    },
};
 
export default {
    namespaced: true,
    state,
    mutations,
    actions,
};