From 36215cf59b289d3f8f5bfcb9aaad86b6d131e213 Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期四, 04 九月 2025 08:48:50 +0800 Subject: [PATCH] 支持删除 合并处理 点击合并后禁止键盘事件 排除继续监听事件重新组合数组 --- src/utils/components/init-map.vue | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/utils/components/init-map.vue b/src/utils/components/init-map.vue index 57afe58..90d88be 100644 --- a/src/utils/components/init-map.vue +++ b/src/utils/components/init-map.vue @@ -901,6 +901,7 @@ grouped[index][type] = item.position; } }) + console.log(grouped) const result = Object.keys(grouped).map((key, idx) => { const group = grouped[key]; const positionGround = group.groundPoiId.getValue(Cesium.JulianDate.now()) @@ -909,14 +910,14 @@ const aerialPos = Cesium.Cartographic.fromCartesian(positionAerialPo); return { id: this.genId(), - label: `鍦伴潰鐐�${idx}`, + label: `鍦伴潰鐐�${key}`, longitude: Cesium.Math.toDegrees(groundPos.longitude), latitude: Cesium.Math.toDegrees(groundPos.latitude), height: groundPos.height, children: [ { id: this.genId(), - label: `绌轰腑鐐�${idx}`, + label: `绌轰腑鐐�${key}`, longitude: Cesium.Math.toDegrees(aerialPos.longitude), latitude: Cesium.Math.toDegrees(aerialPos.latitude), height: aerialPos.height, @@ -950,14 +951,14 @@ const aerialPos = Cesium.Cartographic.fromCartesian(positionAerialPo); return { id: this.genId(), - label: `鍦伴潰鐐�${idx}`, + label: `鍦伴潰鐐�${key}`, longitude: Cesium.Math.toDegrees(groundPos.longitude), latitude: Cesium.Math.toDegrees(groundPos.latitude), height: groundPos.height, children: [ { id: this.genId(), - label: `绌轰腑鐐�${idx}`, + label: `绌轰腑鐐�${key}`, longitude: Cesium.Math.toDegrees(aerialPos.longitude), latitude: Cesium.Math.toDegrees(aerialPos.latitude), height: aerialPos.height @@ -966,6 +967,8 @@ }; }); this.$emit('mergePoint',result,this.mergeNumber,viewerM) + window.removeEventListener("keydown", this.onKeyDown); + window.removeEventListener("keyup", this.onKeyUp); }, genId() { return (Date.now().toString(16) + Math.random().toString(16).slice(2, 10)).slice(0, 16); -- Gitblit v1.9.3