From 4509dd489115a499a0f63487ec90adfdc7a5cd56 Mon Sep 17 00:00:00 2001
From: lixuliang <lixuliang_hd@126.com>
Date: 星期五, 20 十月 2023 11:09:35 +0800
Subject: [PATCH] 最新版本

---
 src/components/map/viewer.vue |   57 +++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 16 deletions(-)

diff --git a/src/components/map/viewer.vue b/src/components/map/viewer.vue
index e26d5f5..99fb0d1 100644
--- a/src/components/map/viewer.vue
+++ b/src/components/map/viewer.vue
@@ -3,7 +3,6 @@
     <div id="sdkContainer"></div>
     <layerTreeTwoScreen v-if="layerTreeTwoScreen" />
     <!-- <div id="bottomInfo" v-html="bottomInfo"></div> -->
-
     <div
       id="switchImagerLayer"
       :style="{
@@ -55,7 +54,7 @@
 import sanwei from "@/assets/img/new/sanwei.png";
 import jiejing from "@/assets/img/new/jiejing.png";
 import "animate.css";
-
+import Bus from "@tools/Bus";
 export default {
   name: "viewer",
   components: {
@@ -89,6 +88,7 @@
         "sdkContainer",
         {
           StaticFileBaseUrl: "../../../static/CimSDK/",
+          // StaticFileBaseUrl: "../../../SW/static/CimSDK/",
         },
         {},
         {},
@@ -141,26 +141,49 @@
       // Viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
       Viewer.scene.globe.translucency.frontFaceAlpha = 0.5;
       Viewer.scene.globe.undergroundColor = undefined;
-      //鏍囦細缂栬緫
+      //寮�鍚紪杈戝苟鍚敤灞炴�у脊绐�
       sgworld.Creator.SimpleGraphic.setEdit(true, {
         editProp: true,
         editPropData: {
-          offset: ["5%", Viewer.container.offsetWidth - 360 - 200 + "px"],
-          // offset: ["5%", Viewer.container.offsetWidth - 360 - 110 + "px"],
-          height: 650,
-          success(layero, index) {
-            let contentWindow = layero.find("iframe")[0].contentWindow;
-            let layeroHeight = layero.height();
-            let titleHeight = layero.find(".layui-layer-title").height();
-            let htmlHeight =
-              contentWindow.document.firstElementChild.offsetHeight;
-            if (layeroHeight > titleHeight + htmlHeight) {
-              layero.height(titleHeight + htmlHeight);
-              layero.find("iframe").height(htmlHeight);
+          offset: "r",
+          height: "60%",
+        },
+        callBack: {
+          delete: function (entity) {
+            Bus.$emit("removeTreeNode", entity);
+          },
+          end: function (entity) {
+            if (entity) {
+              let style = sgworld.Creator.SimpleGraphic.getStyle(entity);
+              let data = {
+                name: entity.name,
+                style: style,
+              };
+              Bus.$emit("updataTreeNode", entity.id, data);
             }
           },
         },
       });
+      //鏍囦細缂栬緫
+      // sgworld.Creator.SimpleGraphic.setEdit(true, {
+      // editProp: true,
+      // editPropData: {
+      //   offset: ["5%", Viewer.container.offsetWidth - 360 - 200 + "px"],
+      //   // offset: ["5%", Viewer.container.offsetWidth - 360 - 110 + "px"],
+      // height: 650,
+      //   success(layero, index) {
+      //     let contentWindow = layero.find("iframe")[0].contentWindow;
+      //     let layeroHeight = layero.height();
+      //     let titleHeight = layero.find(".layui-layer-title").height();
+      //     let htmlHeight =
+      //       contentWindow.document.firstElementChild.offsetHeight;
+      //     if (layeroHeight > titleHeight + htmlHeight) {
+      //       layero.height(titleHeight + htmlHeight);
+      //       layero.find("iframe").height(htmlHeight);
+      //     }
+      //   },
+      // },
+      // });
       //鍐涙爣缂栬緫
       sgworld.Creator.MilitaryPlotting.setEdit(true, {
         editProp: true,
@@ -189,7 +212,7 @@
     this.size = size + "%";
   },
   methods: {
-    ...mapMutations(["setCesiumInit"]),
+    ...mapMutations(["setCesiumInit", "updataTreeNode"]),
     detectZoom() {
       var ratio = 0,
         screen = window.screen,
@@ -242,6 +265,7 @@
       });
     },
     //鍒濆鍖栧脊绐椾簨浠�
+
     initLayerOpen() {
       window.layerOpen = function (name, options) {
         layuiLayer.close(SmartEarthPopupData.layerProp);
@@ -373,6 +397,7 @@
   },
 };
 </script>
+
 <style scoped>
 #bottomInfo {
   position: absolute;

--
Gitblit v1.9.3