From 24fac6cc27b034675855c6b660a2d02490cf752a Mon Sep 17 00:00:00 2001 From: szdot Date: Sat, 20 Jul 2024 18:38:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E5=9C=A8=E6=B2=A1=E6=9C=89=E5=8A=A0=E8=BD=BD=E9=A3=9E?= =?UTF-8?q?=E6=9C=BA=E4=B9=8B=E5=89=8D=20=E5=90=91=E9=A3=9E=E6=9C=BA?= =?UTF-8?q?=E5=8F=91=E9=80=81mqtt=E4=BF=A1=E6=81=AF=20=E3=80=90=E8=BF=87?= =?UTF-8?q?=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20?= =?UTF-8?q?=E5=93=8D=E3=80=91=EF=BC=9A?= 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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/components/ControllerTabs.vue b/src/components/ControllerTabs.vue index be33dc4..0827659 100644 --- a/src/components/ControllerTabs.vue +++ b/src/components/ControllerTabs.vue @@ -57,7 +57,8 @@ - + {{ item.id }} @@ -409,8 +410,7 @@ export default { */ publishFun (jsonData) { if (this.plane) { - const val = jsonData - mqtt.publishFun(`cmd/${this.plane.macadd}`, val) + mqtt.publishFun(`cmd/${this.plane.macadd}`, jsonData) } else { this.$message.warning('与飞机通信未接通,请稍后') } @@ -742,12 +742,14 @@ export default { return isOverWaight || isQuestIng } }, - created () { + mounted () { // 初始化 if (this.executeOrder) { // 有正在执行单点 this.makeRouteForMap()// 绘制地图 } else { // 没有执行订单 - this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置 + if (this.plane) { + this.publishFun('{"resetState":1}')// 发送设置飞机状态主题 状态设为闲置 + } } }, watch: {