【类 型】:fix 订阅信息 飞机状态赋值bug
【原 因】:心跳的数据没有写道飞机状态属性里面 【过 程】: 【影 响】:
This commit is contained in:
parent
19264a63d8
commit
dafe9cc197
@ -9,7 +9,6 @@
|
|||||||
<!-- 锁定状态 -->
|
<!-- 锁定状态 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="tag flex mac mc iconfont" :class="isLockState ? 'icon-suoding' : 'icon-jiesuo'">
|
<div class="tag flex mac mc iconfont" :class="isLockState ? 'icon-suoding' : 'icon-jiesuo'">
|
||||||
{{ plane.planeState.state }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 飞机模式 -->
|
<!-- 飞机模式 -->
|
||||||
@ -20,28 +19,21 @@
|
|||||||
<!-- 卫星 -->
|
<!-- 卫星 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="tag flex mac mc iconfont icon-weixing">
|
<div class="tag flex mac mc iconfont icon-weixing">
|
||||||
{{ plane.planeState.fixType }}
|
|
||||||
</div>
|
|
||||||
<div class=" tag flex mac mc f-s-16">
|
|
||||||
{{ satCount }}颗
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 电池电压 -->
|
<!-- 电池电压 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="tag flex mac mc iconfont icon-dianya1">
|
<div class="tag flex mac mc iconfont icon-dianya1">
|
||||||
{{ plane.planeState.voltagBattery }}V
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 电池电流 -->
|
<!-- 电池电流 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="tag flex mac mc iconfont icon-dianliu">
|
<div class="tag flex mac mc iconfont icon-dianliu">
|
||||||
{{ plane.planeState.currentBattery }}A
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 飞机高度 -->
|
<!-- 飞机高度 -->
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="tag flex mac mc iconfont icon-gaodu">
|
<div class="tag flex mac mc iconfont icon-gaodu">
|
||||||
{{ plane.planeState.battCapacity }}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 飞机对地速度 -->
|
<!-- 飞机对地速度 -->
|
||||||
@ -122,9 +114,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {
|
||||||
created () {
|
|
||||||
|
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
setInterval(() => {
|
||||||
|
console.log(this.plane.planeState)
|
||||||
|
}, 2000)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -88,8 +88,8 @@ export default {
|
|||||||
// 更新mqtt信息 选择性更新状态
|
// 更新mqtt信息 选择性更新状态
|
||||||
for (const key in jsonData) {
|
for (const key in jsonData) {
|
||||||
if (key === 'heartBeat') {
|
if (key === 'heartBeat') {
|
||||||
// 每次接收到心跳 heartRandom属性 创建一个随机数 用于watch监听
|
plane.planeState.heartRandom = Math.random()// 每次接收到心跳 heartRandom属性 创建一个随机数 用于watch监听
|
||||||
plane.planeState.heartRandom = Math.random()
|
plane.planeState[key] = jsonData[key] // 按订阅信息 刷新飞机状态
|
||||||
} else if (key === 'position') {
|
} else if (key === 'position') {
|
||||||
// 如果是飞机位置信息 则不是直接刷新状态 而是累计 到数组 以便于画出飞机路径
|
// 如果是飞机位置信息 则不是直接刷新状态 而是累计 到数组 以便于画出飞机路径
|
||||||
const position = JSON.parse(jsonData.position)
|
const position = JSON.parse(jsonData.position)
|
||||||
|
Loading…
Reference in New Issue
Block a user