diff --git a/src/views/components/carWarn.vue b/src/views/components/carWarn.vue
index d70392a..923c893 100644
--- a/src/views/components/carWarn.vue
+++ b/src/views/components/carWarn.vue
@@ -86,21 +86,23 @@ export default {
"StartTime": dateFormat(new Date(yesterDay2), 'yyyy-MM-dd'),
"EndTime": dateFormat(new Date(yesterDay1), 'yyyy-MM-dd')
}
- this.carList.map(item => {
- param.Imei = item.deviceId;
+ // this.carList.map(item => {
+ // param.Imei = item.deviceId;
lunzApi.getMessInfoByMessType(key, param).then(res => {
let resData = res.Data;
let arr = [];
resData.map(item => {
let idx = this.carList.findIndex(item2 => item2.deviceId == item.Imei);
- item.carNo = idx > -1 ? this.carList[idx].cardNo : '-';
- item.TimeStamp = dateFormat(new Date(item.TimeStamp), 'yyyy-MM-dd hh:mm:ss')
- arr.push(item);
+ if(idx > -1){
+ item.carNo = idx > -1 ? this.carList[idx].cardNo : '-';
+ item.TimeStamp = dateFormat(new Date(item.TimeStamp), 'yyyy-MM-dd hh:mm:ss')
+ arr.push(item);
+ }
})
this.carWarn = this.carWarn.concat(arr);
// this.classOption.limitMoveNum = this.carWarn.length;
})
- })
+ // })
},
},
diff --git a/src/views/components/pathMap.vue b/src/views/components/pathMap.vue
index 4c7834d..855d3ab 100644
--- a/src/views/components/pathMap.vue
+++ b/src/views/components/pathMap.vue
@@ -6,7 +6,8 @@
x
{{ infoWindowObj.carNo }}
-
{{ locationStatus[infoWindowObj.obj.SbcStatus] }}
+
{{
+ locationStatus[infoWindowObj.obj.SbcStatus] }}
{{ infoWindowObj.obj.spd }}km/h
@@ -18,7 +19,7 @@
{{ infoWindowObj.obj.GPSTimeStamp }}
@@ -73,6 +74,10 @@ export default {
var point = new BMap.Point(118.880278, 35.649947);
this.infoShow = false;
this.baiduMap.centerAndZoom(point, 11);
+ if (this.polyline) {
+ this.baiduMap.removeOverlay(this.polyline);
+ this.polyline = null;
+ }
// this.baiduMap.closeInfoWindow();
},
initMap() {
@@ -84,6 +89,8 @@ export default {
this.baiduMap = new BMap.Map('container');
this.baiduMap.centerAndZoom(point, 11);
this.baiduMap.enableScrollWheelZoom(true);
+ // var opts = { type: BMAP_NAVIGATION_CONTROL_SMALL }
+ // this.baiduMap.addControl(new BMap.NavigationControl(opts));
this.baiduMap.setMapStyle({ style: 'midnight' });
// this.baiduMap.setMapStyleV2({
// styleJson: styleJson
@@ -190,7 +197,7 @@ export default {
// })
this.markList.push(marker);
res.Data.GPSTimeStamp = res.Data.GPSTimeStamp.replace("T", " ");
-
+
// let sContent = `
//
x
//
@@ -214,6 +221,7 @@ export default {
// });
marker.addEventListener('click', () => {
this.infoWindowObj = {
+ deviceId: deviceId,
carNo: carNo,
obj: res.Data,
position: res2.Data
@@ -239,6 +247,7 @@ export default {
},
//昨日轨迹
queryPath(deviceId) {
+ this.infoShow = false;
let now = new Date();
let yesterDay1 = now.setDate(now.getDate() - 1);
let yesterDay2 = now.setDate(now.getDate() - 1);
@@ -361,7 +370,7 @@ export default {
border-radius: 100px;
font-size: 0.16rem;
padding: 0.04rem 0;
- margin-left:0.15rem;
+ margin-left: 0.15rem;
&.on {
color: #ffffff;
@@ -378,7 +387,7 @@ export default {
.flex_box {
display: flex;
padding: 0 0.2rem;
- margin-bottom:0.1rem;
+ margin-bottom: 0.1rem;
}
.path_box {