From 5f711afb1d33b1a7dc8f55b71917eda215fbcac7 Mon Sep 17 00:00:00 2001 From: szdot Date: Sun, 22 Jun 2025 15:21:04 +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=E6=8C=87=E7=82=B9=E6=97=B6=E5=80=99=20=E4=BC=9A?= =?UTF-8?q?=E4=BB=8E=E9=A3=9E=E6=9C=BA=E7=8A=B6=E6=80=81=E9=87=8C=E6=8B=BF?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=20=E4=BD=86=E6=98=AF=E6=9B=B4=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E9=A1=B5=E9=9D=A2=20=E6=95=B0=E7=BB=84=E9=87=8C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=AB=98=E5=BA=A6=E4=BF=A1=E6=81=AF=20?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E5=9B=9E=E5=8F=B0=E5=87=BA=E8=AD=A6?= =?UTF-8?q?=E5=91=8A=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E5=BD=B1=20=20=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/views/layout/components/main/planes/index.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/views/layout/components/main/planes/index.vue b/src/views/layout/components/main/planes/index.vue index 3062943..fd074ef 100644 --- a/src/views/layout/components/main/planes/index.vue +++ b/src/views/layout/components/main/planes/index.vue @@ -117,8 +117,16 @@ export default { this.dialogVisible = true this.dialogItem = 'guidedBox' this.guidedLonLat = lonLat // 设置点击的经纬度 - const posLen = this.plane.planeState.position.length - this.guidedAlt = this.plane.planeState.position[posLen - 1][2]// 取出 点击时飞机的高度 + + // 安全获取飞机当前高度 + let height = 0 + if (this.plane && this.plane.planeState && Array.isArray(this.plane.planeState.position)) { + const posLen = this.plane.planeState.position.length + if (posLen > 0 && Array.isArray(this.plane.planeState.position[posLen - 1])) { + height = this.plane.planeState.position[posLen - 1][2] || 0 + } + } + this.guidedAlt = height }, // 地图组件回调地图加载完成后 执行 onMapReady () {