diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index 01844bf..84e4bc4 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -68,25 +68,26 @@ - 注册航线 - 提交任务 - + 航点写入中··· - 解锁飞机 - 执行任务 @@ -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 } diff --git a/src/components/MapBox.vue b/src/components/MapBox.vue index bc17850..9f7e401 100644 --- a/src/components/MapBox.vue +++ b/src/components/MapBox.vue @@ -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) { // command字段为94既然 投放放勾航点 放勾图标 + if (routeObj.questAss.tasks[index].command === 94) { // command字段为94既然 投放放勾航点 放勾图标 wayPoint = 'hookPoint' } this.map.addSource('way_point' + index, { diff --git a/src/views/layout/components/main/route/add.vue b/src/views/layout/components/main/route/add.vue index 6469604..5c0401d 100644 --- a/src/views/layout/components/main/route/add.vue +++ b/src/views/layout/components/main/route/add.vue @@ -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)