From 9cca19f31c39e6b029f737f42fc67f75212d9462 Mon Sep 17 00:00:00 2001 From: oldHome Date: Sat, 28 Jun 2025 15:17:22 +0800 Subject: [PATCH] =?UTF-8?q?fix=201=E6=89=93=E5=8D=B0=E6=97=A5=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E9=9D=A2=E5=8A=A0=E4=B8=8A=E9=A3=9E=E6=9C=BA=E5=90=8D?= =?UTF-8?q?=E5=AD=97=20=202menu=E7=BC=A9=E8=BF=9B=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=90=8E=E5=8A=A0=E4=B8=8A=E5=BB=B6=E8=BF=9F=E5=8D=8A=E7=A7=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9C=B0=E5=9B=BE=E7=BB=84=E4=BB=B6=E5=A4=A7?= =?UTF-8?q?=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/layout/components/headbar.vue | 2 +- .../layout/components/main/download/index.vue | 2 +- .../layout/components/main/home/index.vue | 15 ++++++++++--- .../layout/components/main/planes/index.vue | 11 ++++++---- .../layout/components/main/planes/swarm.vue | 15 ++++++++++--- .../layout/components/main/route/add.vue | 21 +++++++++++++++++++ src/views/layout/index.vue | 3 ++- 7 files changed, 56 insertions(+), 13 deletions(-) diff --git a/src/views/layout/components/headbar.vue b/src/views/layout/components/headbar.vue index fe0a588..dd4334a 100644 --- a/src/views/layout/components/headbar.vue +++ b/src/views/layout/components/headbar.vue @@ -23,7 +23,7 @@ - {{ this.$store.state.user.name }} + {{ $store.state.user.name }} diff --git a/src/views/layout/components/main/download/index.vue b/src/views/layout/components/main/download/index.vue index 86ead4b..d5539c6 100644 --- a/src/views/layout/components/main/download/index.vue +++ b/src/views/layout/components/main/download/index.vue @@ -43,7 +43,7 @@ export default { methods: { downloadApk () { const link = document.createElement('a') - link.href = 'https://szdot.top/app-release.apk' + link.href = 'https://szdot.top/lz-app-release.apk' link.target = '_blank' link.download = 'KPT-SP_v1.01.apk' document.body.appendChild(link) diff --git a/src/views/layout/components/main/home/index.vue b/src/views/layout/components/main/home/index.vue index 5ef6c02..5966ddc 100644 --- a/src/views/layout/components/main/home/index.vue +++ b/src/views/layout/components/main/home/index.vue @@ -130,10 +130,19 @@ export default { deep: true }, /** - * @description: 侧边栏显隐 + * @description: 侧边栏缩进有变化时 地图重新自适应 */ - isCollapse () { - return this.$store.state.app.isCollapse + isCollapse: { + handler (val) { + if (val) { + setTimeout(() => { + this.$nextTick(() => { + this.$refs.mapbox.handleResize() + }) + }, 500) + } + }, + deep: true } }, destroyed () { diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index d94a392..de3ac3b 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -290,11 +290,14 @@ export default { isCollapse: { handler (val) { if (val) { - this.$nextTick(() => { - this.$refs.mapbox.handleResize() - }) + setTimeout(() => { + this.$nextTick(() => { + this.$refs.mapbox.handleResize() + }) + }, 500) } - } + }, + deep: true } } } diff --git a/src/views/layout/components/main/planes/swarm.vue b/src/views/layout/components/main/planes/swarm.vue index 6c8c4d6..adfc2ef 100644 --- a/src/views/layout/components/main/planes/swarm.vue +++ b/src/views/layout/components/main/planes/swarm.vue @@ -307,10 +307,19 @@ export default { deep: true }, /** - * @description: 侧边栏显隐 + * @description: 侧边栏缩进有变化时 地图重新自适应 */ - isCollapse () { - return this.$store.state.app.isCollapse + isCollapse: { + handler (val) { + if (val) { + setTimeout(() => { + this.$nextTick(() => { + this.$refs.mapbox.handleResize() + }) + }, 500) + } + }, + deep: true } } } diff --git a/src/views/layout/components/main/route/add.vue b/src/views/layout/components/main/route/add.vue index 8a3fc8c..075b5f7 100644 --- a/src/views/layout/components/main/route/add.vue +++ b/src/views/layout/components/main/route/add.vue @@ -80,6 +80,12 @@ export default { */ routeList () { return this.$store.state.routeList + }, + /** + * @description: 侧边栏显隐 + */ + isCollapse () { + return this.$store.state.app.isCollapse } }, methods: { @@ -169,6 +175,21 @@ export default { watch: { routeList () { this.initPage()// 初始化页面 + }, + /** + * @description: 侧边栏缩进有变化时 地图重新自适应 + */ + isCollapse: { + handler (val) { + if (val) { + setTimeout(() => { + this.$nextTick(() => { + this.$refs.mapbox.handleResize() + }) + }, 500) + } + }, + deep: true } }, created () { diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index ec78133..3a0eab2 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -134,6 +134,7 @@ export default { * @param {*} res 飞机列表 */ airList (res) { + console.log(res) /* mqtt */ mqtt.mqttConf()// 连接mqtt // 订阅飞机信息 @@ -220,7 +221,7 @@ export default { plane.planeState[key] = homePosition } else if (key === 'statusText') { /* 飞控信息 插入日志 */ - this.$store.dispatch('fetchLog', { content: jsonData[key], color: '#f57c00' }) + this.$store.dispatch('fetchLog', { content: `${plane.name}--${jsonData[key]}`, color: '#f57c00' }) } else { plane.planeState[key] = jsonData[key] // 按订阅信息 刷新飞机状态 }