From 0dc7fbac552884839ee89807e0140d6bf6d1f005 Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期六, 02 八月 2025 13:38:38 +0800 Subject: [PATCH] fix创建多个设备 第n个转的时候 --- src/views/system/project/components/addPorjectDialog.vue | 56 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 30 insertions(+), 26 deletions(-) diff --git a/src/views/system/project/components/addPorjectDialog.vue b/src/views/system/project/components/addPorjectDialog.vue index ee57820..217b3eb 100644 --- a/src/views/system/project/components/addPorjectDialog.vue +++ b/src/views/system/project/components/addPorjectDialog.vue @@ -347,33 +347,37 @@ }, rotateAllPoints(dataList,towerLongitude,towerLatitude,towerhHight) { return dataList.map(item => { - const towerPoint = Cesium.Cartesian3.fromDegrees(towerLongitude, towerLatitude, towerhHight); - const newGround = { - ...item, - }; - console.log(newGround) - // 澶勭悊瀛愮┖涓偣 - newGround.children = item.children.map(child => { - const airPoint = Cesium.Cartesian3.fromDegrees(child.longitude, child.latitude, child.height); - const rotatedAirPoint = this.rotateAroundPoint( airPoint,towerPoint, rotationAngle); - const rotatedAirCarto = Cesium.Cartographic.fromCartesian(rotatedAirPoint); - child.longitude = Cesium.Math.toDegrees(rotatedAirCarto.longitude) - child.latitude = Cesium.Math.toDegrees(rotatedAirCarto.latitude) - child.height = rotatedAirCarto.height - child.children = child.children.map(sonChild => { - const groundPoint = Cesium.Cartesian3.fromDegrees(sonChild.longitude, sonChild.latitude, sonChild.height); - const newGroundPoint = this.rotateAroundPoint( groundPoint,towerPoint, rotationAngle); - const newGroundCarto = Cesium.Cartographic.fromCartesian(newGroundPoint); - return { - ...sonChild, - longitude: Cesium.Math.toDegrees(newGroundCarto.longitude), - latitude: Cesium.Math.toDegrees(newGroundCarto.latitude), - height: newGroundCarto.height - }; + if(!item.isDeal) { + const towerPoint = Cesium.Cartesian3.fromDegrees(towerLongitude, towerLatitude, towerhHight); + const newGround = { + ...item, + }; + if(item.id == this.deviceId ){ + item.isDeal = true + } + // 澶勭悊瀛愮┖涓偣 + newGround.children = item.children?.map(child => { + const airPoint = Cesium.Cartesian3.fromDegrees(child.longitude, child.latitude, child.height); + const rotatedAirPoint = this.rotateAroundPoint( airPoint,towerPoint, rotationAngle); + const rotatedAirCarto = Cesium.Cartographic.fromCartesian(rotatedAirPoint); + child.longitude = Cesium.Math.toDegrees(rotatedAirCarto.longitude) + child.latitude = Cesium.Math.toDegrees(rotatedAirCarto.latitude) + child.height = rotatedAirCarto.height + child.children = child.children?.map(sonChild => { + const groundPoint = Cesium.Cartesian3.fromDegrees(sonChild.longitude, sonChild.latitude, sonChild.height); + const newGroundPoint = this.rotateAroundPoint( groundPoint,towerPoint, rotationAngle); + const newGroundCarto = Cesium.Cartographic.fromCartesian(newGroundPoint); + return { + ...sonChild, + longitude: Cesium.Math.toDegrees(newGroundCarto.longitude), + latitude: Cesium.Math.toDegrees(newGroundCarto.latitude), + height: newGroundCarto.height + }; + }); }); - }); - - return newGround; + return newGround; + } + }); }, //聽璁$畻鐐笰缁曠偣B閫嗘椂閽堟棆杞寚瀹氳搴﹀悗鐨勬柊浣嶇疆 -- Gitblit v1.9.3