|
|
|
|
@ -29,15 +29,13 @@ export default { |
|
|
|
|
beforeCreate() { |
|
|
|
|
clearInterval(this.setInterval); |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.initMap(); |
|
|
|
|
window.addEventListener('resize', () => { |
|
|
|
|
// if (this.setInterval) { |
|
|
|
|
// clearInterval(this.setInterval); |
|
|
|
|
// } |
|
|
|
|
// this.initMap(); |
|
|
|
|
if (this.baiduMap) { |
|
|
|
|
this.baiduMap.centerAndZoom(point, 11); |
|
|
|
|
this.backMap(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
@ -56,7 +54,7 @@ export default { |
|
|
|
|
this.baiduMap = new BMap.Map('container'); |
|
|
|
|
this.baiduMap.centerAndZoom(point, 11); |
|
|
|
|
this.baiduMap.enableScrollWheelZoom(true); |
|
|
|
|
this.baiduMap.setMapStyle({style:'midnight'}); |
|
|
|
|
this.baiduMap.setMapStyle({ style: 'midnight' }); |
|
|
|
|
// this.baiduMap.setMapStyleV2({ |
|
|
|
|
// styleJson: styleJson |
|
|
|
|
// }) |
|
|
|
|
@ -111,7 +109,9 @@ export default { |
|
|
|
|
this.queryLunz(item.deviceId, item.key, item.cardNo, index); |
|
|
|
|
}) |
|
|
|
|
clearInterval(this.setInterval); |
|
|
|
|
let timer = 0; |
|
|
|
|
this.setInterval = setInterval(() => { |
|
|
|
|
console.log(timer++) |
|
|
|
|
// this.view.removeAllLayers(); |
|
|
|
|
this.markList.map(mark => { |
|
|
|
|
this.baiduMap.removeOverlay(mark); |
|
|
|
|
@ -161,12 +161,12 @@ export default { |
|
|
|
|
let sContent = `<div style="font-size:0.14rem;line-height:0.22rem;padding:0 0.05rem 0 0.25rem;"> |
|
|
|
|
<div style="display:flex;align-items:center;margin-bottom:0.15rem;font-style: italic;font-size:0.2rem;font-family: FZSK;"> |
|
|
|
|
<div style="color: #ffffff;margin-right:0.1rem;">${carNo}</div> |
|
|
|
|
<div style="display:inline-block;color:${res.Data.SbcStatus == 3 ? "#ffffff" : "#062766"};background:${res.Data.SbcStatus == 3 ? "#1dd58e !important" : "#9ab3c6 !important"};width:0.65rem;height:0.24rem;line-height:0.24rem;text-align:center;border-radius:0.12rem;font-size:0.16rem;">${this.locationStatus[res.Data.SbcStatus]}</div> |
|
|
|
|
<div style="display:inline-block;color:${res.Data.SbcStatus == 3 ? "#ffffff" : "#062766"};background:${res.Data.SbcStatus == 3 ? "#1dd58e !important" : "#9ab3c6 !important"};width:0.65rem;text-align:center;border-radius:100px;font-size:0.16rem;padding:0.04rem 0;">${this.locationStatus[res.Data.SbcStatus]}</div> |
|
|
|
|
<div style="margin-left:0.35rem;color: #fff;font-style: italic;font-size:0.2rem;margin-right:0.15rem;">${res.Data.spd}km/h</div> |
|
|
|
|
</div> |
|
|
|
|
<div style="display:flex;margin-bottom:0.1rem;max-width:3.2rem;"><div style="color: #ffffff;">设备位置:</div><div style="color: #ffffff;flex:1;">${res2.Data}</div></div> |
|
|
|
|
<div style="display:flex;margin-bottom:0.1rem;max-width:3.5rem;"><div style="color: #ffffff;">设备位置:</div><div style="color: #ffffff;flex:1;">${res2.Data}</div></div> |
|
|
|
|
<div style="display:flex;"><div style="color: #ffffff;">最后定位时间:</div><div style="color: #ffffff;flex:1;">${res.Data.GPSTimeStamp.replace("T", " ")}</div></div> |
|
|
|
|
<div style="text-align:center;margin:0.12rem 0 0;max-width:3.25rem;"> <div style="display: inline-block;width:0.88rem;height:0.3rem;line-height:0.3rem;border-radius: 0.15rem;text-align:center;color: #1b2f57;font-style: italic;font-family: FZSK;cursor: pointer;background:#facd89 !important;font-size:0.18rem;font-weight:bold;" id="btnPath_${deviceId}">行车轨迹</div></div> |
|
|
|
|
<div style="text-align:center;margin:0.12rem 0 0;max-width:3.25rem;"> <div style="display: inline-block;width:0.88rem;border-radius: 100px;text-align:center;color: #1b2f57;font-style: italic;font-family: FZSK;cursor: pointer;background:#facd89 !important;font-size:0.18rem;font-weight:bold;padding:0.06rem 0;" id="btnPath_${deviceId}">行车轨迹</div></div> |
|
|
|
|
</div>`; |
|
|
|
|
let infoWindow = new BMap.InfoWindow(sContent, { width: 367, height: 220 }); |
|
|
|
|
// marker添加点击事件 |
|
|
|
|
@ -255,10 +255,10 @@ export default { |
|
|
|
|
} |
|
|
|
|
param = { |
|
|
|
|
"IMEI": deviceId, |
|
|
|
|
"StartDateTime":dateFormat(new Date(yesterDay2), 'yyyy-MM-dd'), |
|
|
|
|
"EndDateTime":dateFormat(new Date(yesterDay1), 'yyyy-MM-dd'), |
|
|
|
|
"MaxValues":500, |
|
|
|
|
"LocType":1 |
|
|
|
|
"StartDateTime": dateFormat(new Date(yesterDay2), 'yyyy-MM-dd'), |
|
|
|
|
"EndDateTime": dateFormat(new Date(yesterDay1), 'yyyy-MM-dd'), |
|
|
|
|
"MaxValues": 500, |
|
|
|
|
"LocType": 1 |
|
|
|
|
} |
|
|
|
|
lunzApi.getLocationsByImei2(this.appKey, param).then(res => { |
|
|
|
|
if (res.Data == null) { |
|
|
|
|
|