From deccf053a8e07b82f4cd8b95b3243f4c5f1d2b86 Mon Sep 17 00:00:00 2001
From: Jin Lei <jinlei_182@163.com>
Date: 星期四, 16 十一月 2023 10:29:06 +0800
Subject: [PATCH] 1.弹窗修复

---
 src/components/menu/tools/special.vue |  187 +++++++++++++++++++++-------------------------
 1 files changed, 87 insertions(+), 100 deletions(-)

diff --git a/src/components/menu/tools/special.vue b/src/components/menu/tools/special.vue
index 8d097a1..d831e0e 100644
--- a/src/components/menu/tools/special.vue
+++ b/src/components/menu/tools/special.vue
@@ -2,52 +2,28 @@
   <div class="special" id="special">
     <div class="specialTools">
       <div class="specialTool" @click="tdglHandle">
-        <el-tooltip
-          class="item"
-          effect="dark"
-          content="鍦熷湴绠$悊"
-          placement="top-start"
-          popper-class="item_tooltip"
-        >
+        <el-tooltip class="item" effect="dark" content="鍦熷湴绠$悊" placement="top-start" popper-class="item_tooltip">
           <el-button>
             <img src="@/assets/img/left/ztfx/tdgl.png" />
           </el-button>
         </el-tooltip>
       </div>
       <div class="specialTool" @click="stdsj">
-        <el-tooltip
-          class="item"
-          effect="dark"
-          content="瑙嗗浘澶ф暟鎹钩鍙�"
-          placement="top-start"
-          popper-class="item_tooltip"
-        >
+        <el-tooltip class="item" effect="dark" content="瑙嗗浘澶ф暟鎹钩鍙�" placement="top-start" popper-class="item_tooltip">
           <el-button>
             <img src="@/assets/img/left/ztfx/dashuju.png" />
           </el-button>
         </el-tooltip>
       </div>
       <div class="specialTool" @click="spjkHandle">
-        <el-tooltip
-          class="item"
-          effect="dark"
-          content="瑙嗛鐩戞帶"
-          placement="top-start"
-          popper-class="item_tooltip"
-        >
+        <el-tooltip class="item" effect="dark" content="瑙嗛鐩戞帶" placement="top-start" popper-class="item_tooltip">
           <el-button>
             <img src="@/assets/img/left/ztfx/spjk.png" />
           </el-button>
         </el-tooltip>
       </div>
       <div class="specialTool" @click="jjHandle">
-        <el-tooltip
-          class="item"
-          effect="dark"
-          content="琛楁櫙"
-          placement="top-start"
-          popper-class="item_tooltip"
-        >
+        <el-tooltip class="item" effect="dark" content="琛楁櫙" placement="top-start" popper-class="item_tooltip">
           <el-button>
             <img src="@/assets/img/left/ztfx/jiejing.png" />
           </el-button>
@@ -55,27 +31,24 @@
       </div>
 
       <div class="specialTool" @click="qytj">
+        <el-tooltip class="item" effect="dark" content="鏁版嵁姹囪仛" placement="top-start" popper-class="item_tooltip">
+          <el-button> <img src="@/assets/img/left/ztfx/yqfk.png" /> </el-button></el-tooltip>
+      </div>
+      <div class="specialTool" @click="rangeQuery()">
+        <el-tooltip class="item" effect="dark" content="鑼冨洿鏌ヨ" placement="top-start" popper-class="item_tooltip">
+          <el-button> <img src="@/assets/img/left/ztfx/sjxq.png" /> </el-button></el-tooltip>
+      </div>
+      <!-- <div class="specialTool" @click="guanxian(openGX)">
         <el-tooltip
           class="item"
           effect="dark"
-          content="鏁版嵁姹囪仛"
+          content="鍦颁笅绠$嚎"
           placement="top-start"
           popper-class="item_tooltip"
         >
-          <el-button> <img src="@/assets/img/left/ztfx/yqfk.png" /> </el-button
+          <el-button> <img src="@/assets/img/left/ztfx/spl.png" /> </el-button
         ></el-tooltip>
-      </div>
-      <div class="specialTool" @click="kuangxuan()">
-        <el-tooltip
-          class="item"
-          effect="dark"
-          content="鑼冨洿鏌ヨ"
-          placement="top-start"
-          popper-class="item_tooltip"
-        >
-          <el-button> <img src="@/assets/img/left/ztfx/sjxq.png" /> </el-button
-        ></el-tooltip>
-      </div>
+      </div> -->
       <!-- <div class="specialTool" @click="sceneRoaming">
         <el-tooltip
           class="item"
@@ -110,10 +83,12 @@
   width: 111%;
   margin-left: -15px;
 }
+
 .el-button:focus,
 .el-button:hover {
   background: transparent;
 }
+
 .special {
   position: absolute;
   left: 65px;
@@ -122,11 +97,13 @@
   /* border-radius: 30px; */
   box-shadow: 0px 0px 7px rgba(76, 165, 248, 0.8) inset;
   background-color: rgba(14, 50, 143, 0.5);
-  width: 460px;
+  width: 350px;
 }
+
 .specialTools {
   margin-left: 20px;
 }
+
 .specialTool {
   border: 1px solid #999;
   border-radius: 5px;
@@ -135,9 +112,11 @@
   height: 40px;
   margin: 5px;
 }
+
 .specialTool img {
   margin: 4px;
 }
+
 .specialTools::-webkit-scrollbar {
   /*婊氬姩鏉℃暣浣撴牱寮�*/
   width: 5px;
@@ -162,6 +141,7 @@
   border-radius: 0;
   background: rgba(218, 218, 218, 0.1);
 }
+
 .specialTool:hover {
   background: rgba(0, 168, 255, 0.16);
 }
@@ -169,9 +149,11 @@
 .tool-title {
   margin: 1px 10px;
 }
+
 .tool-title label {
   vertical-align: top;
 }
+
 .special label {
   margin-left: 10px;
   font-size: 17px;
@@ -180,6 +162,7 @@
   /* color: #3d3d3d; */
   color: white;
 }
+
 .el-button {
   padding: 0 !important;
   font-size: 24px;
@@ -188,14 +171,17 @@
   display: block;
   background: rgba(0, 0, 0, 0);
 }
+
 .el-button label {
   font-size: 14px;
 }
+
 .closeTool {
   position: absolute;
   bottom: 0;
   left: 0;
 }
+
 .active {
   background: rgba(0, 168, 255, 0.16);
 }
@@ -207,7 +193,6 @@
 import Bus from "../../tools/Bus";
 import { roman } from "../../../assets/json/index.js";
 import URLInCode from "@/assets/js/urlInCode";
-
 let handler;
 let pickFeature;
 let tooltipHTML;
@@ -220,12 +205,14 @@
 let video2;
 let video3;
 let video4;
+let promiseS3M;
 //浜ら�氬浘灞�
 let panoramaLayer;
 export default {
   name: "special",
   data() {
     return {
+      openGX: "open",
       showPointInfo: true,
       romanOption: [
         { name: "鏍稿績鍖�" },
@@ -331,7 +318,7 @@
     ...mapState(["viewer1Show", "yqfk", "cesiumInit"]),
     ...mapState(["viewer1Show", "yqfk", "qyEchartsShow"]),
   },
-  mounted() {},
+  mounted() { },
   watch: {
     cesiumInit: {
       handler(newVal, oldVal) {
@@ -406,7 +393,7 @@
               sgworld.drawObj &&
                 (sgworld.drawObj.drawHandler &&
                   sgworld.drawObj.drawHandler.destroy(),
-                sgworld.drawObj.end && sgworld.drawObj.end());
+                  sgworld.drawObj.end && sgworld.drawObj.end());
 
               let props = pick.id.properties;
               let screenHeight =
@@ -462,7 +449,7 @@
     yqfkHandle() {
       this.setYqfk(!this.yqfk);
     },
-    kuangxuan() {
+    rangeQuery() {
       Bus.$emit("showRangeBox", true);
     },
     tdglHandle() {
@@ -485,7 +472,7 @@
           {},
           "0",
           true,
-          function () {}
+          function () { }
         );
         window.panoramaHandler = new Cesium.ScreenSpaceEventHandler(
           Viewer.scene.canvas
@@ -511,7 +498,7 @@
       } else {
         try {
           window.panoramaLayer.deleteObject();
-        } catch (e) {}
+        } catch (e) { }
         window.panoramaHandler.destroy();
         window.panoramaHandler = undefined;
       }
@@ -547,9 +534,7 @@
       handler.setInputAction((event) => {
         let nPickFeature = sgworld.Viewer.scene.pick(event.position);
         if (Cesium.defined(nPickFeature)) {
-          // console.log(nPickFeature);
           if (nPickFeature.primitive instanceof Cesium.Billboard) {
-            console.log(nPickFeature.id);
             if (nPickFeature.id.length > 0) {
               return;
             }
@@ -565,18 +550,20 @@
             let obj = {};
             let lng;
             let lat;
+            let isCamera = false;
             if (nPickFeature.id.tag) {
               let properties = nPickFeature.id.properties;
               let propertyNames = nPickFeature.id.properties.propertyNames;
-              // console.log(propertyNames);
               if (propertyNames.indexOf("鐩戞帶鍚�") !== -1) {
-                obj["JK鍚嶇О"] = properties["JK鍚嶇О"]._value;
-                obj["JK绫诲瀷"] = properties["JK绫诲瀷"]._value;
-                obj["鍔熻兘"] = properties["鍔熻兘"]._value;
-                obj["鎵�鍦ㄥ尯"] = properties["鎵�鍦ㄥ尯"]._value;
-                obj["JK缂栧彿"] = properties["JK缂栧彿"]._value;
-                obj["JK鍐呯爜"] = properties["JK鍐呯爜"]._value;
+                isCamera = true;
+                // obj["JK鍚嶇О"] = properties["JK鍚嶇О"]._value;
+                // obj["JK绫诲瀷"] = properties["JK绫诲瀷"]._value;
+                // obj["鍔熻兘"] = properties["鍔熻兘"]._value;
+                // obj["鎵�鍦ㄥ尯"] = properties["鎵�鍦ㄥ尯"]._value;
+                // obj["JK缂栧彿"] = properties["JK缂栧彿"]._value;
+                // obj["JK鍐呯爜"] = properties["JK鍐呯爜"]._value;
               } else {
+
                 propertyNames.forEach((item) => {
                   obj[item] = properties[item]._value;
                 });
@@ -593,32 +580,31 @@
               lng = nPickFeature.id.positions[0];
               lat = nPickFeature.id.positions[1];
             }
+            if (!isCamera) {
+              tooltipHTML = "";
+              // console.log(obj);
 
-            tooltipHTML = "";
-            // console.log(obj);
+              for (let i in obj) {
+                let value = obj[i];
+                value && (tooltipHTML += `<p>${i}锛�${value || "鏃�"}</p>`);
+              }
 
-            for (let i in obj) {
-              let value = obj[i];
-              value && (tooltipHTML += `<p>${i}锛�${value || "鏃�"}</p>`);
-            }
+              if (tooltip) {
+                tooltip.show(false);
+                tooltip = null;
+              }
+              tooltip = sgworld.Core.CreateResultTooltip(window.Viewer, {
+                color: "black",
+                addY: -40,
+                far: 200000,
+                closeBtn: true,
+                close: () => {
+                  this.resetImg();
+                  this.resetBorder();
+                },
+              });
 
-            if (tooltip) {
-              tooltip.show(false);
-              tooltip = null;
-            }
-
-            tooltip = sgworld.Core.CreateResultTooltip(window.Viewer, {
-              color: "black",
-              addY: -40,
-              far: 200000,
-              closeBtn: true,
-              close: () => {
-                this.resetImg();
-                this.resetBorder();
-              },
-            });
-
-            let description = `<div style='background: 
+              let description = `<div style='background: 
                                       rgba(14, 50, 143, 0.6);
                                       border: 1px solid #205fbc;
                                        border-radius: 5px;
@@ -627,11 +613,11 @@
                                        box-shadow: 0px 1px 10px 0px rgba(3, 10, 26, 0.38);
                                        '>${tooltipHTML}</div>`;
 
-            tooltip.showAt(
-              Cesium.Cartesian3.fromDegrees(lng, lat, 0),
-              description
-            );
-
+              tooltip.showAt(
+                Cesium.Cartesian3.fromDegrees(lng, lat, 0),
+                description
+              );
+            }
             //鍏抽棴鍦板潡淇℃伅寮圭獥
             Bus.$emit("closeLandInfoPop", true);
             layuiLayer.close(SmartEarthPopupData.layerProp);
@@ -798,20 +784,7 @@
         });
       });
     },
-    spjkHandle() {
-      if (window.sxtkGeojson) {
-        window.sxtkGeojson.deleteObject();
-        window.sxtkGeojson = null;
-        window.sxthandler.destroy();
-        //鍏抽棴寮圭獥
-        Bus.$emit("closeRightPop", true);
-        layuiLayer.close(SmartEarthPopupData.layerProp);
-        return;
-      } else {
-        Bus.$emit("showSPJK");
-        // this.spjkLoad();
-      }
-    },
+
     handleCommand(command) {
       switch (command) {
         case "qytj":
@@ -887,6 +860,20 @@
       video && video.destroy();
       video = undefined;
     },
+    guanxian(params) {
+      if (params == "open") {
+        promiseS3M = sgworld.coreMap.scene.open(
+          "http://192.162.2.2:8090/iserver/services/3D-GX/rest/realspace"
+        );
+        this.openGX = "close";
+      } else {
+        promiseS3M.then((res) => {
+          res.forEach((item) => {
+            item.visible = false;
+          });
+        });
+      }
+    },
   },
 };
 </script>

--
Gitblit v1.9.3