fix 1解决地图组件因为menu缩进按钮 造成的空白问题 包括所有使用地图组件的模块

2打印日志前 带上飞机名字前缀
3集群指点飞行 判断最矮飞机目标高度是不是小于0 即地面以下 打断 不发送mqtt命令
This commit is contained in:
oldHome 2025-06-28 16:48:48 +08:00
parent 4f9017e59d
commit bb032a81c2
7 changed files with 93 additions and 20 deletions

View File

@ -108,7 +108,7 @@ export default {
//
planePositions: {
handler (allPositions) {
// allPositions position
// allPositions position
allPositions.forEach((positions, idx) => {
const n = positions.length
if (n > 2) {
@ -130,10 +130,19 @@ export default {
deep: true
},
/**
* @description: 侧边栏显隐
* @description: 侧边栏缩进有变化时 地图重新自适应
*/
isCollapse () {
return this.$store.state.app.isCollapse
isCollapse: {
handler (val) {
if (val) {
setTimeout(() => {
this.$nextTick(() => {
this.$refs.mapbox.handleResize()
})
}, 500)
}
},
deep: true
}
},
destroyed () {

View File

@ -43,10 +43,20 @@ export default {
})
}
},
isCollapse (val) {
if (val) {
this.$refs.mapbox.handleResize()
}
/**
* @description: 侧边栏缩进有变化时 地图重新自适应
*/
isCollapse: {
handler (val) {
if (val) {
setTimeout(() => {
this.$nextTick(() => {
this.$refs.mapbox.handleResize()
})
}, 500)
}
},
deep: true
}
}
}

View File

@ -43,10 +43,20 @@ export default {
})
}
},
isCollapse (val) {
if (val) {
this.$refs.mapbox.handleResize()
}
/**
* @description: 侧边栏缩进有变化时 地图重新自适应
*/
isCollapse: {
handler (val) {
if (val) {
setTimeout(() => {
this.$nextTick(() => {
this.$refs.mapbox.handleResize()
})
}, 500)
}
},
deep: true
}
}
}

View File

@ -290,11 +290,14 @@ export default {
isCollapse: {
handler (val) {
if (val) {
this.$nextTick(() => {
this.$refs.mapbox.handleResize()
})
setTimeout(() => {
this.$nextTick(() => {
this.$refs.mapbox.handleResize()
})
}, 500)
}
}
},
deep: true
}
}
}

View File

@ -202,6 +202,7 @@ export default {
return
}
let minTargetAlt = Infinity //
//
const commands = this.planeList.map(p => {
const pos = p?.planeState?.position
@ -216,12 +217,22 @@ export default {
const newLat = targetLat + offsetLat
const newAlt = targetAlt + offsetAlt
if (newAlt < minTargetAlt) {
minTargetAlt = newAlt
}
return {
macadd: p.macadd,
cmd: `{guidedMode:{lon:${newLon.toFixed(7)},lat:${newLat.toFixed(7)},alt:${newAlt.toFixed(1)}}}`
}
}).filter(Boolean)
//
if (minTargetAlt < 0) {
this.$message.warning(`指令已取消:最矮飞机将飞到地面以下(最低高度 ${minTargetAlt.toFixed(1)} 米)`)
return
}
//
commands.forEach(({ macadd, cmd }) => {
mqtt.publishFun(`cmd/${macadd}`, cmd)
@ -307,10 +318,19 @@ export default {
deep: true
},
/**
* @description: 侧边栏显隐
* @description: 侧边栏缩进有变化时 地图重新自适应
*/
isCollapse () {
return this.$store.state.app.isCollapse
isCollapse: {
handler (val) {
if (val) {
setTimeout(() => {
this.$nextTick(() => {
this.$refs.mapbox.handleResize()
})
}, 500)
}
},
deep: true
}
}
}

View File

@ -80,6 +80,12 @@ export default {
*/
routeList () {
return this.$store.state.routeList
},
/**
* @description: 侧边栏显隐
*/
isCollapse () {
return this.$store.state.app.isCollapse
}
},
methods: {
@ -169,6 +175,21 @@ export default {
watch: {
routeList () {
this.initPage()//
},
/**
* @description: 侧边栏缩进有变化时 地图重新自适应
*/
isCollapse: {
handler (val) {
if (val) {
setTimeout(() => {
this.$nextTick(() => {
this.$refs.mapbox.handleResize()
})
}, 500)
}
},
deep: true
}
},
created () {

View File

@ -220,7 +220,7 @@ export default {
plane.planeState[key] = homePosition
} else if (key === 'statusText') {
/* 飞控信息 插入日志 */
this.$store.dispatch('fetchLog', { content: jsonData[key], color: '#f57c00' })
this.$store.dispatch('fetchLog', { content: `${plane.name}--${jsonData[key]}`, color: '#f57c00' })
} else {
plane.planeState[key] = jsonData[key] //
}