From 0b906280ec163a3e80364e091550d8462db6b9f9 Mon Sep 17 00:00:00 2001
From: jihongshun <1151753686@qq.com>
Date: 星期四, 28 八月 2025 17:25:25 +0800
Subject: [PATCH] 更改默认值

---
 src/utils/components/init-map.vue |   66 ++++++++++++++++++++++++---------
 1 files changed, 48 insertions(+), 18 deletions(-)

diff --git a/src/utils/components/init-map.vue b/src/utils/components/init-map.vue
index 0ebe244..57afe58 100644
--- a/src/utils/components/init-map.vue
+++ b/src/utils/components/init-map.vue
@@ -45,7 +45,7 @@
       <div class="cesiumContent">
         <div class="flyAction">
           <div class="actionName">{{currentAction ?currentAction.type :'' }}</div>
-          <i class="el-icon-delete" />
+          <i class="el-icon-delete" @click="deleteAction(chooseItem)" />
         </div>
         <div class="flayDataAll">
           <div class="flyData">
@@ -198,7 +198,7 @@
 let  pois = [globalon, globalat,0] 
 let cameraVideo 
 let ScopeElement; //鍏夎酱銆佽棰�
-let preVideoScopePrimitiveArrTie = [];
+// let preVideoScopePrimitiveArrTie = [];
 let scratchSetViewMatrix3 = new Cesium.Matrix3();
 let chooseId
 // let  pois = [0, 0,0] 
@@ -262,14 +262,15 @@
         pointFly: { lon: 0, lat: 0, height: 0 },
         rowData:null,
         time: 10,
-        takePhoto: '111',  // 鍒濆鏁版嵁
+        takePhoto: '榛樿鍚嶇О',  // 鍒濆鏁版嵁
         newTakePhoto: '',  // 缂栬緫鏃剁殑鏂版暟鎹�
         isEditingPhoto: false,  // 鎺у埗鏄惁澶勪簬缂栬緫鐘舵��
-        takeVideo: '111',  // 鍒濆鏁版嵁
+        takeVideo: '榛樿鍚嶇О',  // 鍒濆鏁版嵁
         newTakeVideo: '',  // 缂栬緫鏃剁殑鏂版暟鎹�
         isEditingVideo: false,  // 鎺у埗鏄惁澶勪簬缂栬緫鐘舵��
         actionCounter:0,
-        currentAction:null
+        currentAction:null,
+        preVideoScopePrimitiveArrTie:[]
     }
   },
   mounted(){
@@ -941,6 +942,7 @@
         }
       })
       const result = Object.keys(grouped).map((key, idx) => {
+        console.log(group)
         const group = grouped[key];
         const positionGround = group.groundPoiId.getValue(Cesium.JulianDate.now())
         const positionAerialPo = group.aerialPoiId.getValue(Cesium.JulianDate.now())
@@ -1063,8 +1065,8 @@
         pmObj.name = data.name;
         pmObj.primitive = cameraVideo;
         viewerM.scene.primitives.add(cameraVideo);
-        preVideoScopePrimitiveArrTie.push(pmObj);
-        preVideoScopePrimitiveArrTie.map((item)=>{
+        this.preVideoScopePrimitiveArrTie.push(pmObj);
+        this.preVideoScopePrimitiveArrTie.map((item)=>{
           if(item.id != chooseId){
             item.primitive.show = false
           }
@@ -1157,7 +1159,7 @@
       document.getElementById('cammoveResultCon').innerHTML = camResult;
       // 璁$畻璺濈锛堝崟浣嶏細绫筹級
       const distanceBetween = Cesium.Cartesian3.distance(point1, point2)
-      preVideoScopePrimitiveArrTie.map((item)=>{
+      this.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
@@ -1241,18 +1243,19 @@
     DealVisualCone(data,node){
       this.rowData = data
       console.log(data)
-      this.pointGround = {
+      console.log(this.preVideoScopePrimitiveArrTie)
+      this.pointFly = {
         lon:data.children[0].longitude,
         lat:data.children[0].latitude,
         height:data.children[0].height
       }
-      this.pointFly = {
+      this.pointGround = {
         lon:data.longitude,
         lat:data.latitude,
         height:data.height
       }
       if(data.children && data.children?.length > 0) {
-        preVideoScopePrimitiveArrTie.map((item)=>{
+        this.preVideoScopePrimitiveArrTie.map((item)=>{
           if(item.name != data.children[0].label){
             item.primitive.show = false
           }else{
@@ -1260,7 +1263,7 @@
           }
         })
       }else {
-        preVideoScopePrimitiveArrTie.map((item)=>{
+        this.preVideoScopePrimitiveArrTie.map((item)=>{
           if(item.name != data.label){
             item.primitive.show = false
           }else {
@@ -1283,6 +1286,21 @@
       }else if(action.type == '缁撴潫褰曞儚'){
       }
     },
+    deleteAction(item){
+      console.log(item.children[0].actions)
+      if(!this.currentAction) return;
+      console.log(this.currentAction)
+      const point = this.currentAction.point;
+      // 浠� point.actions 涓垹闄�
+      const index = item.children[0].actions.findIndex(a => a.id === this.currentAction.id);
+      if(index !== -1){
+        item.children[0].actions.splice(index, 1);
+      }
+
+      this.$message.success("宸插垹闄ゆ搷浣�");
+      this.currentAction = null;
+      this.$emit('dealAction',item)
+    },
     changeTime(val) {
       this.time += val;
       if (this.time < 0) this.time = 0; // 鏈�灏忓�奸檺鍒�
@@ -1303,25 +1321,36 @@
       this.takePhoto = this.newTakePhoto;  // 鐐瑰嚮瀵瑰彿鏃讹紝鏇存柊鏁版嵁
       this.isEditingPhoto = false;  // 缁撴潫缂栬緫
       this.currentAction.extra.value = this.newTakePhoto
+      window.addEventListener("keydown", this.onKeyDown);
+      window.addEventListener("keyup", this.onKeyUp);
     },
     cancelEditing() {
       this.newTakePhoto = this.takePhoto;  // 鐐瑰嚮鍙栨秷鏃讹紝鎭㈠鍘熸暟鎹�
       this.isEditingPhoto = false;  // 缁撴潫缂栬緫
+      window.addEventListener("keydown", this.onKeyDown);
+      window.addEventListener("keyup", this.onKeyUp);
     },
     startEditingVideo() {
       this.newTakeVideo = this.takeVideo;  // 杩涘叆缂栬緫鏃讹紝淇濆瓨褰撳墠鐨勫��
       this.isEditingVideo = true;
+      window.removeEventListener("keydown", this.onKeyDown);
+      window.removeEventListener("keyup", this.onKeyUp);
     },
     validateVideoInput() {
       this.takeVideo = this.newTakeVideo;  // 鐐瑰嚮瀵瑰彿鏃讹紝鏇存柊鏁版嵁
       this.isEditingVideo = false;  // 缁撴潫缂栬緫
       this.currentAction.extra.value = this.newTakeVideo
+      window.addEventListener("keydown", this.onKeyDown);
+      window.addEventListener("keyup", this.onKeyUp);
     },
     cancelVideoEditing() {
       this.newTakeVideo = this.takeVideo;  // 鐐瑰嚮鍙栨秷鏃讹紝鎭㈠鍘熸暟鎹�
       this.isEditingVideo = false;  // 缁撴潫缂栬緫
+      window.addEventListener("keydown", this.onKeyDown);
+      window.addEventListener("keyup", this.onKeyUp);
     },
     doAction(point, type){
+      console.log(point)
       this.actionCounter++;
       let action = { 
         id: this.actionCounter, 
@@ -1338,14 +1367,14 @@
           action.extra.value = 'stopVideo'
       }
       console.log(action)
-      point.actions.push(action);
+      point.children[0].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.newTakePhoto = '榛樿鍚嶇О'
+      this.newTakeVideo = '榛樿鍚嶇О'
+      this.takeVideo = '榛樿鍚嶇О'
+      this.takePhoto = '榛樿鍚嶇О'
       // 鍒囨崲鍒板彸渚�
       this.currentAction = action;
     },
@@ -1441,6 +1470,7 @@
   background-color:#232323;
   /* height: calc(100% - 55px); */
   height: calc(100% - 5px);
+  height: calc(100% +  15px);
   width: 100%;
 }
 .flyData{
@@ -1460,7 +1490,7 @@
 .groundPoi {
   position: absolute;
   top: 15px;
-  left: 350px;
+  left: 340px;
 }
 .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}

--
Gitblit v1.9.3