更新实时轨迹4
parent
4e8bb66df8
commit
d76730c520
|
@ -244,6 +244,8 @@ export default {
|
||||||
marker: null,
|
marker: null,
|
||||||
lineArr: [],
|
lineArr: [],
|
||||||
vin:null,
|
vin:null,
|
||||||
|
carMsg:null,
|
||||||
|
carMsgTwo:{},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -253,18 +255,17 @@ export default {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.listCarType()
|
this.listCarType()
|
||||||
this.listFence()
|
this.listFence()
|
||||||
this.realMsg()
|
this.carMsg = setInterval(this.listRealTime,1000)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
realMsg(){
|
|
||||||
setInterval(() => {
|
|
||||||
// 在这里执行后台拉取数据的操作
|
// 在这里执行后台拉取数据的操作
|
||||||
|
listRealTime(){
|
||||||
listRealTime(this.vin).then(res=>{
|
listRealTime(this.vin).then(res=>{
|
||||||
|
console.log(res)
|
||||||
|
this.carMsgTwo = res.data
|
||||||
this.lineArr.push(res.longitude.replace(/"/g, "") +","+res.latitude.replace(/"/g, ""))
|
this.lineArr.push(res.longitude.replace(/"/g, "") +","+res.latitude.replace(/"/g, ""))
|
||||||
})
|
})
|
||||||
}, 1000); // 每秒执行一次操作
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/*重置表单*/
|
/*重置表单*/
|
||||||
resetForm() {
|
resetForm() {
|
||||||
this.form = { // 这里将form对象重置为空对象或者你定义的初始值
|
this.form = { // 这里将form对象重置为空对象或者你定义的初始值
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script >
|
<script>
|
||||||
import AMapLoader from '@amap/amap-jsapi-loader';
|
import AMapLoader from '@amap/amap-jsapi-loader';
|
||||||
import {deleteRecord, getList, historyMap} from "@/api/table";
|
import {deleteRecord, getList, historyMap} from "@/api/table";
|
||||||
import data from "@/views/system/dict/data.vue";
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
props: {},
|
props: {},
|
||||||
|
@ -18,10 +18,12 @@ export default {
|
||||||
endTime:null
|
endTime:null
|
||||||
},
|
},
|
||||||
arr:[],
|
arr:[],
|
||||||
lineArr:null
|
lineArr:null,
|
||||||
|
carMsg:{}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
@ -45,11 +47,9 @@ export default {
|
||||||
this.recordCar.endTime = recordCar.endTime
|
this.recordCar.endTime = recordCar.endTime
|
||||||
historyMap(this.recordCar).then(res=>{
|
historyMap(this.recordCar).then(res=>{
|
||||||
res.data.forEach(item=>{
|
res.data.forEach(item=>{
|
||||||
|
this.carMsg = item
|
||||||
this.arr.push(item.longitude.replace(/"/g, "") +","+item.latitude.replace(/"/g, ""))
|
this.arr.push(item.longitude.replace(/"/g, "") +","+item.latitude.replace(/"/g, ""))
|
||||||
console.log(this.arr)
|
this.lineArr = this.arr.map(item => item.trim().replace(/'/g, '').split(','))
|
||||||
const result = this.arr.map(item => item.trim().replace(/'/g, '').split(','));
|
|
||||||
console.log(result)
|
|
||||||
this.lineArr = result
|
|
||||||
console.log(this.lineArr)
|
console.log(this.lineArr)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -137,6 +137,7 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<p>{{carMsg}}</p>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-form>
|
<el-form>
|
||||||
|
|
Loading…
Reference in New Issue