【类 型】:feat

【主	题】:地图组件 获取航线对象 对象外层加questAss字段
【描	述】:
	[原因]:mqtt发送控制主题改为 cmd/+ 单主题 航线外层包一个questAss键
	[过程]:
	[影响]:
【结	束】

# 类型 包含:
# feat:新功能(feature)
# fix:修补bug
# docs:文档(documentation)
# style: 格式(不影响代码运行的变动)
# refactor:重构(即不是新增功能,也不是修改bug的代码变动)
# test:增加测试
# chore:构建过程或辅助工具的变动
This commit is contained in:
tk 2024-07-10 22:24:08 +08:00
parent 244d70e6f2
commit 91f024105d
3 changed files with 19 additions and 20 deletions

View File

@ -68,25 +68,26 @@
</el-form-item>
<el-form-item label="飞机操作">
<el-button-group>
<el-button size="mini" class="f-s-14" v-if="planeState & 1 && airLock" key="pubBut" type="info"
<el-button size="mini" class="f-s-14" v-if="planeState.state & 1 && airLock" key="pubBut" type="info"
icon="iconfont el-icon-loading" disabled>
<font class="m-l-5">注册航线</font>
</el-button>
<el-button size="mini" class="f-s-14" v-if="planeState & 1 && !airLock" type="primary"
<el-button size="mini" class="f-s-14" v-if="planeState.state & 1 && !airLock" type="primary"
icon="f-s-14 iconfont icon-chakanzhihangrizhi" @click="checkQuest">
<font class="m-l-5">提交任务</font>
</el-button>
<el-button size="mini" class="f-s-14" v-if="planeState & 2" key="wirteBut" type="info" :loading="true"
disabled>
<el-button size="mini" class="f-s-14" v-if="planeState.state & 2" key="wirteBut" type="info"
:loading="true" disabled>
<font class="m-l-5">航点写入中···</font>
</el-button>
<el-button size="mini" class="f-s-14" v-if="planeState & 4 && !(planeState & 16)" type="warning"
icon="f-s-14 iconfont icon-jiesuo"
<el-button size="mini" class="f-s-14" v-if="planeState.state & 4 && !(planeState.state & 16)"
type="warning" icon="f-s-14 iconfont icon-jiesuo"
@click="publishFun('{setPlaneState:{bit:3,state:1,count:2,param:[1,0]}}'); speakText('解锁飞机')">
<font class="m-l-5">解锁飞机</font>
</el-button>
<el-button size="mini" class="f-s-14" v-if="planeState & 16 && !(planeState & 1) && !(planeState & 2)"
type="success" icon="f-s-14 iconfont icon-yangshi_icon_tongyong_departure"
<el-button size="mini" class="f-s-14"
v-if="planeState.state & 16 && !(planeState.state & 1) && !(planeState.state & 2)" type="success"
icon="f-s-14 iconfont icon-yangshi_icon_tongyong_departure"
@click="publishFun('{setPlaneState:{bit:5,state:1}'); speakText('准备起飞,执行送餐任务')">
<font class="m-l-5">执行任务</font>
</el-button>
@ -675,9 +676,7 @@ export default {
},
plane: {
handler (val) {
this.publishFun('{getPlaneState:1}')
this.planeState = val.planeState
console.log(this.planeState)
this.planeState = val.planeState//
},
deep: true
}

View File

@ -189,21 +189,21 @@ export default {
// 线
this.clearRoute()
//
routeObj.tasks.forEach((element, index) => {
routeObj.questAss.tasks.forEach((element, index) => {
const lngLat = [element.y, element.x, 100]
this.lngLats.push(lngLat)
if (index > 1 && index < routeObj.taskcount - 1) {
if (index > 1 && index < routeObj.questAss.taskcount - 1) {
this.wayLngLats.push(lngLat)
}
})
// home
this.goto(this.lngLats[0])
// 线
if (routeObj.tasks[this.lngLats.length - 1].command === 20) {
if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 20) {
this.takeoffLngLats.push(this.lngLats[2])
this.takeoffLngLats.push(this.lngLats[1])
this.takeoffLngLats.push(this.lngLats[this.lngLats.length - 2])
} else if (routeObj.tasks[this.lngLats.length - 1].command === 21) {
} else if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 21) {
this.takeoffLngLats.push(this.lngLats[2])
this.takeoffLngLats.push(this.lngLats[1])
}
@ -308,9 +308,9 @@ export default {
} else if (index === 1) { //
let takeoffPoint
// RETURN_TO_LAUNCH 20 LAND 21
if (routeObj.tasks[this.lngLats.length - 1].command === 20) {
if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 20) {
takeoffPoint = 'takeoffLandPoint'
} else if (routeObj.tasks[this.lngLats.length - 1].command === 21) {
} else if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 21) {
takeoffPoint = 'takeoffPoint'
}
this.map.addSource('takeoff_point', {
@ -343,11 +343,11 @@ export default {
if (index !== this.lngLats.length - 1) { //
let wayPoint = 'wayPoint'
if (index === this.lngLats.length - 2) { // LAND 21 waypoint
if (routeObj.tasks[this.lngLats.length - 1].command === 21) {
if (routeObj.questAss.tasks[this.lngLats.length - 1].command === 21) {
wayPoint = 'wayLandPoint'
}
}
if (routeObj.tasks[index].command === 94) { // command94
if (routeObj.questAss.tasks[index].command === 94) { // command94
wayPoint = 'hookPoint'
}
this.map.addSource('way_point' + index, {

View File

@ -91,7 +91,7 @@ export default {
this.form.upFile = ''
},
handleUpSuccess (res) {
this.$refs.mapbox.makeRoute(res.content.questAss)// 线
this.$refs.mapbox.makeRoute(res.content)// 线
if (res.status === 0) {
this.fileList = []
this.$message.error(res.msg)