diff --git a/src/views/vehicle/car.vue b/src/views/vehicle/car.vue index 9a1ab97..95037ac 100644 --- a/src/views/vehicle/car.vue +++ b/src/views/vehicle/car.vue @@ -253,8 +253,18 @@ export default { this.getList() this.listCarType() this.listFence() + this.realMsg() }, methods: { + realMsg(){ + setInterval(() => { + // 在这里执行后台拉取数据的操作 + listRealTime(this.vin).then(res=>{ + this.lineArr.push(res.longitude.replace(/"/g, "") +","+res.latitude.replace(/"/g, "")) + }) + }, 1000); // 每秒执行一次操作 + }, + /*重置表单*/ resetForm() { this.form = { // 这里将form对象重置为空对象或者你定义的初始值 @@ -308,12 +318,6 @@ export default { this.isList = true this.initMap() this.startAnimation() - setInterval(() => { - // 在这里执行后台拉取数据的操作 - listRealTime(this.vin).then(res=>{ - this.lineArr.push(res.longitude.replace(/"/g, "") +","+res.latitude.replace(/"/g, "")) - }) - }, 1000); // 每秒执行一次操作 }, /*刷新*/ refreshTable(){