#
luxiaotao1123
2020-11-10 8bd92b70769db1392a8b7a03a69b973b53f84ba1
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>电桩监控</title>
    <link href="css/monitor.css" rel="stylesheet">
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/vincent.js"></script>
    <script src="js/echarts/echarts.min.js"></script>
    <script src="https://api.map.baidu.com/api?v=2.0&ak=pnkdgjAQGCS0nwjFnBjbprCtPrNNvDBe" type="text/javascript"></script>
    <script src="js/echarts/bmap.min.js"></script>
</head>
<style>
 
 
 
</style>
<body class="monitor-bg">
 
    <!-- 电站详情 -->
    <div class="animationTop" id="detail-modal">
        <button id="closeBtn">关闭</button>
        <ul>
            <li>场站名:&nbsp;下沙新加坡科技园充电站</li>
            <li>快充个数:&nbsp;10</li>
            <li>快充电价:&nbsp;1.08元/度</li>
            <li>慢充个数:&nbsp;5</li>
            <li>慢充电价:&nbsp;1.44元/度</li>
            <li>总收入:&nbsp;4212.4元</li>
        </ul>
    </div>
 
    <!--头部-->
    <div class="header" >
        <div class="button-left"></div>
        <div class="button-right"></div>
        <div class="time-tools">
            2019-04-27 10:30:01 星期一
        </div>
        <div class="title">
            自动仓库WCS监控平台
        </div>
    </div>
 
    <!--主体-->
    <div class="container">
 
        <!--左-->
        <div class="container-element-side">
            <div class="container-side-box">
                <div class="image-border image-border1"></div>
                <div class="image-border image-border2"></div>
                <div class="image-border image-border3"></div>
                <div class="image-border image-border4"></div>
                <div class="introduce">
                    <h6>充电桩基本信息</h6>
                    <p class="english">charge base info</p>
                    <p class="introduce-content">那就是南昌打开另外纳斯达克脸上难看了上电脑课拉萨等你可怜我那就是南昌市第三代离开温暖的渴望懒得快来为你打开另外纳斯达克脸上难看了上电脑课拉萨等你可怜我那就是南昌市第三代离开温暖的渴望懒得快来为你打开另外纳斯达克脸上难看了上电脑课拉萨等你可怜我</p>
                </div>
                <div class="charge-info">
                    <div class="info-header">
                        <h6>场站数据</h6>
                        <p class="english">charge data</p>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/a.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">7777</i>
                                <span class="unit">个</span>
                            </div>
                            <div class="content">充电桩总数(个)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/b.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">777</i>
                                <span class="unit">个</span>
                            </div>
                            <div class="content">使用中电桩(个)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/c.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">33</i>
                                <span class="unit">元</span>
                            </div>
                            <div class="content">今日充电金额(元)</div>
                        </div>
                    </div>
                    <div class="charge-info-elem">
                        <img src="img/d.png">
                        <div class="info-detail">
                            <div class="real-data">
                                <i class="count">14296</i>
                                <span class="unit">千瓦时</span>
                            </div>
                            <div class="content">今日充电总量(千瓦时)</div>
                        </div>
                    </div>
                </div>
                <div class="footer container-side-box">
                    <div class="image-border image-border1"></div>
                    <div class="image-border image-border2"></div>
                    <div class="image-border image-border3"></div>
                    <div class="image-border image-border4"></div>
                    <span>递递叭叭客户服务中心</span>
                    <img src="img/wxCode.jpg">
                </div>
            </div>
        </div>
 
        <!--中-->
        <div class="container-element-middle">
            <div class="map-board">
                <div id="map">
                </div>
            </div>
            <div class="station-list">
                <div class="outside">
                    <div class="inside">
                        <div class="image-border image-border1"></div>
                        <div class="image-border image-border2"></div>
                        <div class="image-border image-border3"></div>
                        <div class="image-border image-border4"></div>
                        <div class="station-name">正工鸿大</div>
                    </div>
                </div>
                <div class="outside">
                    <div class="inside">
                        <div class="image-border image-border1"></div>
                        <div class="image-border image-border2"></div>
                        <div class="image-border image-border3"></div>
                        <div class="image-border image-border4"></div>
                        <div class="station-name">警体中心</div>
                    </div>
                </div>
                <div class="outside">
                    <div class="inside">
                        <div class="image-border image-border1"></div>
                        <div class="image-border image-border2"></div>
                        <div class="image-border image-border3"></div>
                        <div class="image-border image-border4"></div>
                        <div class="station-name">下沙新加坡科技园</div>
                    </div>
                </div>
                <div class="outside">
                    <div class="inside">
                        <div class="image-border image-border1"></div>
                        <div class="image-border image-border2"></div>
                        <div class="image-border image-border3"></div>
                        <div class="image-border image-border4"></div>
                        <div class="station-name">塘栖市民之家</div>
                    </div>
                </div>
                </ul>
            </div>
        </div>
 
        <!--右-->
        <div class="container-element-side">
            <div class="container-side-box right-top">
                <div class="image-border image-border1"></div>
                <div class="image-border image-border2"></div>
                <div class="image-border image-border3"></div>
                <div class="image-border image-border4"></div>
                <div class="line-chart-title">
                    <div class="order-report">
                        <span class="order-report-left" >订单统计</span>
                        <span class="order-report-right">31</span>
                    </div>
                    <div class="order-report-english english">
                        <span class="order-report-left">ORDER STATISTICS</span>
                        <span class="order-report-right">今日充电订单数</span>
                    </div>
                </div>
                <!--折线图-->
                <div id="line-charts"></div>
            </div>
            <div class="container-side-box right-middle">
                <div class="image-border image-border1"></div>
                <div class="image-border image-border2"></div>
                <div class="image-border image-border3"></div>
                <div class="image-border image-border4"></div>
                <div class="top-header">
                    <div class="income-date">
                        <span class="income-date-left" >收入类型</span>
                        <span class="income-date-right">今天</span>
                    </div>
                    <div class="income-date-english english">
                        <span class="income-date-left">INCOME DATE</span>
                        <span class="income-date-right">Today</span>
                    </div>
                </div>
                <div class="top-main">
                    <div id="pie-charts"></div>
                </div>
                <div class="top-footer">
                    <div class="top-footer-elem">
                        <div class="elem-header" id="elem-header-first">
                        </div>
                        <div class="elem-main">
                            合计(元)
                        </div>
                        <div class="elem-footer">
                            3,300
                        </div>
                    </div>
                    <div class="top-footer-elem">
                        <div class="elem-header" id="elem-header-second">
                        </div>
                        <div class="elem-main">
                            电桩数(个)
                        </div>
                        <div class="elem-footer">
                            161
                        </div>
                    </div>
                    <div class="top-footer-elem">
                        <div class="elem-header" id="elem-header-third">
                        </div>
                        <div class="elem-main">
                            面积(m²)
                        </div>
                        <div class="elem-footer">
                            666
                        </div>
                    </div>
                </div>
            </div>
            <div class="container-side-box right-bottom">
                <div class="image-border image-border1"></div>
                <div class="image-border image-border2"></div>
                <div class="image-border image-border3"></div>
                <div class="image-border image-border4"></div>
                <div class="progress-bar">
                    <div class="usage-rate">
                        <span class="usage-rate-left" >本月设备使用率</span>
                        <span class="usage-rate-right">60%</span>
                    </div>
                    <div class="usage-rate-english english">
                        <span class="usage-rate-left">EQUIPMENT USAGE THIS MONTH</span>
                        <span class="usage-rate-right">同比上月 + 5%</span>
                    </div>
                </div>
                <div class="progress-bar-modal">
                    <div class="bar-container">
                        <div class="bar-proportion"><span>实际使用</span></div>
                    </div>
                    <i class="bar-container-count">7777<span>个</span></i>
                </div>
            </div>
        </div>
 
    </div>
</body>
<script>
    //  遮罩
    let closeBtn = document.getElementById('closeBtn');
    let detailModal = document.getElementById('detail-modal');
    closeBtn.onclick = function () {
        detailModal.style.display = 'none';
    };
    var data = [];
    var chart = echarts.init(document.getElementById('map'));
    var lastStationId = null;
    var defalutName = '递递叭叭充电桩监控平台';
    var lastName = defalutName;
    function reload(stationId){
        data = [];
        let center = [120.307658, 30.372121];
        let param = {
            stationId: stationId
        };
        http.post("http://localhost:8080/admin/stations.action", param, function (res) {
            res.data.list.map(item => {
                data.push({
                    name: item.name,
                    stationId: item.stationId,
                    value: [item.lon, item.lat]
                })
            });
            option = {
                backgroundColor: 'transparent',
                title: {
                    text: '',
                    subtext: '',
                    sublink: '',
                    left: 'center',
                    textStyle: {
                        color: '#fff'
                    }
                },
                tooltip : {
                    trigger: 'item'
                },
                bmap: {
                    center: stationId==null?center:data[0].value,
                    zoom: stationId==null?12:18,
                    roam: true, // 是否可缩放
                },
                series : [
                    {
                        name: '',
                        type: 'effectScatter',
                        coordinateSystem: 'bmap',
                        data: data,
                        symbolSize: function () {
                            return 18;
                        },
                        showEffectOn: 'emphasis',
                        rippleEffect: {
                            brushType: 'stroke'
                        },
                        hoverAnimation: true,
                        label: { // 标签
                            formatter: '{b}',
                            position: 'right',
                            show: false
                        },
                        itemStyle: {
                            color: '#f4e925',
                            shadowBlur: 10,
                            shadowColor: '#333'
                        },
                        zlevel: 1
                    },
                ]
            };
 
            chart.setOption(option);
 
            var bMap = chart.getModel().getComponent('bmap').getBMap();
            bMap.setMapStyle({
                style : "midnight",
            });
 
            if (stationId != null) {
                lastStationId = stationId;
                lastName = data[0].name;
            } else {
                lastStationId = null;
                lastName = defalutName;
            }
 
        }, 'form');
    }
 
    reload();
 
    chart.on('click', function (param) {
        reload(param.data.stationId);
        $('.title').html(param.data.name);
    });
 
    // 返回
    $('.button-left').click(function () {
        reload();
        $('.title').html(defalutName);
    });
    // 刷新
    $('.button-right').click(function () {
        detailModal.style.display = 'block';
        // reload(lastStationId);
        // $('.title').html(lastName);
    });
 
 
//    折线图
    let lineCharts = echarts.init(document.getElementById('line-charts'));
    lineChartOption = {
        // animation: false,
        grid: {
            top: '0%',
            left: '0%',
            right: '2%',
            bottom: '0%',
            containLabel: true,
            // backgroundColor: 'rgb(116,148,174,0.3)',
            show: true
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['1', '2', '3', '4', '5', '6', '7'],
            axisLabel: {
                textStyle:{
                    color:'#aaa',  //坐标的字体颜色
                    fontSize: 6,
                },
            },
            axisLine:{
                lineStyle:{
                    color:'#3590ac', // 坐标轴颜色
                }
            }
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                textStyle:{
                    color:'#aaa',  //坐标的字体颜色
                    fontSize: 5
                },
            },
            axisLine:{
                lineStyle:{
                    color:'#3590ac', // 坐标轴颜色
                }
            },
            splitLine:{
                show: true,
                lineStyle:{
                    color:'#517a9b', // 分割线颜色
                }
            }
 
        },
        series: [{
            data: [820, 932, 901, 934, 1290, 1330, 1320],
            type: 'line',
            areaStyle: {
                color: '#7494ae' // 折线区域颜色
            },
            itemStyle:{
                normal:{
                    color:'#3590ac', //折点颜色
                    lineStyle:{
                        color:'#3590ac' //折线颜色
                    }
                }
            }
        }]
    };
 
    lineCharts.setOption(lineChartOption);
 
//    饼图
    let pieCharts = echarts.init(document.getElementById('pie-charts'));
    pieChartOption = {
        // animation: false,
        grid: {
            top: '0%',
            left: '0%',
            right: '0%',
            bottom: '0%',
            containLabel: false,
        },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b}: {c} ({d}%)'
        },
        legend: {
            orient: 'vertical',
            left: 10,
            data: ['1', '2', '3']
        },
        series: [
            {
                name: '访问来源',
                type: 'pie',
                radius: ['25%', '70%'],
                avoidLabelOverlap: false,
                label: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    label: {
                        show: false,
                        fontSize: '50',
                        fontWeight: 'bold'
                    }
                },
                labelLine: {
                    show: false
                },
                data: [
                    {value: 335, name: '1'},
                    {value: 310, name: '2'},
                    {value: 234, name: '3'},
                ],
                itemStyle: {
                    emphasis: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    },
                    normal:{
                        color:function(params) {
                            //自定义颜色
                            let colorList = [
                                '#28b9a2', '#69d7fc', '#fcbf5d',
                            ];
                            return colorList[params.dataIndex]
                        }
                    }
                }
            }
        ]
    };
    pieCharts.setOption(pieChartOption);
 
</script>
</html>