From 244d70e6f2be39bd00f62fdc43a55f721c2e7796 Mon Sep 17 00:00:00 2001 From: tk Date: Wed, 10 Jul 2024 19:36:33 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=09=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Arefactor=20=E3=80=90=E4=B8=BB=09=E9=A2=98=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E9=A3=9E=E6=9C=BA=E7=8A=B6=E6=80=81=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=20=E3=80=90=E6=8F=8F=09=E8=BF=B0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=09[=E5=8E=9F=E5=9B=A0]=EF=BC=9A=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=B9=9F=E6=98=AF=E4=BB=8E=E7=88=B6=E7=BA=A7?= =?UTF-8?q?=E6=8B=BF=20=E4=BB=A3=E7=A0=81=E5=85=AC=E7=94=A8=20=09[?= =?UTF-8?q?=E8=BF=87=E7=A8=8B]=EF=BC=9A=E9=A3=9E=E6=9C=BA=E7=8A=B6?= =?UTF-8?q?=E6=80=81=20=E7=94=B1=E7=88=B6=E7=BA=A7=E5=B7=B2=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=A0=E8=BF=87=E6=9D=A5=20=09[=E5=BD=B1=E5=93=8D]?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E7=BB=93=09=E6=9D=9F=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/components/ControllerTabs.vue | 22 ++++++++----------- src/components/PlaneStatus.vue | 9 +++++--- .../layout/components/main/planes/index.vue | 5 +++-- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index 536d182..01844bf 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -274,7 +274,8 @@ export default { id: '' }, planesId: this.$route.params.id, // 飞机id - airLock: false // 当前飞机是否被锁定 + airLock: false, // 当前飞机是否被锁定 + planeState: {}// 飞机状态 } }, props: { @@ -290,13 +291,6 @@ export default { isMobile () { return this.$store.state.app.isMobile }, - /** - * @description: 飞机状态 - */ - planeState () { - const plane = this.plane - return plane ? plane.planeState.state : null - }, /** * @description: 已付款 已接单 未发起退款 订单列表 */ @@ -679,11 +673,13 @@ export default { this.questForm.id = '' } }, - plane (val) { - this.publishFun('{getPlaneState:1}') - }, - planeState (val) { - console.log(val) + plane: { + handler (val) { + this.publishFun('{getPlaneState:1}') + this.planeState = val.planeState + console.log(this.planeState) + }, + deep: true } } diff --git a/src/components/PlaneStatus.vue b/src/components/PlaneStatus.vue index 6306aab..9e58720 100644 --- a/src/components/PlaneStatus.vue +++ b/src/components/PlaneStatus.vue @@ -43,14 +43,17 @@ export default { planeState: {} } }, + props: { + plane: { + typeof: 'Object', + deep: true + } + }, components: { HeartTag, PublicTag }, computed: { - plane () { - return this.$store.state.airList.find(plane => plane.id === this.planesId) - } }, watch: { plane: { diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index ab80a62..d749aa9 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -2,7 +2,7 @@
@@ -103,7 +103,8 @@ export default { plane: { handler (val) { this.makePlane(val) - } + }, + deep: true }, /** * @description: 更新飞机位置 并画出轨迹 跟随飞机