|
|
|
|
@ -55,13 +55,13 @@ export default { |
|
|
|
|
// locationAcc: { 0: '关闭', 1: '开启' }, |
|
|
|
|
// carList: carList,//车辆设备 |
|
|
|
|
markList: [ |
|
|
|
|
{ lng: 112.37268, lat: 25.63787, name: "福顺机械实业公司" }, |
|
|
|
|
{ lng: 112.375261, lat: 25.63742, name: "巨人机床实业公司" }, |
|
|
|
|
{ lng: 112.365047, lat: 25.630574, name: "郴州雄建实业公司" }, |
|
|
|
|
{ lng: 112.36587, lat: 25.63132, name: "众合实业公司" }, |
|
|
|
|
{ lng: 112.372727, lat: 25.635608, name: "雄达实业公司" }, |
|
|
|
|
{ lng: 112.373909, lat: 25.634179, name: "峰达实业公司" }, |
|
|
|
|
{ lng: 112.37275, lat: 25.63676, name: "伟铸机械实业公司" }, |
|
|
|
|
{ lng: 112.37268, lat: 25.63787, name: "福顺机械实业公司", carbon: 0, electricity: 0 }, |
|
|
|
|
{ lng: 112.375261, lat: 25.63742, name: "巨人机床实业公司", carbon: 0, electricity: 0 }, |
|
|
|
|
{ lng: 112.365047, lat: 25.630574, name: "郴州雄建实业公司", carbon: 0, electricity: 0 }, |
|
|
|
|
{ lng: 112.36587, lat: 25.63132, name: "众合实业公司", carbon: 0, electricity: 0 }, |
|
|
|
|
{ lng: 112.372727, lat: 25.635608, name: "雄达实业公司", carbon: 0, electricity: 0 }, |
|
|
|
|
{ lng: 112.373909, lat: 25.634179, name: "峰达实业公司", carbon: 0, electricity: 0 }, |
|
|
|
|
{ lng: 112.37275, lat: 25.63676, name: "伟铸机械实业公司", carbon: 0, electricity: 0 }, |
|
|
|
|
],//标注点记录 |
|
|
|
|
polyline: null,//昨日轨迹 |
|
|
|
|
viewData: [],//点聚合坐标集合 |
|
|
|
|
@ -84,6 +84,14 @@ export default { |
|
|
|
|
created() { |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.getData() |
|
|
|
|
// setTimeout(() => { |
|
|
|
|
// this.initMap(); |
|
|
|
|
// }, 0); |
|
|
|
|
// window.addEventListener('resize', () => { |
|
|
|
|
// if (this.baiduMap) { |
|
|
|
|
// this.backMap(); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
@ -93,12 +101,13 @@ export default { |
|
|
|
|
getData() { |
|
|
|
|
getEnterprisePower({ today: this.$moment().format('yyyy-MM-DD') }).then(res => { |
|
|
|
|
let data = res.data.data |
|
|
|
|
console.log(data, '.....') |
|
|
|
|
this.markList.forEach(e => { |
|
|
|
|
data.forEach(r => { |
|
|
|
|
|
|
|
|
|
if (e.name.includes(r.name)) { |
|
|
|
|
e.carbon = r.carbon |
|
|
|
|
e.electricity = r.electricity |
|
|
|
|
e.carbon = r.carbon || 0 |
|
|
|
|
e.electricity = r.electricity || 0 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
@ -130,9 +139,21 @@ export default { |
|
|
|
|
this.baiduMap.centerAndZoom(point, 12); |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
this.baiduMap = new BMapGL.Map('container'); |
|
|
|
|
|
|
|
|
|
this.baiduMap = new BMapGL.Map('container', {enableMapClick: false}); |
|
|
|
|
this.baiduMap.centerAndZoom(point, 12); |
|
|
|
|
this.baiduMap.enableScrollWheelZoom(true); |
|
|
|
|
this.baiduMap.setMinZoom(12); |
|
|
|
|
// this.baiduMap.setMaxZoom(12) |
|
|
|
|
// this.baiduMap.disableDragging(); |
|
|
|
|
// this.baiduMap.setCurrentCity('嘉禾县'); |
|
|
|
|
// var b = new BMapGL.Bounds(new BMapGL.Point(112.37558, 25.59342), new BMapGL.Point(112.832025, 40.126349)); |
|
|
|
|
// console.log(b) |
|
|
|
|
// try { |
|
|
|
|
// BMapLib.AreaRestriction.setBounds(this.baiduMap, b); |
|
|
|
|
// } catch (e) { |
|
|
|
|
// alert(e); |
|
|
|
|
// } |
|
|
|
|
// var opts = { type: BMAP_NAVIGATION_CONTROL_SMALL } |
|
|
|
|
// this.baiduMap.addControl(new BMapGL.NavigationControl(opts)); |
|
|
|
|
// this.baiduMap.setMapStyleV2({ style: 'midnight' }); |
|
|
|
|
@ -194,8 +215,8 @@ export default { |
|
|
|
|
} |
|
|
|
|
var prism = new BMapGL.Prism(path, 2000, { |
|
|
|
|
|
|
|
|
|
topFillColor: '#000', |
|
|
|
|
topFillOpacity: 0.6, |
|
|
|
|
topFillColor: '#8de0ff', |
|
|
|
|
topFillOpacity: 0.8, |
|
|
|
|
sideFillColor: '#0e2566', |
|
|
|
|
sideFillOpacity: 0.9 |
|
|
|
|
|
|
|
|
|
@ -203,10 +224,10 @@ export default { |
|
|
|
|
this.baiduMap.addOverlay(prism); |
|
|
|
|
// var prism1 = new BMapGL.Prism(path, 1000, { |
|
|
|
|
|
|
|
|
|
// topFillColor: '#000', |
|
|
|
|
// topFillOpacity: 0, |
|
|
|
|
// sideFillColor: '#fff', |
|
|
|
|
// sideFillOpacity: 0.9 |
|
|
|
|
// topFillColor: '#8dc6ff', |
|
|
|
|
// topFillOpacity: 0.3, |
|
|
|
|
// sideFillColor: '#8dc6ff', |
|
|
|
|
// sideFillOpacity: 0 |
|
|
|
|
|
|
|
|
|
// }); |
|
|
|
|
// this.baiduMap.addOverlay(prism1); |
|
|
|
|
|