浏览代码

bug fixed

duwendi 1 年之前
父节点
当前提交
c7451c5b63

+ 1 - 1
src/pages/index/components/business_overview.vue

@@ -6,7 +6,7 @@
6
         <piechart
6
         <piechart
7
           class="model-pie-body"
7
           class="model-pie-body"
8
           id="chart1"
8
           id="chart1"
9
-          :radiusArr="['30%', '70%']"
9
+          :radiusArr="['30%', '50%']"
10
           :roseType = "false"
10
           :roseType = "false"
11
           :colorArr="modelPieColor"
11
           :colorArr="modelPieColor"
12
           :labelFormat="['{name|{b}}', '{sub|{@value} {d}%}', '{hr|}']"
12
           :labelFormat="['{name|{b}}', '{sub|{@value} {d}%}', '{hr|}']"

+ 3 - 3
src/pages/index/components/park_bahavior.vue

@@ -32,12 +32,12 @@
32
     </el-form>
32
     </el-form>
33
     <br>
33
     <br>
34
     <div class="charts" style="display: flex">
34
     <div class="charts" style="display: flex">
35
-      <div style="width: 50%;height: 300px;">
35
+      <div style="width: 50%;height: 320px;">
36
         <h5 style="color: white">停车时长分析</h5>
36
         <h5 style="color: white">停车时长分析</h5>
37
         <piechart
37
         <piechart
38
           class="model-pie-body"
38
           class="model-pie-body"
39
           id="chart1"
39
           id="chart1"
40
-          :radiusArr="['30%', '70%']"
40
+          :radiusArr="['30%', '50%']"
41
           :roseType = "false"
41
           :roseType = "false"
42
           :colorArr="modelPieColor"
42
           :colorArr="modelPieColor"
43
           :labelFormat="['{name|{b}}', '{sub|{@value}辆 {d}%}', '{hr|}']"
43
           :labelFormat="['{name|{b}}', '{sub|{@value}辆 {d}%}', '{hr|}']"
@@ -45,7 +45,7 @@
45
           :encode="{ itemName: 'name', value: 'value' }"
45
           :encode="{ itemName: 'name', value: 'value' }"
46
         />
46
         />
47
       </div>
47
       </div>
48
-      <div style="width: 50%;height: 300px;">
48
+      <div style="width: 50%;height: 320px;">
49
         <h5 style="color: white">停车时段分析</h5>
49
         <h5 style="color: white">停车时段分析</h5>
50
         <linechart
50
         <linechart
51
           :autoStop="false"
51
           :autoStop="false"

+ 171 - 58
src/pages/index/components/parking_area.vue

@@ -39,6 +39,7 @@
39
           :left="40"
39
           :left="40"
40
           :legendTop="0"
40
           :legendTop="0"
41
           yAxisName="(%)"
41
           yAxisName="(%)"
42
+          :rotate="30"
42
           :dataset="linedata"
43
           :dataset="linedata"
43
           :tooltipFormat="lineTooltipFormat1"
44
           :tooltipFormat="lineTooltipFormat1"
44
           :encode="[
45
           :encode="[
@@ -50,8 +51,8 @@
50
     </div>
51
     </div>
51
     <div style="display: flex; justify-content: space-between;margin-top: 5%">
52
     <div style="display: flex; justify-content: space-between;margin-top: 5%">
52
       <div style="width: 100%; height: 500px;">
53
       <div style="width: 100%; height: 500px;">
53
-        <div align="center" style="color: white">停车热度时空分布</div>
54
-        <div class="bottom" id="map"></div>
54
+        <div align="center" style="color: white;margin-bottom: 10px;">停车热度时空分布</div>
55
+        <div id="map" style="width: 100%; height: 600px;"/>
55
       </div>
56
       </div>
56
     </div>
57
     </div>
57
   </div>
58
   </div>
@@ -59,11 +60,10 @@
59
 <script>
60
 <script>
60
 import linechart from "@/components/lineChart";
61
 import linechart from "@/components/lineChart";
61
 import barchart from "@/components/barChart";
62
 import barchart from "@/components/barChart";
62
-import * as echarts from 'echarts';
63
-import * as geoJson from '../../../util/411100.json';
64
 import api from '@/api/article_z'
63
 import api from '@/api/article_z'
65
 import options from '@/util/options'
64
 import options from '@/util/options'
66
-
65
+import * as echarts from 'echarts'
66
+import 'echarts-extension-amap'
67
 
67
 
68
 export default {
68
 export default {
69
   components: {
69
   components: {
@@ -77,47 +77,78 @@ export default {
77
       },
77
       },
78
       districtOptions: options.districtOptions,
78
       districtOptions: options.districtOptions,
79
       option: {
79
       option: {
80
-        backgroundColor: '#0c0c0c',
81
-        visualMap: {
82
-          bottom: 100,
83
-          left: 100,
84
-          min: 0,
85
-          max: 100,
86
-          color: ['#ff4601', '#fffc00', '#87cffa'],
87
-          calculable: true,
88
-          textStyle: {
89
-            color: '#fff',
90
-            fontSize: 12
91
-          },
92
-          seriesIndex: 0
80
+        amap: {
81
+          viewMode: '3D',
82
+          center: [114.02, 33.58],
83
+          zoom: 10,
84
+          resizeEnable: true,
85
+          //使用自定义主题
86
+          mapStyle: 'amap://styles/grey',
87
+          renderOnMoving: true,
88
+          largeMode: false
89
+
93
         },
90
         },
94
-        geo: {
95
-          map: 'luohe',
96
-          show: true,
97
-          roam: false,
98
-          label: {
99
-            emphasis: {
91
+        tooltip: {
92
+          trigger: 'item'
93
+        },
94
+        animation: true,
95
+        series: [
96
+          {
97
+            name: 'PM2.5',
98
+            type: 'scatter',
99
+            coordinateSystem: 'amap',
100
+            data: [],
101
+            symbolSize: function (val) {
102
+              return val[2] / 10;
103
+            },
104
+            encode: {
105
+              value: 2
106
+            },
107
+            label: {
108
+              formatter: '{b}',
109
+              position: 'right',
100
               show: false
110
               show: false
101
-            }
102
-          },
103
-          itemStyle: {
104
-            normal: {
105
-              areaColor: '#17439a',
106
-              borderColor: '#fff'
111
+            },
112
+            itemStyle: {
113
+              normal: {
114
+                color: '#00c1de'
115
+              }
107
             },
116
             },
108
             emphasis: {
117
             emphasis: {
109
-              areaColor: '#17439a',
110
-              borderColor: '#fff'
118
+              label: {
119
+                show: true
120
+              }
111
             }
121
             }
122
+          },
123
+          {
124
+            name: 'Top 5',
125
+            type: 'effectScatter',
126
+            coordinateSystem: 'amap',
127
+            data: [],
128
+            symbolSize: function (val) {
129
+              return val[2] / 10;
130
+            },
131
+            encode: {
132
+              value: 2
133
+            },
134
+            showEffectOn: 'render',
135
+            rippleEffect: {
136
+              brushType: 'stroke'
137
+            },
138
+            hoverAnimation: true,
139
+            label: {
140
+              formatter: '{b}',
141
+              position: 'right',
142
+              show: true
143
+            },
144
+            itemStyle: {
145
+              color: '#f00',
146
+              shadowBlur: 10,
147
+              shadowColor: '#333'
148
+            },
149
+            zlevel: 1
112
           }
150
           }
113
-        },
114
-        series: [{
115
-          name: 'AQI',
116
-          type: 'heatmap',
117
-          coordinateSystem: 'geo',
118
-          blurSize: 40,
119
-          data: []
120
-        }]
151
+        ]
121
       },
152
       },
122
       linedata: [],
153
       linedata: [],
123
       bardata: [],
154
       bardata: [],
@@ -125,6 +156,7 @@ export default {
125
   },
156
   },
126
   mounted() {
157
   mounted() {
127
     this.queryAll()
158
     this.queryAll()
159
+
128
   },
160
   },
129
   watch: {
161
   watch: {
130
 
162
 
@@ -167,23 +199,104 @@ export default {
167
       return `<div class="${type==='bar' ? 'bar-tooltip-dz' : type==='line' ? 'line-tooltip-dz' : ''}">${params[0].seriesName}:${data.hs || "--"}%</div>`;
199
       return `<div class="${type==='bar' ? 'bar-tooltip-dz' : type==='line' ? 'line-tooltip-dz' : ''}">${params[0].seriesName}:${data.hs || "--"}%</div>`;
168
     },
200
     },
169
     getMapData() {
201
     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
-      })
202
+      let myChart = echarts.init(document.getElementById("map"));
203
+      var data = [
204
+        { name: '车场A', value: 200 },
205
+        { name: '车场B', value: 100 },
206
+      ];
207
+      var geoCoordMap = {
208
+        '车场A': [113.97421800, 33.57179100],
209
+        '车场B': [114.03213800, 33.56496300],
210
+      };
211
+      var convertData = function (data) {
212
+        var res = [];
213
+        for (var i = 0; i < data.length; i++) {
214
+          var geoCoord = geoCoordMap[data[i].name];
215
+          if (geoCoord) {
216
+            res.push({
217
+              name: data[i].name,
218
+              value: geoCoord.concat(data[i].value)
219
+            });
220
+          }
221
+        }
222
+        return res;
223
+      };
224
+      let option = {
225
+        amap: {
226
+          viewMode: '3D',
227
+          center: [114.02, 33.58],
228
+          zoom: 10,
229
+          resizeEnable: true,
230
+          //使用自定义主题
231
+          mapStyle: 'amap://styles/grey',
232
+          renderOnMoving: true,
233
+          largeMode: false
234
+        },
235
+        tooltip: {
236
+          trigger: 'item'
237
+        },
238
+        animation: true,
239
+        series: [
240
+          {
241
+            name: 'PM2.5',
242
+            type: 'scatter',
243
+            coordinateSystem: 'amap',
244
+            data: convertData(data),
245
+            symbolSize: function (val) {
246
+              return val[2] / 10;
247
+            },
248
+            encode: {
249
+              value: 2
250
+            },
251
+            label: {
252
+              formatter: '{b}',
253
+              position: 'right',
254
+              show: false
255
+            },
256
+            itemStyle: {
257
+              normal: {
258
+                color: '#00c1de'
259
+              }
260
+            },
261
+            emphasis: {
262
+              label: {
263
+                show: true
264
+              }
265
+            }
266
+          },
267
+          {
268
+            name: 'Top 5',
269
+            type: 'effectScatter',
270
+            coordinateSystem: 'amap',
271
+            data: convertData(data.sort(function (a, b) {
272
+              return b.value - a.value;
273
+            }).slice(0, 6)),
274
+            symbolSize: function (val) {
275
+              return val[2] / 10;
276
+            },
277
+            encode: {
278
+              value: 2
279
+            },
280
+            showEffectOn: 'render',
281
+            rippleEffect: {
282
+              brushType: 'stroke'
283
+            },
284
+            hoverAnimation: true,
285
+            label: {
286
+              formatter: '{b}',
287
+              position: 'right',
288
+              show: false
289
+            },
290
+            itemStyle: {
291
+              color: '#f00',
292
+              shadowBlur: 10,
293
+              shadowColor: '#333'
294
+            },
295
+            zlevel: 1
296
+          }
297
+        ]
298
+      };
299
+      myChart.setOption(option);
187
     }
300
     }
188
   }
301
   }
189
 }
302
 }
@@ -199,7 +312,7 @@ export default {
199
 </style>
312
 </style>
200
 <style lang="less" scoped>
313
 <style lang="less" scoped>
201
   .bottom {
314
   .bottom {
202
-    height: 100%;
315
+    height: 600px;
203
     width: 100%;
316
     width: 100%;
204
   }
317
   }
205
   /deep/ .el-input__inner {
318
   /deep/ .el-input__inner {

+ 3 - 1
src/pages/index/index.html

@@ -5,7 +5,9 @@
5
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
5
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
6
     <title>监管平台管理</title>
6
     <title>监管平台管理</title>
7
     <script src="static/mung-local-config.js"></script>
7
     <script src="static/mung-local-config.js"></script>
8
-    <script src="static/jquery-3.1.0.min.js"></script>
8
+    <script src="static/jquery-3.1.0.min.js"></script>   <!-- 在index.html中添加 -->
9
+    <script src="https://webapi.amap.com/maps?v=2.0&key=f1a27c94cbb2e9163a60a67b113245da"></script>
10
+
9
   </head>
11
   </head>
10
   <body>
12
   <body>
11
     <div id="index"></div>
13
     <div id="index"></div>