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] // 按订阅信息 刷新飞机状态 }