| | |
| | | <!--中--> |
| | | <div class="container-element-middle"> |
| | | <div class="map-board"> |
| | | <div id="map"> |
| | | <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> |
| | | </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">A</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">B</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">C</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">D</div> |
| | | </div> |
| | | </div> |
| | | </ul> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <!--右--> |
| | |
| | | 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')); |