更新历史轨迹

master
tangwenkang 2023-12-04 20:12:15 +08:00
parent fe812456ca
commit 22be268e77
1 changed files with 8 additions and 1 deletions

View File

@ -4,6 +4,7 @@
<div id="container" ></div>
<el-button type="primary" @click="isShowAll"></el-button>
</div>
<p v-for="(msg, index) in carMsg" :key="index">{{msg}}</p>
<div v-show="!isList">
<el-form :model="form" ref="myForm">
@ -203,6 +204,7 @@ export default {
},
data() {
return {
vinId:null,
carList:[],
total:0,
form:{
@ -244,6 +246,8 @@ export default {
marker: null,
lineArr: [],
vin:null,
carMsg:[],
vehicle:null
};
},
mounted() {
@ -253,12 +257,13 @@ export default {
this.getList()
this.listCarType()
this.listFence()
this.vehicle = setInterval(this.listRealTime,1000)
},
methods: {
//
listRealTime(){
listRealTime(this.vin).then(res=>{
this.carMsg.push(res.data)
})
},
/*重置表单*/
@ -305,6 +310,7 @@ export default {
},
/*地图展示*/
realTimeTrajectory(carVin){
this.vinId = carVin
this.vin = carVin
realTime(this.vin).then(res=>{
if(res.code !== 200){
@ -315,6 +321,7 @@ export default {
this.isShow = false
this.isList = true
this.initMap()
alert(this.vinId)
this.startAnimation()
},
/*刷新*/