更新历史轨迹
parent
e0c1e4dbc9
commit
4159aa3544
|
@ -244,8 +244,6 @@ export default {
|
||||||
marker: null,
|
marker: null,
|
||||||
lineArr: [],
|
lineArr: [],
|
||||||
vin:null,
|
vin:null,
|
||||||
carMsg:null,
|
|
||||||
carMsgTwo:{},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
@ -255,15 +253,12 @@ export default {
|
||||||
this.getList()
|
this.getList()
|
||||||
this.listCarType()
|
this.listCarType()
|
||||||
this.listFence()
|
this.listFence()
|
||||||
this.carMsg = setInterval(this.listRealTime,1000)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 在这里执行后台拉取数据的操作
|
// 在这里执行后台拉取数据的操作
|
||||||
listRealTime(){
|
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, ""))
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/*重置表单*/
|
/*重置表单*/
|
||||||
|
@ -279,9 +274,11 @@ export default {
|
||||||
this.$refs.myForm.resetFields(); // 重置表单验证状态
|
this.$refs.myForm.resetFields(); // 重置表单验证状态
|
||||||
},
|
},
|
||||||
isShowAll(){
|
isShowAll(){
|
||||||
|
removeRealTime().then(res=>{
|
||||||
|
|
||||||
|
})
|
||||||
this.isShow = true
|
this.isShow = true
|
||||||
this.isList = false
|
this.isList = false
|
||||||
// this.map.destroy();//离开页面,销毁掉
|
|
||||||
location.reload()
|
location.reload()
|
||||||
},
|
},
|
||||||
insertCar(){
|
insertCar(){
|
||||||
|
@ -310,7 +307,7 @@ export default {
|
||||||
realTimeTrajectory(carVin){
|
realTimeTrajectory(carVin){
|
||||||
this.vin = carVin
|
this.vin = carVin
|
||||||
realTime(this.vin).then(res=>{
|
realTime(this.vin).then(res=>{
|
||||||
if(res.code!== 200){
|
if(res.code !== 200){
|
||||||
this.$message.error("获取实时轨迹失败!")
|
this.$message.error("获取实时轨迹失败!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,16 +19,28 @@ export default {
|
||||||
},
|
},
|
||||||
arr:[],
|
arr:[],
|
||||||
lineArr:null,
|
lineArr:null,
|
||||||
carMsg:[],
|
recordCarList: [] , // 存储获取到的对象集合
|
||||||
|
currentIndex: 0, // 当前展示的对象索引
|
||||||
|
currentObject: "" // 当前展示的对象内容
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.doDo();
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList()
|
this.getList()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
startDisplay() {
|
||||||
|
// 启动定时器,每秒展示一个对象
|
||||||
|
setInterval(() => {
|
||||||
|
if (this.currentIndex < this.recordCarList.length) {
|
||||||
|
// 当前索引小于集合长度时,更新展示的对象内容
|
||||||
|
this.currentObject = JSON.stringify(this.recordCarList[this.currentIndex]);
|
||||||
|
this.currentIndex++;
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
},
|
||||||
deleteRecord(recordId){
|
deleteRecord(recordId){
|
||||||
this.recordId = recordId
|
this.recordId = recordId
|
||||||
deleteRecord(this.recordId).then(res=>{
|
deleteRecord(this.recordId).then(res=>{
|
||||||
|
@ -46,13 +58,13 @@ export default {
|
||||||
this.recordCar.startTime = recordCar.startTime
|
this.recordCar.startTime = recordCar.startTime
|
||||||
this.recordCar.endTime = recordCar.endTime
|
this.recordCar.endTime = recordCar.endTime
|
||||||
historyMap(this.recordCar).then(res=>{
|
historyMap(this.recordCar).then(res=>{
|
||||||
console.log(res)
|
this.recordCarList = res; // 将获取到的对象集合存储到data中
|
||||||
this.carMsg = res.data
|
this.startDisplay(); // 开始展示
|
||||||
res.data.forEach(item=>{
|
let coordinates = res.data.map(obj => [
|
||||||
this.arr.push(item.longitude.replace(/"/g, "") +","+item.latitude.replace(/"/g, ""))
|
parseFloat(obj.longitude.replace(/"/g, "")),
|
||||||
this.lineArr = this.arr.map(item => item.trim().replace(/'/g, '').split(','))
|
parseFloat(obj.latitude.replace(/"/g, ""))
|
||||||
console.log(this.lineArr)
|
]);
|
||||||
})
|
this.lineArr = [coordinates]
|
||||||
})
|
})
|
||||||
this.initMap()
|
this.initMap()
|
||||||
this.startAnimation()
|
this.startAnimation()
|
||||||
|
@ -138,54 +150,7 @@ export default {
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-for="car in carMsg" :key="car.id">
|
<p>{{currentObject}}</p>
|
||||||
<p>主键id:{{car.id}}</p>
|
|
||||||
<p>VIN:{{car.vin}}</p>
|
|
||||||
<p>时间戳:{{car.createTime}}</p>
|
|
||||||
<p>经度:{{car.longitude}}</p>
|
|
||||||
<p>维度:{{car.latitude}}</p>
|
|
||||||
<p>速度:{{car.speed}}</p>
|
|
||||||
<p>里程:{{car.mileage}}</p>
|
|
||||||
<p>总电压:{{car.voltage}}</p>
|
|
||||||
<p>总电流:{{car.current}}</p>
|
|
||||||
<p>绝缘电阻:{{car.resistance}}</p>
|
|
||||||
<p>档位:{{car.gear}}</p>
|
|
||||||
<p>加速踏板行程值:{{car.accelerationPedal}}</p>
|
|
||||||
<p>制动踏板行程值:{{car.brakePedal}}</p>
|
|
||||||
<p>燃料消耗率:{{car.fuelConsumptionRate}}</p>
|
|
||||||
<p>电机控制器温度:{{car.motorControllerTemperature}}</p>
|
|
||||||
<p>电机转速:{{car.motorSpeed}}</p>
|
|
||||||
<p>电机转矩:{{car.motorTorque}}</p>
|
|
||||||
<p>电机温度:{{car.motorTemperature}}</p>
|
|
||||||
<p>电机电压:{{car.motorVoltage}}</p>
|
|
||||||
<p>电机电流:{{car.motorCurrent}}</p>
|
|
||||||
<p>动力电池剩余电量SOC:{{car.remainingBattery}}</p>
|
|
||||||
<p>当前状态允许的最大反馈功率:{{car.maximumFeedbackPower}}</p>
|
|
||||||
<p>当前状态允许最大放电功率:{{car.maximumDischargePower}}</p>
|
|
||||||
<p>BMS自检计数器:{{car.selfCheckCounter}}</p>
|
|
||||||
<p>动力电池充放电电流:{{car.totalBatteryCurrent}}</p>
|
|
||||||
<p>动力电池负载端总电压V3:{{car.totalBatteryVoltage}}</p>
|
|
||||||
<p>单次最大电压:{{car.singleBatteryMaxVoltage}}</p>
|
|
||||||
<p>单体电池最低电压:{{car.singleBatteryMinVoltage}}</p>
|
|
||||||
<p>单体电池最高温度:{{car.singleBatteryMaxTemperature}}</p>
|
|
||||||
<p>单体电池最低温度:{{car.singleBatteryMinTemperature}}</p>
|
|
||||||
<p>动力电池可用容量:{{car.availableBatteryCapacity}}</p>
|
|
||||||
<p>车辆状态:{{car.vehicleStatus}}</p>
|
|
||||||
<p>充电状态:{{car.chargingStatus}}</p>
|
|
||||||
<p>运行状态:{{car.operatingStatus}}</p>
|
|
||||||
<p>SOC:{{car.socStatus}}</p>
|
|
||||||
<p>可充电储能装置工作状态:{{car.chargingEnergyStorageStatus}}</p>
|
|
||||||
<p>驱动电机状态:{{car.driveMotorStatus}}</p>
|
|
||||||
<p>定位是否有效:{{car.positionStatus}}</p>
|
|
||||||
<p>EAS(汽车防盗系统)状态:{{car.easStatus}}</p>
|
|
||||||
<p>PTC(电动加热器)状态:{{car.ptcStatus}}</p>
|
|
||||||
<p>EPS(电动助力系统)状态:{{car.epsStatus}}</p>
|
|
||||||
<p>ABS(防抱死)状态:{{car.absStatus}}</p>
|
|
||||||
<p>MCU(电机/逆变器)状态:{{car.mcuStatus}}</p>
|
|
||||||
<p>动力电池加热状态:{{car.heatingStatus}}</p>
|
|
||||||
<p>动力电池当前状态:{{car.batteryStatus}}</p>
|
|
||||||
<p>动力电池保温状态:{{car.batteryInsulationStatus}}</p>
|
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<el-form>
|
<el-form>
|
||||||
|
|
Loading…
Reference in New Issue