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

View File

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

View File

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

View File

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

View File

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

View File

@ -220,7 +220,7 @@ export default {
plane.planeState[key] = homePosition plane.planeState[key] = homePosition
} else if (key === 'statusText') { } 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 { } else {
plane.planeState[key] = jsonData[key] // plane.planeState[key] = jsonData[key] //
} }