liuyg
2022-03-02 e7c6c4eecddae9515b0cd1be68335690843df3d1
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
const popupParams = {
    state: {
        popupBgUrl: null,
        pupupQRUrl: null,
        terminus: null,
        startingPoint: null,
        pointPosition: null,
        stateName: null,
        siteName: null,
        telephone: null,
        introduceText: null,
        detailsPopup: false,
        panoramaUrl: null,
        panoramaPopup: false,
        monitorUrl: null,
        monitorPopup: false,
        // 图集
        popupImgAtlas: [],
        teachList: [],
        liveList: [],
        addTagPopup: false,
        addTagPosition: null,
 
        labelLayer: null, //自定义标签图层
        addSignList: true,
    },
    mutations: {
        SET_POPUPBGURL(state, popupBgUrl) {
            state.popupBgUrl = popupBgUrl
        },
        SET_POPUPQRURL(state, pupupQRUrl) {
            state.pupupQRUrl = pupupQRUrl
        },
        SET_TERMINUS(state, terminus) {
            state.terminus = terminus
        },
        SET_STARTINGPOINT(state, startingPoint) {
            state.startingPoint = startingPoint
        },
        SET_POINTPOSITION(state, pointPosition) {
            state.pointPosition = pointPosition
        },
        SET_STATENAME(state, stateName) {
            state.stateName = stateName
        },
        SET_SITENAME(state, siteName) {
            state.siteName = siteName
        },
        SET_TELEPHONE(state, telephone) {
            state.telephone = telephone
        },
        SET_INTRODUCETEXT(state, introduceText) {
            state.introduceText = introduceText
        },
        SET_PANORAMAURL(state, panoramaUrl) {
            state.panoramaUrl = panoramaUrl
        },
        SET_PANORAMAPOPUP(state, panoramaPopup) {
            state.panoramaPopup = panoramaPopup
        },
        SET_MONITORURL(state, monitorUrl) {
            state.monitorUrl = monitorUrl
        },
        SET_MONITORPOPUP(state, monitorPopup) {
            state.monitorPopup = monitorPopup
        },
        SET_DETAILSPOPUP(state, detailsPopup) {
            state.detailsPopup = detailsPopup
        },
        SET_POPUPIMGATLAS(state, popupImgAtlas) {
            state.popupImgAtlas = popupImgAtlas
        },
        SET_TEACHLIST(state, teachList) {
            state.teachList = teachList
        },
        SET_LIVELIST(state, liveList) {
            state.liveList = liveList
        },
 
        SET_ADDTAGPOPUP(state, addTagPopup) {
            state.addTagPopup = addTagPopup
        },
 
        SET_ADDTAGPOSITION(state, addTagPosition) {
            state.addTagPosition = addTagPosition
        },
        initLabelLayer(state, val) {
            if (!state.labelLayer) {
                state.labelLayer = new global.DC.HtmlLayer("labelLayer");
                val.addLayer(state.labelLayer);
            }
        },
        addLabelLayerIcon(state, val) {
            let list = val.list;
            if (val.clear) {
                //     state.labelLayer.remove();
                state.labelLayer.clear();
            }
            if (val.add) { //刷新列表
                state.addSignList = !state.addSignList;
            }
            for (let i in list) {
                console.log(list[i], 112233)
                const divIcon = new global.DC.DivIcon(
                    new global.DC.Position(
                        Number(list[i].jd),
                        Number(list[i].wd),
                        0
                    ),
                    `
                              <div class="tag-entitys-box">
                                  <div class="tag-content">
                                      ${list[i].name}
                                  </div>
                                  <div class="tag-angle-content">
                                      <img src="https://map.hit.edu.cn/images/tarrow_xq.png">
                                  </div>
                              </div>
                          `
                );
                state.labelLayer.addOverlay(divIcon);
            }
        },
        clearLabelLayerIcon(state, val) {
            if (state.labelLayer) {
                state.labelLayer.clear();
            }
        },
 
        CLEAR_ALL(state, param) {
            state.siteName = param
            state.introduceText = param
            state.telephone = param
            state.panoramaUrl = param
            state.monitorUrl = param
            state.popupBgUrl = param
            state.teachList = []
            state.liveList = []
        }
    },
    actions: {
 
    }
}
 
export default popupParams