2023-09-20 21:33:11 +08:00
|
|
|
<template>
|
2024-07-25 00:32:23 +08:00
|
|
|
<div class="mainBox flex ofh column no-select">
|
2024-07-24 20:50:34 +08:00
|
|
|
<!-- 心跳 -->
|
2024-07-25 00:32:23 +08:00
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont"
|
|
|
|
:class="online ? heartAnimation ? 'icon-heart online' : 'icon-heart1 online' : 'icon-xinsui offline'">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 锁定状态 -->
|
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont" :class="isLockState ? 'icon-suoding' : 'icon-jiesuo'">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 飞机模式 -->
|
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont icon-moshixuanze">
|
|
|
|
</div>
|
2024-07-24 20:50:34 +08:00
|
|
|
</div>
|
|
|
|
<!-- 卫星 -->
|
2024-07-25 00:32:23 +08:00
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont icon-weixing">
|
|
|
|
</div>
|
|
|
|
<!-- <div class=" tag flex mac mc f-s-16">
|
|
|
|
{{ satCount }}颗
|
|
|
|
</div> -->
|
|
|
|
</div>
|
|
|
|
<!-- 电池电压 -->
|
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont icon-dianya1">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 电池电流 -->
|
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont icon-dianliu">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 飞机高度 -->
|
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont icon-gaodu">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 飞机对地速度 -->
|
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont icon-sudu">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- 钩子状态 1px solid #ddd-->
|
|
|
|
<div class="flex">
|
|
|
|
<div class="tag flex mac mc iconfont icon-mianxingdiaogou">
|
|
|
|
</div>
|
2024-07-24 20:50:34 +08:00
|
|
|
</div>
|
2024-07-19 20:48:06 +08:00
|
|
|
</div>
|
|
|
|
|
2023-09-20 21:33:11 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'PlaneStatus',
|
|
|
|
data () {
|
|
|
|
return {
|
2024-07-24 20:50:34 +08:00
|
|
|
/* 心跳 */
|
|
|
|
heartAnimation: false, // 控制心跳动画图标
|
|
|
|
online: false,
|
|
|
|
isOnlineSetTimeout: null
|
2023-09-20 21:33:11 +08:00
|
|
|
}
|
|
|
|
},
|
2024-07-10 19:36:33 +08:00
|
|
|
props: {
|
|
|
|
plane: {
|
|
|
|
typeof: 'Object',
|
|
|
|
deep: true
|
|
|
|
}
|
|
|
|
},
|
2023-09-20 21:33:11 +08:00
|
|
|
components: {
|
|
|
|
},
|
|
|
|
computed: {
|
2024-07-24 20:50:34 +08:00
|
|
|
// 心跳随机数
|
|
|
|
heartRandom () {
|
|
|
|
if (this.plane && this.plane.planeState) {
|
|
|
|
return this.plane.planeState.heartRandom
|
|
|
|
}
|
2024-07-25 00:32:23 +08:00
|
|
|
return null
|
|
|
|
},
|
|
|
|
// 锁定状态
|
|
|
|
isLockState () {
|
|
|
|
if (this.plane && this.plane.planeState) {
|
|
|
|
if (Number(this.plane.planeState.heartBeat) & 128) {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true
|
2024-07-24 20:50:34 +08:00
|
|
|
},
|
|
|
|
// 卫星数
|
|
|
|
satCount () {
|
|
|
|
if (this.plane && this.plane.planeState) {
|
|
|
|
return this.plane.planeState.satCount
|
|
|
|
}
|
|
|
|
return 0
|
|
|
|
}
|
2023-09-20 21:33:11 +08:00
|
|
|
},
|
|
|
|
watch: {
|
2024-07-24 20:50:34 +08:00
|
|
|
heartRandom: {
|
|
|
|
handler (val) {
|
|
|
|
// 心跳动画
|
|
|
|
this.heartAnimation = true
|
|
|
|
setTimeout(() => {
|
|
|
|
this.heartAnimation = false
|
|
|
|
}, 500)
|
|
|
|
// 在线状态
|
|
|
|
if (this.isOnlineSetTimeout) { // 进入本次心跳 删除掉线计时 既以下会重新计时
|
|
|
|
clearInterval(this.isOnlineSetTimeout)
|
|
|
|
}
|
|
|
|
this.online = true
|
|
|
|
this.isOnlineSetTimeout = setTimeout(() => { // 计时10秒后 掉线
|
|
|
|
this.online = false
|
|
|
|
}, 10000)
|
|
|
|
}
|
|
|
|
}
|
2023-09-20 21:33:11 +08:00
|
|
|
},
|
|
|
|
methods: {},
|
|
|
|
created () {
|
2024-07-24 19:50:25 +08:00
|
|
|
|
2023-09-20 21:33:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import "@/styles/theme.scss";
|
2024-07-24 20:50:34 +08:00
|
|
|
|
|
|
|
.mainBox {
|
|
|
|
position: absolute;
|
|
|
|
top: 12px;
|
|
|
|
left: 12px;
|
|
|
|
z-index: 90;
|
2024-07-25 00:32:23 +08:00
|
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
|
2024-07-24 20:50:34 +08:00
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
|
2024-07-25 00:32:23 +08:00
|
|
|
.mainBox .flex:not(:first-child) {
|
|
|
|
border-top: 1px solid #ddd;
|
|
|
|
}
|
|
|
|
|
2024-07-24 20:50:34 +08:00
|
|
|
.tag {
|
|
|
|
height: 29px;
|
|
|
|
min-width: 29px;
|
|
|
|
background-color: white;
|
|
|
|
cursor: pointer;
|
|
|
|
border: 0;
|
|
|
|
overflow: hidden;
|
2024-07-25 00:32:23 +08:00
|
|
|
font-size: 22px;
|
2024-07-24 20:50:34 +08:00
|
|
|
}
|
2023-09-20 21:33:11 +08:00
|
|
|
</style>
|