From 71627d89045c5bf3c50030751d93ae519f5dbb8d Mon Sep 17 00:00:00 2001 From: jihongshun <1151753686@qq.com> Date: 星期三, 20 八月 2025 17:25:50 +0800 Subject: [PATCH] 航点列表 中化建 右侧联动 待测试联调 --- src/utils/components/init-map.vue | 621 +++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 544 insertions(+), 77 deletions(-) diff --git a/src/utils/components/init-map.vue b/src/utils/components/init-map.vue index 6cb1d61..9cf9a0a 100644 --- a/src/utils/components/init-map.vue +++ b/src/utils/components/init-map.vue @@ -27,15 +27,94 @@ </div> <!-- 宸︿笅瑙掑�嶇巼淇℃伅 --> - <div class="zoom-info"> - <el-tag type="success">鍊嶇巼: {{ zoomRatio.toFixed(1) }}X</el-tag> - </div> + </div> - + <div class="zoom-info"> + <!-- <el-tag type="success">鍊嶇巼: {{ zoomRatio.toFixed(1) }}X</el-tag><br> + <el-tag type="success">璺濈: {{ betweenDistance.toFixed(1) }}绫�</el-tag><br> + <el-tag type="success">P: {{ cameraP }} T: {{ cameraT }} </el-tag> --> + <el-button type="primary" plain @click="doAction(chooseItem, '鎮仠')">鎮仠</el-button></br> + <el-button type="success" plain @click="doAction(chooseItem, '鎷嶇収')">鎷嶇収</el-button></br> + <el-button type="info" plain @click="doAction(chooseItem, '寮�濮嬪綍鍍�')">寮�濮嬪綍鍍�</el-button></br> + <el-button type="info" plain @click="doAction(chooseItem, '缁撴潫褰曞儚')">缁撴潫褰曞儚</el-button> + </div> <!-- botton --> <div class="cesiumBotton"> + <div class="cesiumContent"> + <div class="flyAction"> + <div class="actionName">{{currentAction ?currentAction.type :'' }}</div> + <i class="el-icon-delete" /> + </div> + <div class="flayDataAll"> + <div class="flyData"> + <div v-if="currentAction && (currentAction.type == '鎮仠')"> + <div>鏆傚仠鏃堕棿</div> + <div class="stopContent"> + <!-- 鍑忔寜閽� --> + <el-button size="mini" @click="changeTime(-100)" type="info">-100</el-button> + <el-button size="mini" @click="changeTime(-10)" type="info">-10</el-button> + <el-button size="mini" @click="changeTime(-1)" type="info">-1</el-button> + <!-- 鍙紪杈戞暟瀛� --> + <div class="stopNumber"> + <el-input-number + v-model="time" + :min="0" + :controls="false" + style="margin: 0 15px; width: 60px;" + @change="onChange" + class="custom-input" + > + </el-input-number> + <span style="margin-left: -10px;">s</span> + </div> + <!-- 鍔犳寜閽� --> + <el-button size="mini" @click="changeTime(1)" type="info">+1</el-button> + <el-button size="mini" @click="changeTime(10)" type="info">+10</el-button> + <el-button size="mini" @click="changeTime(100)" type="info">+100</el-button> + </div> + </div> + <div v-if="currentAction && (currentAction.type == '鎷嶇収')"> + <div v-if="!isEditingPhoto" class="editable-text"> + {{ takePhoto }} + <i class="el-icon-edit" @click.stop="startEditing"/> + </div> + <div v-else > + <div class="editable-container"> + <input + v-model="newTakePhoto" + type="text" + class="editable-input" + autofocus + /> + </div> + <button @click.stop="validateInput" class="validate-btn">鉁�</button> + <button @click.stop="cancelEditing" class="cancel-btn">鉁�</button> + </div> + </div> + <div v-if="currentAction && (currentAction.type == '寮�濮嬪綍鍍�')"> + <div v-if="!isEditingVideo" class="editable-text"> + {{ takeVideo }} + <i class="el-icon-edit" @click.stop="startEditingVideo"/> + </div> + <div v-else > + <div class="editable-container"> + <input + v-model="newTakeVideo" + type="text" + class="editable-input" + autofocus + /> + </div> + <button @click.stop="validateVideoInput" class="validate-btn">鉁�</button> + <button @click.stop="cancelVideoEditing" class="cancel-btn">鉁�</button> + </div> + </div> + </div> + </div> + + </div> <div class="cesiumButtonGroup"> <el-button id="groundPoi" @click="addGroundPoi()" type="primary">鍦伴潰鐐�</el-button> <el-input v-model="mergeNumber" placeholder="璇疯緭鍏ュ悎骞惰寖鍥�" type="number" style="width: 150px;"></el-input> @@ -125,7 +204,7 @@ // let pois = [0, 0,0] let holdingPosition; let rightKeyMove = false -let distance = 100; +let distance = 25; export default { props: { towerUrl: { @@ -134,6 +213,12 @@ return '' } }, + deviceData: { + type: Object, + }, + chooseItem:{ + type: Object + } }, data(){ return{ @@ -169,11 +254,27 @@ 14: '14X', 28: '28X', 56: '56X' - } + }, + betweenDistance:0, + cameraP:0.0, + cameraT:0.0, + pointGround: { lon: 0, lat: 0, height: 0 }, + pointFly: { lon: 0, lat: 0, height: 0 }, + rowData:null, + time: 10, + takePhoto: '111', // 鍒濆鏁版嵁 + newTakePhoto: '', // 缂栬緫鏃剁殑鏂版暟鎹� + isEditingPhoto: false, // 鎺у埗鏄惁澶勪簬缂栬緫鐘舵�� + takeVideo: '111', // 鍒濆鏁版嵁 + newTakeVideo: '', // 缂栬緫鏃剁殑鏂版暟鎹� + isEditingVideo: false, // 鎺у埗鏄惁澶勪簬缂栬緫鐘舵�� + actionCounter:0, + currentAction:null } }, mounted(){ this.initCesium(); + console.log(this.deviceData) }, computed: { boxWidth() { @@ -209,7 +310,6 @@ control.enableTilt = false; control.enableLook = false; viewerC.scene.camera.percentageChanged = 0.05聽 - this.cammove_measure_point(); },1000) }, @@ -248,13 +348,6 @@ fullscreenButton: false, vrButton: false, }); - // 鍏抽棴澶╃┖鐩掓晥鏋� - // viewer.scene.skyAtmosphere = undefined; // 鎴栬�呰缃负 null - - // // 鍏抽棴鍏夌収鏁堟灉 - // viewer.scene.globe.enableLighting = false; // 鍏抽棴鍏夌収鏁堟灉 - - // viewer.imageryLayers.add(bdtvectoranoimagery); viewer._cesiumWidget._creditContainer.style.display="none"; return viewer; @@ -271,7 +364,6 @@ // 璁剧疆瑙嗚锛屼娇鍏堕粯璁ゆ煡鐪嬫煇涓湴鐞嗕綅缃� viewerM.scene.camera.setView({ destination: Cesium.Cartesian3.fromDegrees(globalon, globalat, 349.0), // 浠ョ粡绾害璁剧疆浣嶇疆锛堜緥濡傦細澶у簡榫欏叴璺級 - // destination: Cesium.Cartesian3.fromDegrees(0.0005, 0.0017, 207.8), // 浠ョ粡绾害璁剧疆浣嶇疆锛堜緥濡傦細澶у簡榫欏叴璺級 orientation: { heading: Cesium.Math.toRadians(194.65), // 鏂瑰悜 pitch: Cesium.Math.toRadians(-31.43), // 淇 @@ -303,12 +395,10 @@ }, addSyncListener() { // 瀛樹笅鍥炶皟浠ヤ究閿�姣� - // this._preRenderCallback = () => this.syncViewer(); viewerM.scene.preRender.addEventListener( this.syncViewer()); window.addEventListener("keydown", this.handleKeydown); }, syncViewer(){ - console.log(viewerM.camera) viewerC.camera.flyTo({ destination: viewerM.camera.position, orientation: { @@ -322,6 +412,7 @@ creatPin(id, position, font, color, viewer) { let pinBuilder = new Cesium.PinBuilder(); let addPin = viewer.entities.getById(id); + console.log(addPin) if (addPin == undefined) { viewer.entities.add({ id: id, @@ -351,7 +442,6 @@ let lng = Cesium.Math.toDegrees(cartographic.longitude); let lat = Cesium.Math.toDegrees(cartographic.latitude); height = cartographic.height; - console.log(lng+','+lat+','+height) } //鍦ㄤ袱涓獥鍙e垱寤烘爣娉� @@ -380,44 +470,57 @@ //鏍规嵁鍋忕Щ閲忔眰鍋忕Щ鍚戦噺 聽聽聽聽const scalerNormalize聽=聽Cesium.Cartesian3.multiplyByScalar(normalize,distance,new聽Cesium.Cartesian3()); const tagert = Cesium.Cartesian3.add(holdingPosition,scalerNormalize,new聽Cesium.Cartesian3()); - console.log(Cesium.Cartographic.fromCartesian(tagert)) + //鍒涘缓绌轰腑鐐筽in _this.creatPin("aerialPoiId"+counter,tagert,`绌�${counter}`,Cesium.Color.RED,viewerM); - // preVideoScopePrimitiveArrTie = [] - console.log(preVideoScopePrimitiveArrTie) - - console.log(Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).height)) + //鏇存柊閿洏浜嬩欢 _this.updateCameraMovement(); - // if(cameraVideo){ - // viewerM.scene.primitives.remove(cameraVideo) - // } - chooseId = crypto.randomUUID() - //鍒涘缓瑙嗛敟浣� + //褰撳墠閫夋嫨鐨刬d + // chooseId = crypto.randomUUID() + chooseId = _this.genId() + //鍒涘缓瑙嗛敟浣� let data = { - "FHorFieldAngle": 32.13, - "FVerFieldAngle": 18.39, "altitude": Cesium.Cartographic.fromCartesian(tagert).height, "id": chooseId, - "chanNo": 1, + 'name':`绌轰腑鐐�${counter}`, "latitude": Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).latitude), "longitude": Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).longitude), - "p": 26.8, - "t": 351.3, - "z": 1, } - const point1 = Cesium.Cartesian3.fromDegrees(0, 0, 50); + const lookPoint = Cesium.Cartesian3.fromDegrees(longitude, latitude) + const watchPoint = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).longitude), Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).latitude)) + const betweenDistanceWatch = Cesium.Cartesian3.distance(lookPoint, watchPoint) + _this.betweenDistance = betweenDistanceWatch + console.log(lookPoint) + console.log(watchPoint) + // const guanPoint1 = Cesium.Cartesian3.fromDegrees(longitude, latitude) + console.log(viewerM.entities.getById('groundPoiId0')) + //濉旂殑璺濈鍜岃娴嬬偣鐨勮窛绂� + console.log(_this.deviceData) + const point1 = Cesium.Cartesian3.fromDegrees(0, 0, _this.deviceData?.modelHeight || 45); + _this.pointGround = { + lon:longitude, + lat:latitude, + height:height + } + // const point1 = Cesium.Cartesian3.fromDegrees(0, 0, 45); const point2 = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).longitude), Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).latitude), Cesium.Cartographic.fromCartesian(tagert).height); - + _this.pointFly = { + lon:Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).longitude), + lat:Cesium.Math.toDegrees(Cesium.Cartographic.fromCartesian(tagert).latitude), + height:Cesium.Cartographic.fromCartesian(tagert).height + } + _this.createDashedLine() + _this.createBillboard() // 璁$畻璺濈锛堝崟浣嶏細绫筹級 - const distance1 = Cesium.Cartesian3.distance(point1, point2) - console.log(distance1) - data.distance = distance1 + const distanceCalculate = Cesium.Cartesian3.distance(point1, point2) + data.distance = distanceCalculate + //鍙抽敭缁撴潫鍚庢妸缂╂斁閲嶇疆涓�1 _this.zoomRatio = 1 _this.createVideoScope(data) setTimeout(() => { viewerC.camera.changed.addEventListener(_this.onCameraChange) }, 100); - - + //宸︿晶鏍戠粨鏋勮仈鍔� + _this.dealTree() //缁撴潫鍙抽敭鐩戝惉 createPinHandler.destroy(); //缁撴潫涓诲浘鑱斿姩楣扮溂鐩戝惉 @@ -428,6 +531,48 @@ } console.log('鍙抽敭鐐瑰嚮鐩戝惉宸插仠姝�'); }, Cesium.ScreenSpaceEventType.RIGHT_CLICK); // 鐩戝惉鍙抽敭鐐瑰嚮 + }, + createDashedLine() { + this.lineEntity = viewerM.entities.add({ + polyline: { + positions: new Cesium.CallbackProperty(() => { + return Cesium.Cartesian3.fromDegreesArrayHeights([ + this.pointGround.lon, this.pointGround.lat, this.pointGround.height, + this.pointFly.lon, this.pointFly.lat, this.pointFly.height, + ]); + }, false), + width: 3, + material: new Cesium.PolylineDashMaterialProperty({ + color: Cesium.Color.RED, + }), + }, + }); + }, + createBillboard() { + // Billboard 涓偣璁$畻 + viewerM.entities.add({ + position: new Cesium.CallbackProperty(() => { + const midLon = (this.pointGround.lon + this.pointFly.lon) / 2; + const midLat = (this.pointGround.lat + this.pointFly.lat) / 2; + const midHeight = (this.pointGround.height + this.pointFly.height) / 2; + return Cesium.Cartesian3.fromDegrees(midLon, midLat, midHeight); + }, false), + label: { + text: new Cesium.CallbackProperty(() => { + return `璺濈: ${this.betweenDistance.toFixed(1)} m\nP: ${this.cameraP}\nT:${this.cameraT}`; + }, false), + font: "16px sans-serif", + fillColor: Cesium.Color.BLACK, + outlineColor: Cesium.Color.WHITE, + outlineWidth: 2, + style: Cesium.LabelStyle.FILL_AND_OUTLINE, + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + horizontalOrigin: Cesium.HorizontalOrigin.CENTER, + pixelOffset: new Cesium.Cartesian2(0, -20), // 鍚戜笂鍋忕Щ + showBackground: true, + backgroundColor: new Cesium.Color(1, 1, 1, 0.7), + }, + }); }, azimuthtwopoi(x1, y1, x2, y2) { let result; @@ -448,8 +593,6 @@ return result; }, changeCamera(position,heading){ - console.log(position) - console.log(heading) viewerC.camera.flyTo({ destination: position, orientation: { @@ -464,7 +607,7 @@ window.addEventListener("keydown", this.onKeyDown); window.addEventListener("keyup", this.onKeyUp); }, - removeKeyboardEvents() { + removeKeyboaardEvents() { window.removeEventListener("keydown", this.onKeyDown); window.removeEventListener("keyup", this.onKeyUp); }, @@ -526,6 +669,7 @@ } }, onKeyUp(event) { + console.log() //閿洏鎶捣杩涜鏇存柊宸︿晶绌轰腑鐐筽in //鑾峰彇鍙充晶鐩告満 if(rightKeyMove){ @@ -551,7 +695,32 @@ } else { groupEntity.position = position; } - console.log(groupEntity) + //璁$畻涓や釜鐐硅窛绂� + console.log(viewerM.entities) + const groupEntityGround = viewerM.entities.getById("groundPoiId"+(counter-1)); + const groupPosition = groupEntityGround.position.getValue(Cesium.JulianDate.now()); + if (groupPosition) { + const cartographic = Cesium.Cartographic.fromCartesian(groupPosition); + const longitude = Cesium.Math.toDegrees(cartographic.longitude); + const latitude = Cesium.Math.toDegrees(cartographic.latitude); + const point1 = Cesium.Cartesian3.fromDegrees(lon, lat); + const point2 = Cesium.Cartesian3.fromDegrees(longitude, latitude); + const gure = Cesium.Cartesian3.distance(point1, point2) + this.betweenDistance = gure + } + if(this.rowData) { + this.pointGround = { + lon:this.rowData.longitude, + lat:this.rowData.latitude, + height:this.rowData.height + } + } + this.pointFly = { + lon: lon, + lat: lat, + height: height + } + this.dealTree() } const key = event.key; const lower = key.toLowerCase(); @@ -718,11 +887,45 @@ // Fly back to the initial view (home) in 1 second viewerC.camera.flyHome(1.0); }, - move_measure_point(){ - CesiumSurvey.measureMovePoint(viewerC,'moveResultCon'); - }, - cammove_measure_point(){ - CesiumSurvey.cammeasureMovePoint(viewerC,'cammoveResultCon'); + dealTree(){ + let allEntities = viewerM.entities.values; // 鎵�鏈夊疄浣撳璞$粍鎴愮殑鏁扮粍 + const grouped = {}; + //鎵�鏈夊疄浣撳璞$粍鎴愮殑鏁扮粍杞崲鎴愬乏渚ф爲闇�瑕佺殑鏍煎紡 + allEntities.forEach(item => { + const match = item.id.match(/(groundPoiId|aerialPoiId)(\d+)/); + if (match) { + const type = match[1]; // groundPoiId or aerialPoiId + const index = match[2]; + if (!grouped[index]) grouped[index] = {}; + grouped[index][type] = item.position; + } + }) + const result = Object.keys(grouped).map((key, idx) => { + const group = grouped[key]; + const positionGround = group.groundPoiId.getValue(Cesium.JulianDate.now()) + const positionAerialPo = group.aerialPoiId.getValue(Cesium.JulianDate.now()) + const groundPos = Cesium.Cartographic.fromCartesian(positionGround); + const aerialPos = Cesium.Cartographic.fromCartesian(positionAerialPo); + return { + id: this.genId(), + label: `鍦伴潰鐐�${idx}`, + longitude: Cesium.Math.toDegrees(groundPos.longitude), + latitude: Cesium.Math.toDegrees(groundPos.latitude), + height: groundPos.height, + children: [ + { + id: this.genId(), + label: `绌轰腑鐐�${idx}`, + longitude: Cesium.Math.toDegrees(aerialPos.longitude), + latitude: Cesium.Math.toDegrees(aerialPos.latitude), + height: aerialPos.height, + heading:Cesium.Math.toDegrees(viewerC.camera.heading), + pitch:Cesium.Math.toDegrees(viewerC.camera.pitch) + } + ] + }; + }); + this.$emit('dealTreeData',result) }, mergePoint(){ let allEntities = viewerM.entities.values; // 鎵�鏈夊疄浣撳璞$粍鎴愮殑鏁扮粍 @@ -760,7 +963,6 @@ ] }; }); - console.log(result) this.$emit('mergePoint',result,this.mergeNumber,viewerM) }, genId() { @@ -791,7 +993,6 @@ }, handleKeydown(e) { const key = e.key; - console.log(key) const validKeys = ["a", "s", "d", "w",'q','e','ArrowUp','ArrowDown','ArrowLeft','ArrowRight','q','e']; if (validKeys.includes(key)) { this.triggerKey(key); @@ -800,8 +1001,6 @@ }, // 鍒涘缓鍒濆鍖栫殑鍏夎酱 createVideoScope(data) { - console.log(data) - console.log(data.distance) if (data == undefined) { this.$message({ showClose: true, @@ -822,7 +1021,6 @@ // Number(data.altitude) + Number(hight[1]) + 1.7 Number(data.altitude) ); - console.log(data) let inverseViewMatrix = this.hpr2m({ position: positionCt3, // 鐩告満鍧愭爣 // heading: Cesium.Math.toRadians(Number(120)), @@ -833,7 +1031,7 @@ roll: Cesium.Math.toRadians(0), }); let frustum = new Cesium.PerspectiveFrustum({ - fov: Cesium.Math.toRadians(1), + fov: Cesium.Math.toRadians(56), aspectRatio: Number(1.77778), // 瀹介珮姣� near: Number(0.05), // 璁惧鐒﹁窛 far: Number(data.distance), // 鎷嶆憚璺濈 @@ -861,16 +1059,12 @@ ); // viewer.scene.primitives.add(cameraVideo); let pmObj = {}; - console.log(data) pmObj.id = data.id; - console.log(pmObj) + pmObj.name = data.name; pmObj.primitive = cameraVideo; - // pmCollection.push(pmObj);//骞曞竷锛岃棰戣浆鎹娇鐢� viewerM.scene.primitives.add(cameraVideo); preVideoScopePrimitiveArrTie.push(pmObj); preVideoScopePrimitiveArrTie.map((item)=>{ - console.log(item) - console.log(chooseId) if(item.id != chooseId){ item.primitive.show = false } @@ -937,18 +1131,38 @@ const heading = Cesium.Math.toDegrees(camera.heading); const pitch = Cesium.Math.toDegrees(camera.pitch); const roll = Cesium.Math.toDegrees(camera.roll); - const point1 = Cesium.Cartesian3.fromDegrees(0, 0, 50); + const point1 = Cesium.Cartesian3.fromDegrees(0, 0, this.deviceData?.modelHeight || 45); const point2 = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(position.longitude),Cesium.Math.toDegrees(position.latitude),position.height) + + var camResult = + position.longitude.toFixed(4) + + '\u00B0' + + ',' + + position.latitude.toFixed(4) + + '\u00B0' + + ',' + + position.height.toFixed(1) + + '绫�,' + + heading.toFixed(2) + + '\u00B0' + + ',' + + pitch.toFixed(2) + + '\u00B0' + + ',' + + roll.toFixed(1) + + '\u00B0'; + console.log(heading) + this.cameraP = heading.toFixed(2) + this.cameraT = pitch.toFixed(2) + document.getElementById('cammoveResultCon').innerHTML = camResult; // 璁$畻璺濈锛堝崟浣嶏細绫筹級 const distanceBetween = Cesium.Cartesian3.distance(point1, point2) - console.log(distanceBetween) - console.log(preVideoScopePrimitiveArrTie) - console.log(chooseId) preVideoScopePrimitiveArrTie.map((item)=>{ if(item.id == chooseId){ let obj = this.updateSZScope(Cesium.Math.toDegrees(position.longitude),Cesium.Math.toDegrees(position.latitude),position.height,heading,pitch,roll,this.zoomRatio,distanceBetween) item.primitive.inverseViewMatrix = obj.M item.primitive.frustum = obj.F + item.primitive.zoomRatio = this.zoomRatio } }) }, @@ -959,22 +1173,18 @@ Number(lat), Number(alt) ); - console.log(positionCt3) - console.log(distanceBetween) let frustum = new Cesium.PerspectiveFrustum({ - fov: Cesium.Math.toRadians(LightView), + fov: Cesium.Math.toRadians(56/LightView), aspectRatio: Number(1.77778), near: Number(0.05), far: Number(distanceBetween), }); - console.log(frustum) let inverseViewMatrixNew = this.hpr2m({ position: positionCt3, heading: Cesium.Math.toRadians(Number(camHeading)), pitch: Cesium.Math.toRadians(Number(camPitch)), roll: Cesium.Math.toRadians(Number(camRoll)), }); - console.log(inverseViewMatrixNew) return {M: inverseViewMatrixNew, F: frustum}; }, handleWheel(event) { @@ -994,7 +1204,150 @@ }, onSliderInput(val) { this.zoomRatio = val; - } + }, + // 璁$畻 heading锛堝亸鑸锛� + computeHeading(fromCartesian, toCartesian) { + const transform = Cesium.Transforms.eastNorthUpToFixedFrame(fromCartesian); + const direction = Cesium.Cartesian3.subtract( + toCartesian, + fromCartesian, + new Cesium.Cartesian3() + ); + const directionLocal = Cesium.Matrix4.multiplyByPointAsVector( + Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4()), + direction, + new Cesium.Cartesian3() + ); + Cesium.Cartesian3.normalize(directionLocal, directionLocal); + return Math.atan2(directionLocal.x, directionLocal.y); + }, + + // 璁$畻 pitch锛堜刊浠拌锛� + computePitch(fromCartesian, toCartesian) { + const transform = Cesium.Transforms.eastNorthUpToFixedFrame(fromCartesian); + const direction = Cesium.Cartesian3.subtract( + toCartesian, + fromCartesian, + new Cesium.Cartesian3() + ); + const directionLocal = Cesium.Matrix4.multiplyByPointAsVector( + Cesium.Matrix4.inverseTransformation(transform, new Cesium.Matrix4()), + direction, + new Cesium.Cartesian3() + ); + Cesium.Cartesian3.normalize(directionLocal, directionLocal); + return Math.asin(directionLocal.z); // z杞村悜涓� + }, + DealVisualCone(data,node){ + this.rowData = data + console.log(data) + this.pointGround = { + lon:data.children[0].longitude, + lat:data.children[0].latitude, + height:data.children[0].height + } + this.pointFly = { + lon:data.longitude, + lat:data.latitude, + height:data.height + } + if(data.children && data.children?.length > 0) { + preVideoScopePrimitiveArrTie.map((item)=>{ + if(item.name != data.children[0].label){ + item.primitive.show = false + }else{ + item.primitive.show = true + } + }) + }else { + preVideoScopePrimitiveArrTie.map((item)=>{ + if(item.name != data.label){ + item.primitive.show = false + }else { + item.primitive.show = true + } + }) + } + }, + editAction(action){ + // 鐐瑰嚮宸︿晶灏忓浘鏍囷紝鍙充晶鍒囨崲鍒拌 action + this.currentAction = action; + console.log(this.currentAction) + if(action.type == '鎮仠') { + this.time = action.extra.value + } else if(action.type == '鎷嶇収'){ + this.newTakePhoto = action.extra.value + }else if(action.type == '寮�濮嬪綍鍍�'){ + this.newTakeVideo = action.extra.value + }else if(action.type == '缁撴潫褰曞儚'){ + } + }, + changeTime(val) { + this.time += val; + if (this.time < 0) this.time = 0; // 鏈�灏忓�奸檺鍒� + this.currentAction.extra.value = this.time + console.log(this.currentAction) + }, + onChange(value) { + if (value < 0) this.time = 0; + }, + startEditing() { + this.newTakePhoto = this.takePhoto; // 杩涘叆缂栬緫鏃讹紝淇濆瓨褰撳墠鐨勫�� + this.isEditingPhoto = true; + window.removeEventListener("keydown", this.onKeyDown); + window.removeEventListener("keyup", this.onKeyUp); + }, + validateInput() { + console.log(this.newTakePhoto) + this.takePhoto = this.newTakePhoto; // 鐐瑰嚮瀵瑰彿鏃讹紝鏇存柊鏁版嵁 + this.isEditingPhoto = false; // 缁撴潫缂栬緫 + this.currentAction.extra.value = this.takePhoto + }, + cancelEditing() { + this.newTakePhoto = this.takePhoto; // 鐐瑰嚮鍙栨秷鏃讹紝鎭㈠鍘熸暟鎹� + this.isEditingPhoto = false; // 缁撴潫缂栬緫 + }, + startEditingVideo() { + this.newTakeVideo = this.takeVideo; // 杩涘叆缂栬緫鏃讹紝淇濆瓨褰撳墠鐨勫�� + this.isEditingVideo = true; + }, + validateVideoInput() { + this.takeVideo = this.newTakeVideo; // 鐐瑰嚮瀵瑰彿鏃讹紝鏇存柊鏁版嵁 + this.isEditingVideo = false; // 缁撴潫缂栬緫 + this.currentAction.extra.value = this.takeVideo + }, + cancelVideoEditing() { + this.newTakeVideo = this.takeVideo; // 鐐瑰嚮鍙栨秷鏃讹紝鎭㈠鍘熸暟鎹� + this.isEditingVideo = false; // 缁撴潫缂栬緫 + }, + doAction(point, type){ + this.actionCounter++; + let action = { + id: this.actionCounter, + type, + extra: {} + }; + if(type == '鎮仠') { + action.extra.value = this.time + } else if(type == '鎷嶇収'){ + action.extra.value = this.newTakePhoto + }else if(type == '寮�濮嬪綍鍍�'){ + action.extra.value = this.newTakeVideo + }else if(type == '缁撴潫褰曞儚'){ + action.extra.value = 'stopVideo' + } + console.log(action) + point.actions.push(action); + console.log(point) + this.$emit('dealAction',point) + this.time = 10 + this.newTakePhoto = '111' + this.newTakeVideo = '111' + this.takeVideo = '111' + this.takePhoto = '111' + // 鍒囨崲鍒板彸渚� + this.currentAction = action; + }, } } </script> @@ -1007,7 +1360,7 @@ #cesiumContainer { margin: 0; padding: 0; - width: 73%; + width: 74%; height: calc(100vh - 205px); } #cesiumCamera { @@ -1032,10 +1385,65 @@ /* padding: 0 5px; */ margin-top: 10px; right: 0px; - width: 420px; + width: 410px; height: calc(100vh - 210px); bottom: 30px; margin: 0; +} +.cesiumContent { + position: absolute; + width: 100%; + height: calc(50% + 5px); + top:-5px; + +} +.stopContent { + display: flex; + align-items: center; +} +.stopContent .el-button--mini { + padding: 4px 9px; +} +.stopNumber { + flex: 1; + justify-content: center; + align-items: center; + margin: 0 4px; + display: flex +} +.stopNumber .el-input .el-input--medium .el-input--medium .el-input__inner { + height: 28px!important; + line-height: 28px!important; + +} +.flyAction{ + height: 55px; + line-height: 55px; + background-color: #232323; + display: flex; + justify-content: space-between; + border-bottom: 1px solid #ddd; +} +.actionName { + margin-left: 20px; + font-size: 14px; + color: white; +} +.flyAction i { + font-size: 18px; + line-height: 55px; + margin-right: 20px; +} +.flayDataAll { + background-color:#232323; + height: calc(100% - 55px); + width: 100%; +} +.flyData{ + width: calc(100% - 32px); + height: calc(100% - 55px); + margin: auto; + color: white; } .cesiumButtonGroup{ position: absolute; @@ -1045,7 +1453,7 @@ } .moveResult{position:absolute;z-index:2;background-color:rgba(47,53,60,1);padding:0 5px;right:50%;bottom:30px; border:1px solid rgba(255,255,255,.1);box-sizing:content-box;width:220px;height:30px;font-size:14px;text-align:center} -.cammoveResult{position:absolute;z-index:2;background-color:rgba(47,53,60,1);padding:0 5px;right:calc(50% - 40px);bottom:30px; +.cammoveResult{position:absolute;z-index:2;background-color:rgba(47,53,60,1);padding:0 5px;right:calc(50% - 140px);bottom:35px; border:1px solid rgba(255,255,255,.1);box-sizing:content-box;width:400px;height:30px;font-size:14px;text-align:center} .moveResultCon{margin-top:4px} .cammoveResultCon{margin-top:4px;color: white;} @@ -1065,7 +1473,9 @@ font-family: sans-serif; margin-top: 55px; } - +.el-icon-delete { + cursor: pointer; /* 娣诲姞榧犳爣鎮仠鏃剁殑灏忔墜鏁堟灉 */ +} .arrow-row{ display: flex; justify-content: center; @@ -1134,8 +1544,8 @@ /* 宸︿笅瑙掑�嶇巼鏍囩 */ .zoom-info { position: absolute; - bottom: 20px; - left: 20px; + bottom: 35px; + left: 340px; } </style> @@ -1143,4 +1553,61 @@ .el-slider.is-vertical .el-slider__marks-text{ width: 30px!important; } +</style> +<style> +.custom-input .el-input__inner { + height: 28px; + line-height:28px; +} +</style> +<style scoped> +.editable-text { + display: flex; + align-items: center; + cursor: pointer; + font-size: 16px; + color: #fff; + background-color: #333; + padding: 8px; + border-radius: 5px; +} +.editable-text .el-icon-edit { + position: absolute; + right: 30px; +} +.edit-icon { + margin-left: 10px; + font-size: 20px; + cursor: pointer; +} + +.editable-container { + display: flex; + align-items: center; +} + +.editable-input { + font-size: 16px; + padding: 5px; + border: 1px solid #ccc; + margin-right: 5px; + border-radius: 5px; +} + +.validate-btn, .cancel-btn { + background-color: transparent; + border: none; + color: #fff; + font-size: 20px; + cursor: pointer; + margin-left: 5px; +} + +.validate-btn { + color: green; +} + +.cancel-btn { + color: red; +} </style> \ No newline at end of file -- Gitblit v1.9.3