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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
| import Cookies from 'js-cookie';
| import busEvent from '@/utils/busEvent';
| const state = {
| layerTree: [],
| defaultLayer: [],
| mapInfo: [],
| msgList: [],
| disasterSnow: {
| title: '雪',
| val: [],
| },
| disasterRain: {
| title: '雨',
| val: [],
| },
| disasterFire: {
| title: '火',
| val: [],
| },
| weatherFlag: 2,
| weatherMsg: {
| name:'',
| data:[]
| },
| msgInfoData:null,
| };
|
| 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,
| };
|
|