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

View File

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

View File

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