|
@@ -1,5 +1,15 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="body-wrapper">
|
|
3
|
+ <el-form class="form-wrapper" :inline="true" :model="formInline">
|
|
4
|
+ <el-form-item label="行政区">
|
|
5
|
+ <el-select clearable v-model="formInline.regionCode" placeholder="请选择" popper-class="cur-select">
|
|
6
|
+ <el-option v-for="item in districtOptions" :key="item.label" :label="item.label" :value="item.value"></el-option>
|
|
7
|
+ </el-select>
|
|
8
|
+ </el-form-item>
|
|
9
|
+ <el-form-item>
|
|
10
|
+ <el-button type="primary" @click="queryAll">查询</el-button>
|
|
11
|
+ </el-form-item>
|
|
12
|
+ </el-form>
|
3
|
13
|
<div style="display: flex; justify-content: space-between;">
|
4
|
14
|
<div style="width: 50%; height: 300px">
|
5
|
15
|
<div align="center" style="color: white">区域饱和度</div>
|
|
@@ -52,6 +62,7 @@ import barchart from "@/components/barChart";
|
52
|
62
|
import * as echarts from 'echarts';
|
53
|
63
|
import * as geoJson from '../../../util/411100.json';
|
54
|
64
|
import api from '@/api/article_z'
|
|
65
|
+import options from '@/util/options'
|
55
|
66
|
|
56
|
67
|
|
57
|
68
|
export default {
|
|
@@ -61,6 +72,10 @@ export default {
|
61
|
72
|
},
|
62
|
73
|
data() {
|
63
|
74
|
return {
|
|
75
|
+ formInline: {
|
|
76
|
+ regionCode: ''
|
|
77
|
+ },
|
|
78
|
+ districtOptions: options.districtOptions,
|
64
|
79
|
option: {
|
65
|
80
|
backgroundColor: '#0c0c0c',
|
66
|
81
|
visualMap: {
|
|
@@ -109,37 +124,24 @@ export default {
|
109
|
124
|
}
|
110
|
125
|
},
|
111
|
126
|
mounted() {
|
112
|
|
- this.getBarData()
|
113
|
|
- this.getLineData()
|
114
|
|
- api.queryParkingArea_Tcrdskfb({}).then(res => {
|
115
|
|
- let data = res.data || []
|
116
|
|
- let areaData = [];
|
117
|
|
- data.map(item => { //扩大热力图效果
|
118
|
|
- areaData.push(...new Array(3).fill(item))
|
119
|
|
- })
|
120
|
|
- let mapMax = Math.max(...data.map(item => item[2]))
|
121
|
|
- let mapMin = Math.min(...data.map(item => item[2]))
|
122
|
|
- let chart = echarts.init(document.getElementById("map"));
|
123
|
|
- echarts.registerMap("luohe", geoJson);
|
124
|
|
-
|
125
|
|
- // echarts.registerMap('china', china)
|
126
|
|
- this.option.series[0].data = areaData;
|
127
|
|
- this.option.visualMap.min = mapMin;
|
128
|
|
- this.option.visualMap.max = mapMax;
|
129
|
|
- chart.setOption(this.option);
|
130
|
|
- })
|
|
127
|
+ this.queryAll()
|
131
|
128
|
},
|
132
|
129
|
watch: {
|
133
|
130
|
|
134
|
131
|
},
|
135
|
132
|
methods: {
|
|
133
|
+ queryAll() {
|
|
134
|
+ this.getBarData()
|
|
135
|
+ this.getLineData()
|
|
136
|
+ this.getMapData()
|
|
137
|
+ },
|
136
|
138
|
getBarData() {
|
137
|
|
- api.queryParkingArea_qybhd({}).then(res => {
|
|
139
|
+ api.queryParkingArea_qybhd({...this.formInline}).then(res => {
|
138
|
140
|
this.bardata = res.data || []
|
139
|
141
|
})
|
140
|
142
|
},
|
141
|
143
|
getLineData() {
|
142
|
|
- api.queryParkingArea_bhdsdfx({}).then(res => {
|
|
144
|
+ api.queryParkingArea_bhdsdfx({...this.formInline}).then(res => {
|
143
|
145
|
this.linedata = res.data || []
|
144
|
146
|
})
|
145
|
147
|
},
|
|
@@ -164,6 +166,25 @@ export default {
|
164
|
166
|
// ${params[0].name || "--"}月:
|
165
|
167
|
return `<div class="${type==='bar' ? 'bar-tooltip-dz' : type==='line' ? 'line-tooltip-dz' : ''}">${params[0].seriesName}:${data.hs || "--"}%</div>`;
|
166
|
168
|
},
|
|
169
|
+ getMapData() {
|
|
170
|
+ api.queryParkingArea_Tcrdskfb({...this.formInline}).then(res => {
|
|
171
|
+ let data = res.data || []
|
|
172
|
+ let areaData = [];
|
|
173
|
+ data.map(item => { //扩大热力图效果
|
|
174
|
+ areaData.push(...new Array(3).fill(item))
|
|
175
|
+ })
|
|
176
|
+ let mapMax = Math.max(...data.map(item => item[2]))
|
|
177
|
+ let mapMin = Math.min(...data.map(item => item[2]))
|
|
178
|
+ let chart = echarts.init(document.getElementById("map"));
|
|
179
|
+ echarts.registerMap("luohe", geoJson);
|
|
180
|
+
|
|
181
|
+ // echarts.registerMap('china', china)
|
|
182
|
+ this.option.series[0].data = areaData;
|
|
183
|
+ this.option.visualMap.min = mapMin;
|
|
184
|
+ this.option.visualMap.max = mapMax;
|
|
185
|
+ chart.setOption(this.option);
|
|
186
|
+ })
|
|
187
|
+ }
|
167
|
188
|
}
|
168
|
189
|
}
|
169
|
190
|
</script>
|
|
@@ -181,4 +202,45 @@ export default {
|
181
|
202
|
height: 100%;
|
182
|
203
|
width: 100%;
|
183
|
204
|
}
|
|
205
|
+ /deep/ .el-input__inner {
|
|
206
|
+ background: #2d3744;
|
|
207
|
+ border: none;
|
|
208
|
+ border-radius: 0;
|
|
209
|
+ }
|
|
210
|
+ /deep/ .el-select {
|
|
211
|
+
|
|
212
|
+ /* 下面设置右侧按钮居中 */
|
|
213
|
+ .el-input__suffix {
|
|
214
|
+ top: 0px;
|
|
215
|
+ display: flex;
|
|
216
|
+ justify-content: center;
|
|
217
|
+ align-items: center;
|
|
218
|
+ flex-wrap: nowrap;
|
|
219
|
+ flex-direction: row;
|
|
220
|
+ align-content: flex-start;
|
|
221
|
+ }
|
|
222
|
+ /* 输入框加上上下边是 32px + 2px =34px */
|
|
223
|
+ .el-input__icon {
|
|
224
|
+ line-height: 0px;
|
|
225
|
+ }
|
|
226
|
+ }
|
|
227
|
+ .body-wrapper {
|
|
228
|
+ .button-block{
|
|
229
|
+ text-align: right;
|
|
230
|
+ margin-bottom: 20px;
|
|
231
|
+ }
|
|
232
|
+
|
|
233
|
+ }
|
|
234
|
+ .audit-dialog{
|
|
235
|
+ .mg-bt{
|
|
236
|
+ margin-bottom: 24px;
|
|
237
|
+ }
|
|
238
|
+ .label{
|
|
239
|
+ text-align: right;
|
|
240
|
+ }
|
|
241
|
+ }
|
|
242
|
+ /deep/ .el-textarea.is-disabled .el-textarea__inner {
|
|
243
|
+ background: #2a2a2a;
|
|
244
|
+ color: #fff;
|
|
245
|
+ }
|
184
|
246
|
</style>
|