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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
| <template>
| <div class="centermap">
| <div class="maptitle">
| <img src="@/assets/img/icon/map_title.png" alt="">
| </div>
| <div class="mapwrap">
| <CityMap @mapItemClick="mapItemClick" @cancleClick="cancleClick"></CityMap>
|
| <!-- <DialogType1></DialogType1>
| <DialogType2></DialogType2>
| <DialogType3></DialogType3>
| <DialogType4></DialogType4>
| <DialogType5></DialogType5>
| <DialogType6></DialogType6>
| <DialogType7></DialogType7>
| <DialogType8></DialogType8>
| <DialogType9></DialogType9> -->
| </div>
|
| <div class="map-info-container">
| <div class="info-title-container">
| <div class="img-bg">
| <img src="@/assets/img/icon/map_info_title.png" alt="">
| </div>
| <div class="info-title">
| <div class="icon">
| <img src="@/assets/img/icon/arrow_right.png" alt="">
| </div>
| <span class="title">{{ activeData.name ? activeData.name : '都江堰市' }}</span>
| </div>
| </div>
| <div class="info-content-container">
| <div class="info-item">
| <div class="info-lable">事故易发多发路段:</div>
| <div class="info-text">{{ activeData.data.type1 ? activeData.data.type1 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">重点旅游通道:</div>
| <div class="info-text">{{ activeData.data.type2 ? activeData.data.type2 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">都江堰景区:</div>
| <div class="info-text">{{ activeData.data.type3 ? activeData.data.type3 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">警力配备:</div>
| <div class="info-text">{{ activeData.data.type4 ? activeData.data.type4 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">打围施工:</div>
| <div class="info-text">{{ activeData.data.type5 ? activeData.data.type5 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">交通事故易发点:</div>
| <div class="info-text">{{ activeData.data.type6 ? activeData.data.type6 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">重点运输企业:</div>
| <div class="info-text">{{ activeData.data.type7 ? activeData.data.type7 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">公交线路:</div>
| <div class="info-text">{{ activeData.data.type8 ? activeData.data.type8 : 0 }}</div>
| </div>
| <div class="info-item">
| <div class="info-lable">安全隐患:</div>
| <div class="info-text">{{ activeData.data.type9 ? activeData.data.type9 : 0 }}</div>
| </div>
| </div>
| </div>
| </div>
| </template>
|
|
| <script setup>
| import CityMap from './center/city-map.vue';
|
| import { ref,onMounted } from "vue";
| const mapData = ref([
| {
| id: 1,
| name: '龙池镇',
| data: { type1: 1, type2: 2, type3: 4, type4: 5, type5: 12, type6: 31, type7: 19, type8: 10, type9: 20 },
| },
| {
| id: 2,
| name: '玉堂街道',
| data: { type1: 5, type2: 12, type3: 5, type4: 13, type5: 12, type6: 31, type7: 19, type8: 26, type9: 3 },
| },
| {
| id: 3,
| name: '青城山镇',
| data: { type1: 12, type2: 12, type3: 52, type4: 3, type5: 12, type6: 31, type7: 19, type8: 13, type9: 3 },
| },
| {
| id: 4,
| name: '石羊镇',
| data: { type1: 21, type2: 12, type3: 24, type4: 12, type5: 12, type6: 31, type7: 19, type8: 13, type9: 31 },
| },
| {
| id: 5,
| name: '幸福街道',
| data: { type1: 10, type2: 12, type3: 5, type4: 52, type5: 12, type6: 31, type7: 19, type8: 13, type9: 3 },
| },
| {
| id: 6,
| name: '银杏街道',
| data: { type1: 31, type2: 13, type3: 5, type4: 265, type5: 12, type6: 31, type7: 19, type8: 21, type9: 3 },
| },
| {
| id: 7,
| name: '灌口街道',
| data: { type1: 52, type2: 12, type3: 5, type4: 265, type5: 12, type6: 31, type7: 19, type8: 13, type9: 3 },
| },
| {
| id: 8,
| name: '奎光塔街道',
| data: { type1: 53, type2: 35, type3: 5, type4: 15, type5: 12, type6: 31, type7: 19, type8: 13, type9: 3 },
| },
| {
| id: 9,
| name: '天马镇',
| data: { type1: 13, type2: 2, type3: 5, type4: 51, type5: 12, type6: 31, type7: 19, type8: 12, type9: 15 },
| },
| {
| id: 10,
| name: '聚源镇',
| data: { type1: 13, type2: 35, type3: 65, type4: 24, type5: 12, type6: 35, type7: 3, type8: 42, type9: 24 },
| },
| {
| id: 11,
| name: '蒲阳街道',
| data: { type1: 6, type2: 6, type3: 63, type4: 42, type5: 12, type6: 31, type7: 19, type8: 89, type9: 3 },
| },
| ]);
|
| const activeData = ref({
| name: '都江堰市',
| data: {},
| });
|
| const mapItemClick = (id) => {
| activeData.value = mapData.value.find((item) => item.id === id);
| }
|
| const cancleClick = () => {
| activeData.value = {
| name: '都江堰市',
| data: totalNum(),
| };
| }
|
| const totalNum = () => {
| let data = {};
| mapData.value.forEach((item) => {
| Object.keys(item.data).forEach((key) => {
| data[key] = data[key] ? data[key] + item.data[key] : item.data[key];
| });
| });
| return data;
| }
|
| onMounted(() => {
| cancleClick();
| });
|
| </script>
|
| <style scoped lang="scss">
| .centermap {
| margin-bottom: 30px;
| position: relative;
|
| .mapwrap {
| //height: 580px;
| height: 900px;
| width: 100%;
| // padding: 0 0 10px 0;
| box-sizing: border-box;
| position: relative;
|
| .quanguo {
| position: absolute;
| right: 20px;
| top: -46px;
| width: 80px;
| height: 28px;
| border: 1px solid #00eded;
| border-radius: 10px;
| color: #00f7f6;
| text-align: center;
| line-height: 26px;
| letter-spacing: 6px;
| cursor: pointer;
| box-shadow: 0 2px 4px rgba(0, 237, 237, 0.5),
| 0 0 6px rgba(0, 237, 237, 0.4);
| z-index: 10;
| }
| }
| }
|
| .map-style {
| width: 100%;
| height: 100%;
| }
|
| .maptitle {
| width: 308px;
| position: absolute;
| left: 0;
| top: 30px;
| }
|
| .map-info-container {
| width: 225px;
| position: absolute;
| right: 0;
| bottom: 120px;
| background: rgba(17, 34, 58, 0.6);
| border: 1px solid #29466A;
| z-index: 5;
|
| .info-title-container {
| width: 100%;
| position: relative;
|
| .img-bg {
| width: 100%;
| }
|
| .info-title {
|
| width: 100%;
| position: absolute;
| top: 5px;
| left: 0;
| display: flex;
| align-items: center;
|
| .icon {
| width: 15px;
| margin: 0 5px 0 12px;
| }
|
| .title {
| font-weight: 400;
| font-size: 20px;
| color: #FFFFFF;
| text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.5);
| font-style: italic;
| background: linear-gradient(180deg, #FFFFFF 0%, #70B2F4 100%);
| -webkit-background-clip: text;
| // -webkit-text-fill-color: transparent;
| }
| }
| }
|
| .info-content-container {
| position: relative;
| padding: 10px 20px;
| margin-top: -40px;
| font-size: 14px;
| z-index: 2;
|
| .info-item {
| width: 100%;
| display: flex;
| align-items: center;
| justify-content: space-between;
| color: #4481DD;
| line-height: 28px;
|
| .info-text {
| color: #fff;
| }
| }
| }
|
| }
|
| .info-lable {
| font-family: 'PingFang SC' !important;
| }
|
| .test {
| position: absolute;
| top: 0;
| }
| </style>
|
|