diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index 1739987..b37c776 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -68,26 +68,27 @@ - + 注册航线 - 提交任务 - 航点写入中··· - 解锁飞机 执行任务 @@ -274,9 +275,7 @@ export default { questForm: { // 送餐任务表单 id: '' }, - planesId: this.$route.params.id, // 飞机id - airLock: false, // 当前飞机是否被锁定 - planeState: {}// 飞机状态 + airLock: false // 当前飞机是否被锁定 } }, props: { @@ -469,7 +468,7 @@ export default { let selIndex // 记录执行飞机注册的索引 此索引对应 要使用的航线的索引 runing.some((item, index, arr) => { if (item === '') { - arr[index] = this.planesId + arr[index] = this.plane.id foundEmpty = true selIndex = index return true // 找到空位后退出循环 @@ -557,7 +556,7 @@ export default { type: 'warning' }).then(() => { this.overQuestList.forEach((item) => { - if (item.runing === this.planesId) { + if (item.runing === this.plane.id) { /* 插入日志 */ this.$store.dispatch('fetchLog', { content: `订单ID:${item.id},送餐任务取消。` }) /* 执行写在这里 */ @@ -586,7 +585,7 @@ export default { }).then(() => { // 确认执行 this.questList.map((item) => { - if (item.runing === this.planesId) { // 找出当前飞机正在执行的任务 + if (item.runing === this.plane.id) { // 找出当前飞机正在执行的任务 /* 插入日志 */ this.$store.dispatch('fetchLog', { content: `订单ID:${item.id} 送餐任务已完成。` }) /* 执行写在这里 */ @@ -609,7 +608,7 @@ export default { let found = false this.siteList.some(item => { const runing = item.runing.split(',') - const index = runing.indexOf(this.planesId.toString()) + const index = runing.indexOf(this.plane.id.toString()) if (index !== -1) { found = true // 获取航点信息 @@ -647,7 +646,7 @@ export default { this.airLock = this.siteList.some(item => { if (item.runing) { const runingArray = item.runing.split(',').map(str => str.trim()) // 将 item.runing 分割成数组并去除空格 - return runingArray.includes(this.planesId.toString()) // 比较数组中的元素和 this.planesId + return runingArray.includes(this.plane.id.toString()) // 比较数组中的元素和 this.plane.id } return false }) @@ -669,7 +668,7 @@ export default { this.airLock = this.siteList.some(item => { if (item.runing) { const runingArray = item.runing.split(',').map(str => str.trim()) // 将 item.runing 分割成数组并去除空格 - return runingArray.includes(this.planesId.toString()) // 比较数组中的元素和 this.planesId + return runingArray.includes(this.plane.id.toString()) // 比较数组中的元素和 this.plane.id } return false }) @@ -680,12 +679,6 @@ export default { if (!found) { this.questForm.id = '' } - }, - plane: { - handler (val) { - this.planeState = val.planeState// 实时更新飞机数据 - }, - deep: true } } diff --git a/src/components/MapBox.vue b/src/components/MapBox.vue index 9f7e401..a75a678 100644 --- a/src/components/MapBox.vue +++ b/src/components/MapBox.vue @@ -146,7 +146,7 @@ export default { // 实例化map this.map = new mapboxgl.Map({ container: 'map', - style: this.GaodeRasterStyle, + style: this.GoogleRasterStyle, center: this.defaultLnglat, zoom: this.defaultZoom, pitch: 0, diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index d749aa9..0bd73a8 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -20,7 +20,7 @@ export default { return { mapBoxKey: '', // 初始化一个变量用于控制map-box组件的重新渲染 planesId: this.$route.params.id, - localCount: 0// 本地存储计数器 + localCount: 0 // 本地存储计数器 } }, components: { @@ -97,12 +97,9 @@ export default { } }, watch: { - /** - * @description: 有飞机数据之后 在地图上创建飞机 - */ plane: { handler (val) { - this.makePlane(val) + this.makePlane(val)// 有飞机数据之后 在地图上创建飞机 }, deep: true },