Sfoglia il codice sorgente

隐藏显示后居中bug

Rmengdi 2 mesi fa
parent
commit
0533eaa37d
1 ha cambiato i file con 8 aggiunte e 16 eliminazioni
  1. 8 16
      uavps-web/src/views/system/task/index.vue

+ 8 - 16
uavps-web/src/views/system/task/index.vue

@@ -1467,6 +1467,7 @@ export default {
       this.showTrajectory = false;
     },
     handleCenter() {
+      console.log("this.targetDataR", this.targetDataR);
       const firstKey = Object.keys(this.targetDataR)[0];
       // 获取到第一个飞机的位置
       const posX = this.targetDataR[`${firstKey}`].x;
@@ -1749,11 +1750,6 @@ export default {
                     // 插入新属性和值
                     this.targetLblAry[findItem.changeNo] = lbl;
                     this.changeNoList.splice(index, 1);
-                    console.log(
-                      "this.targetLblAry",
-                      this.changeNoList,
-                      this.targetLblAry
-                    );
                   }
                 }
               }
@@ -1938,13 +1934,19 @@ export default {
               this.hideList.splice(index, 1);
             }
             this.allId.push(maxNum);
+            if (item.parent) {
+              item.parent.removeChild(item);
+            }
+
+            // 可选:销毁精灵并释放资源
+            item.destroy();
+            delete this.targetDataR[item.id];
           }
 
           // item.visible = true;
         });
       } else {
         // 隐藏
-        console.log("group", group);
         group.forEach((item) => {
           if (item.typeName) {
             const msg = "DISAPPEAR:" + item.id;
@@ -2008,16 +2010,6 @@ export default {
         this.pixiApp.stage.scale.x *= zoomFactor;
         this.pixiApp.stage.scale.y *= zoomFactor;
       });
-
-      // 画布双击事件;
-      // this.pixiApp.renderer.view.addEventListener("dblclick", (event) => {
-      //   console.log("event", event);
-      //   const position = new PIXI.Point(event.offsetX, event.offsetY);
-      //   // 获取鼠标在画布上的位置
-      //   const localPosition =
-      //     this.pixiApp.renderer.plugins.interaction.mouse.global;
-      //   console.log("画布被点击的位置:", position);
-      // });
     },
     // 更新无人机飞行路径
     updatePath(id, x, y) {