diff --git a/src/views/vehicle/record.vue b/src/views/vehicle/record.vue index 61fd2f5..bdb26f2 100644 --- a/src/views/vehicle/record.vue +++ b/src/views/vehicle/record.vue @@ -19,11 +19,13 @@ export default { }, arr:[], lineArr:null, - carMsg:{} + carMsg:[] } }, mounted() { - + setInterval(() => { + this.historyMap(); + }, 1000); }, created() { this.getList() @@ -46,12 +48,13 @@ export default { this.recordCar.startTime = recordCar.startTime this.recordCar.endTime = recordCar.endTime historyMap(this.recordCar).then(res=>{ - res.data.forEach(item=>{ - this.carMsg = item - this.arr.push(item.longitude.replace(/"/g, "") +","+item.latitude.replace(/"/g, "")) - this.lineArr.push(this.arr) - console.log(this.lineArr) - }) + this.carMsg = res.data + // res.data.forEach(item=>{ + // this.carMsg = item + // this.arr.push(item.longitude.replace(/"/g, "") +","+item.latitude.replace(/"/g, "")) + // this.lineArr = this.arr.map(item => item.trim().replace(/'/g, '').split(',')) + // console.log(this.lineArr) + // }) }) this.initMap() this.startAnimation() @@ -137,7 +140,54 @@ export default {