From ff5731b6a22c9f2451dc8065d2fa32153bdd4a1a Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期一, 22 五月 2023 10:38:04 +0800
Subject: [PATCH] 图层管理,空间查询修改

---
 src/views/Tools/LayerTree.vue |   62 +++++++++++++++++++------------
 1 files changed, 38 insertions(+), 24 deletions(-)

diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue
index 01a4ac7..352fd35 100644
--- a/src/views/Tools/LayerTree.vue
+++ b/src/views/Tools/LayerTree.vue
@@ -115,7 +115,7 @@
       <div
         class="edit"
         @click="pellucidity()"
-        v-if="showlocal"
+        v-if="showopaque"
       >
         <i class="el-icon-tickets"></i>&nbsp;&nbsp;閫忔槑搴�
       </div>
@@ -227,6 +227,7 @@
     return {
       shwoHistogram: false,
       showlocal: false,
+      showopaque: false,
       eleId: "",
       isShow: false,
       currentData: "",
@@ -321,12 +322,18 @@
       }
       this.currentData = object;
       this.currentNode = Node;
-      this.menuVisible = true;
+
       this.$store.state.propertiesName = this.currentData;
-      if (this.currentData.serveType == "Tileset" || this.currentData.serveType == "3DML") {
+      this.showModelAttach = false;
+      this.shwoTitle = false;
+      this.menuVisible = true;
+
+      if (this.currentData.serveType == 'TMS') {
+        this.shwoTitle = true
+      } else if (this.currentData.serveType == "Tileset" || this.currentData.serveType == "3DML") {
         this.showModelAttach = true;
-      } else {
-        this.showModelAttach = false;
+      } else if (this.currentData.serveType == "DEM" || this.currentData.serveType == "DOM" || this.currentData.serveType == "MPT") {
+        this.menuVisible = false;
       }
       if (this.currentData.enName == "s_explorationpoint") {
         this.shwoHistogram = true;
@@ -341,16 +348,13 @@
       }
       if (Node.data.children == null && Node.data.serveType == "Tileset" || Node.data.serveType == "3DML") {
         this.showlocal = true;
-      } else if (Node.data.children == null && Node.data.serveType != "Tileset" || Node.data.serveType == "3DML") {
+        this.showopaque = true;
+      } else if (Node.data.children == null && Node.data.serveType == "TMS") {
+        this.showlocal = true;
+        this.showopaque = false;
+      } else if (Node.data.children == null && Node.data.serveType != "Tileset") {
         this.showlocal = false;
-      }
-
-
-
-      if (Node.data.serveType == "DEM") {
-        this.firstLevel = true;
-        this.menuVisible = false
-
+        this.showopaque = false;
       }
 
 
@@ -492,13 +496,23 @@
 
 
     //妯″瀷瀹氫綅
-    positioning() {
+    async positioning() {
       this.menuVisible = false
-      for (var i in Viewer.scene.primitives._primitives) {
-        if (
-          Viewer.scene.primitives._primitives[i].id == this.currentData.cnName
-        ) {
-          Viewer.flyTo(Viewer.scene.primitives._primitives[i]);
+      if (this.currentData.serveType == 'Tileset' || this.currentData.serveType == '3DML') {
+        for (var i in Viewer.scene.primitives._primitives) {
+          if (
+            Viewer.scene.primitives._primitives[i].id == this.currentData.cnName
+          ) {
+            Viewer.flyTo(Viewer.scene.primitives._primitives[i]);
+          }
+        }
+      } else if (this.currentData.serveType == 'TMS' && this.currentData.pubid) {
+        const data = await comprehensive_selectPubById({ id: this.currentData.pubid })
+        if (data.result.geom) {
+          var wkt = this.$wkt.parse(data.result.geom);
+          Viewer.camera.flyTo({
+            destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000),
+          });
         }
       }
     },
@@ -1043,10 +1057,10 @@
         layer.name = res.cnName;
 
         if (data.result.geom) {
-          var wkt = this.$wkt.parse(data.result.geom);
-          Viewer.camera.flyTo({
-            destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000),
-          });
+          // var wkt = this.$wkt.parse(data.result.geom);
+          // Viewer.camera.flyTo({
+          //   destination: Cesium.Cartesian3.fromDegrees(wkt.coordinates[1], wkt.coordinates[0], 2000),
+          // });
         }
         this.setChangeWMS();
       }

--
Gitblit v1.9.3