From 6fe940335b9ca7f4640983929b070c00e401dc61 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期四, 09 三月 2023 09:48:14 +0800
Subject: [PATCH] 综合展示点击模型显示详细信息

---
 src/views/Tools/LayerTree.vue |   42 ++++++++++++++++++++++++++++++++----------
 1 files changed, 32 insertions(+), 10 deletions(-)

diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue
index a57be67..47ba4f6 100644
--- a/src/views/Tools/LayerTree.vue
+++ b/src/views/Tools/LayerTree.vue
@@ -17,6 +17,7 @@
       @check-change="handleCheckChange"
       :default-checked-keys="handleTreeCheck"
       :expand-on-click-node="false"
+      :filter-node-method="filterNode"
     >
       <span
         class="slot-t-node"
@@ -92,6 +93,13 @@
         v-show="shwoHistogram"
       >
         <i class="el-icon-tickets"></i>&nbsp;&nbsp;閽诲瓟鏌辩姸鍥�
+      </div>
+      <div
+        class="edit"
+        v-show="showModelAttach"
+        @click="modelAttach()"
+      >
+        <i class="el-icon-tickets"></i>&nbsp;&nbsp;妯″瀷灞炴��
       </div>
       <!-- <div
         class="edit"
@@ -196,6 +204,7 @@
       rightClickMenuStyle: {},
       handleTreeCheck: [],
       dialogVisible: false,
+      showModelAttach: false,
       addFormServer: {
         opacity: 100,
         serveType: "WMS",
@@ -225,6 +234,7 @@
     };
   },
   methods: {
+
     //杞瓟鏌辩姸鍥�
     async histogram() {
       this.menuVisible = false
@@ -247,6 +257,13 @@
           },
         });
     },
+    modelAttach() {
+      this.menuVisible = false;
+      this.$store.state.attachinfo = this.currentData;
+      this.$store.state.attachModel = true;
+
+
+    },
     NodeBlur(Node, data) {
       if (data.label.length === 0) {
         this.$message.error("鑿滃崟鍚嶄笉鍙负绌猴紒");
@@ -260,11 +277,7 @@
         });
       }
     },
-    // 鏌ヨ
-    filterNode(value, data) {
-      if (!value) return true;
-      return data.label.indexOf(value) !== -1;
-    },
+
 
     allowDrop(draggingNode, dropNode, type) {
       if (dropNode.data.label === "浜岀骇 3-1") {
@@ -280,6 +293,12 @@
     rightClick(event, object, Node, element) {
       this.currentData = object;
       this.currentNode = Node;
+      this.$store.state.propertiesName = this.currentData;
+      if (this.currentData.serveType == "Tileset") {
+        this.showModelAttach = true;
+      } else {
+        this.showModelAttach = false;
+      }
       if (this.currentData.enName == "s_explorationpoint") {
         this.shwoHistogram = true;
       } else {
@@ -659,13 +678,10 @@
           })
         );
 
-        tileset.readyPromise.then((tileset0) => {
+        tileset.readyPromise.then((tileset) => {
           tileset.id = res.cnName;
-
+          tileset.layerId = res.id;
           this.tileSet(tileset, parseFloat(res.elev))
-
-
-
           Viewer.flyTo(tileset);
         });
       }
@@ -788,6 +804,12 @@
       }
       this.$refs.tree.setCheckedKeys(std);
     },
+    // 鏌ヨ
+    filterNode(value, data) {
+
+      if (!value) return true;
+      return data.cnName.indexOf(value) !== -1;
+    },
   },
   watch: {
     filterText(val) {

--
Gitblit v1.9.3