【类 型】:fix
【原 因】:异步加载禁飞区数据 后刷新地图组件 导致无人机图标显示异常 【过 程】:暂时取消加载玩禁飞区 刷新 【影 响】: # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动
This commit is contained in:
parent
c8da790f64
commit
df9379ecf4
16
src/assets/svg/civil.svg
Normal file
16
src/assets/svg/civil.svg
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 25.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 128 128" style="enable-background:new 0 0 128 128;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#F15A29;}
|
||||||
|
</style>
|
||||||
|
<path class="st0" d="M124.5,80.4l-1.9-4.7c-0.5-1.2-1.4-2.2-2.6-2.9L87.5,55.8L86,55c0.2-2.1,0.3-4.9,0.3-7l0-1.6
|
||||||
|
c0-0.9-1.7-1.6-3.9-1.6c-2.1,0-3.9,0.7-3.9,1.6l0,1.5c0,1,0,2.1,0.1,3.2l-7.2-3.8l0-19.2c0-3.8-0.8-7.6-2.3-11.1L66.1,10
|
||||||
|
c-0.8-1.9-3.4-1.9-4.2,0l-3.1,7.2c-1.5,3.5-2.3,7.3-2.3,11.1l0,19.2l-7.2,3.8c0-1.1,0.1-2.3,0.1-3.2l0-1.5c0-0.9-1.7-1.6-3.9-1.6
|
||||||
|
c-2.1,0-3.9,0.7-3.9,1.6l0,1.6c0,2.1,0.1,4.9,0.3,7l-1.5,0.8L8,72.9c-1.2,0.6-2.1,1.6-2.6,2.9l-1.9,4.7c-0.2,0.4,0.2,0.8,0.6,0.7
|
||||||
|
l35.1-10.9c2-0.6,4-0.9,6-1l11.2-0.3l0,18.2c0,2.5,0.3,5,0.9,7.5l1.4,6.8l-15.3,9.9c-1.1,0.7-1.8,1.9-1.8,3.2l0,2c0,0,0.1,0,0.1,0.1
|
||||||
|
l18.6-5.2c0.3-0.1,0.5,0.1,0.6,0.3l2.1,7c0.3,0.9,1.5,0.9,1.8,0l2.1-7c0.1-0.3,0.4-0.4,0.6-0.3l18.6,5.2c0,0,0.1,0,0.1-0.1l0-2
|
||||||
|
c0-1.3-0.7-2.5-1.7-3.2l-15.3-9.9l1.4-6.8c0.6-2.4,0.9-5,0.9-7.5l0-18.2l11.2,0.3c2.1,0.1,4.1,0.4,6,1l35.1,10.9
|
||||||
|
C124.3,81.2,124.7,80.8,124.5,80.4z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
@ -976,8 +976,6 @@ export default {
|
|||||||
* @param {*} item 对应下拉框的任务
|
* @param {*} item 对应下拉框的任务
|
||||||
*/
|
*/
|
||||||
isWaring (item) {
|
isWaring (item) {
|
||||||
console.error('当前飞机ID:', item.total_weight)
|
|
||||||
|
|
||||||
const isOverWaight = Number(item.total_weight) >= Number(this.plane.weight_max)// 是否超重
|
const isOverWaight = Number(item.total_weight) >= Number(this.plane.weight_max)// 是否超重
|
||||||
const isQuestIng = (item.runing ?? '').split(',').some(i => i !== '') // 是否有飞机正在执行
|
const isQuestIng = (item.runing ?? '').split(',').some(i => i !== '') // 是否有飞机正在执行
|
||||||
return isOverWaight || isQuestIng
|
return isOverWaight || isQuestIng
|
||||||
|
@ -1,74 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="h-100">
|
<div class="h-100">
|
||||||
<map-box ref="mapbox"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MapBox from '@/components/MapBox'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Home',
|
name: 'Set',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
MapBox
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
airList () {
|
|
||||||
return this.$store.state.airList
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description: 侧边栏显隐
|
|
||||||
*/
|
|
||||||
isCollapse () {
|
|
||||||
return this.$store.state.app.isCollapse
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/**
|
|
||||||
* @description: 创建飞机图标
|
|
||||||
*/
|
|
||||||
makePlanes (planes) {
|
|
||||||
this.$refs.mapbox.removePlanes()// 先清除画布上现有的飞机
|
|
||||||
planes.forEach((plane, index) => { // 创建所有飞机
|
|
||||||
let planeDefaultLonLat
|
|
||||||
if (localStorage.getItem(plane.name) !== null) { // 从本地缓存 拿飞机得初始位置
|
|
||||||
planeDefaultLonLat = JSON.parse(localStorage.getItem(plane.name))
|
|
||||||
plane.lon = planeDefaultLonLat.lon
|
|
||||||
plane.lat = planeDefaultLonLat.lat
|
|
||||||
} else {
|
|
||||||
plane.lon = 0
|
|
||||||
plane.lat = 0
|
|
||||||
}
|
|
||||||
this.$refs.mapbox.makePlane(plane, index)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted () {
|
|
||||||
if (this.airList.length > 0) {
|
|
||||||
this.makePlanes(this.airList)// 创建飞机图标
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
/**
|
|
||||||
* @description: 飞机列表更新时候 更新地图
|
|
||||||
*/
|
|
||||||
airList: {
|
|
||||||
handler (val) {
|
|
||||||
this.makePlanes(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* @description: 侧边栏显隐
|
|
||||||
*/
|
|
||||||
isCollapse () {
|
|
||||||
return this.$store.state.app.isCollapse
|
|
||||||
}
|
|
||||||
},
|
|
||||||
destroyed () {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="h-100">
|
<div class="h-100">
|
||||||
<!-- 地图组件 -->
|
<!-- 地图组件 -->
|
||||||
<map-box ref="mapbox" v-if="showMapbox" :enableShowNofly="true" :enableGuided="true" :enableFollow="true" :enblueScale="!$store.state.app.isWideScreen"
|
<map-box ref="mapbox" :enableShowNofly="true" :enableGuided="true" :enableFollow="true" :enblueScale="!$store.state.app.isWideScreen"
|
||||||
@longPress="handleLongPress" :key="mapboxKey">
|
@longPress="handleLongPress">
|
||||||
<template #content>
|
<template #content>
|
||||||
<BatteryStatus :plane="plane" />
|
<BatteryStatus :plane="plane" />
|
||||||
<PlaneStatus :plane="plane" />
|
<PlaneStatus :plane="plane" />
|
||||||
@ -119,8 +119,8 @@ export default {
|
|||||||
plane.lon = planeDefaultLonLat.lon
|
plane.lon = planeDefaultLonLat.lon
|
||||||
plane.lat = planeDefaultLonLat.lat
|
plane.lat = planeDefaultLonLat.lat
|
||||||
} else {
|
} else {
|
||||||
plane.lon = 0
|
plane.lon = 100
|
||||||
plane.lat = 0
|
plane.lat = 40
|
||||||
}
|
}
|
||||||
this.$refs.mapbox.removePlanes()// 先清除画布上现有的飞机
|
this.$refs.mapbox.removePlanes()// 先清除画布上现有的飞机
|
||||||
this.$refs.mapbox.makePlane(plane)// 创建飞机
|
this.$refs.mapbox.makePlane(plane)// 创建飞机
|
||||||
@ -165,7 +165,7 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
plane (val) {
|
plane (val) {
|
||||||
this.makePlane(val)// 有飞机数据之后 在地图上创建飞机
|
if (val) this.makePlane(val)// 有飞机数据之后 在地图上创建飞机
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @description: 更新飞机位置 并画出轨迹 跟随飞机
|
* @description: 更新飞机位置 并画出轨迹 跟随飞机
|
||||||
@ -185,24 +185,15 @@ export default {
|
|||||||
},
|
},
|
||||||
deep: true
|
deep: true
|
||||||
},
|
},
|
||||||
noflyData: {
|
|
||||||
deep: true,
|
|
||||||
immediate: true,
|
|
||||||
handler () {
|
|
||||||
this.showMapbox = false
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.mapboxKey++
|
|
||||||
this.showMapbox = true
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* @description: 侧边栏缩进有变化时 地图重新自适应
|
* @description: 侧边栏缩进有变化时 地图重新自适应
|
||||||
*/
|
*/
|
||||||
isCollapse: {
|
isCollapse: {
|
||||||
handler (val) {
|
handler (val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
this.$refs.mapbox.handleResize()
|
this.$nextTick(() => {
|
||||||
|
this.$refs.mapbox.handleResize()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -101,8 +101,6 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
/* mqtt */
|
|
||||||
mqtt.mqttConf()// 连接mqtt
|
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
/* init */
|
/* init */
|
||||||
@ -126,6 +124,8 @@ export default {
|
|||||||
* @param {*} res 飞机列表
|
* @param {*} res 飞机列表
|
||||||
*/
|
*/
|
||||||
airList (res) {
|
airList (res) {
|
||||||
|
/* mqtt */
|
||||||
|
mqtt.mqttConf()// 连接mqtt
|
||||||
// 订阅飞机信息
|
// 订阅飞机信息
|
||||||
mqtt.doSubscribe('planeState/+', (mqttRes) => {
|
mqtt.doSubscribe('planeState/+', (mqttRes) => {
|
||||||
res.forEach(plane => {
|
res.forEach(plane => {
|
||||||
|
Loading…
Reference in New Issue
Block a user