From a92fa5ec4d415ccc42f8c3b7eae7d07cc8418889 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期四, 16 二月 2023 16:33:11 +0800
Subject: [PATCH] 1

---
 src/components/MapView/mapMenuTop.vue |  101 +++++++++++++++++++-------------------------------
 1 files changed, 39 insertions(+), 62 deletions(-)

diff --git a/src/components/MapView/mapMenuTop.vue b/src/components/MapView/mapMenuTop.vue
index a3832ca..3ad1f8f 100644
--- a/src/components/MapView/mapMenuTop.vue
+++ b/src/components/MapView/mapMenuTop.vue
@@ -172,48 +172,19 @@
   },
 
   mounted() {
-    // sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
-
     this.menuTopFrom.queryType = 'rectangle';
     this.getAllTable();
   },
   methods: {
-    flyRemove() {
 
-    },
-    flyQuery() {
-    // Viewer.flyTo( sgworld.Creator.SimpleGraphic._viewer.entities._entities._array[0])
-      // switch (this.menuTopFrom.queryType) {
-      //   case 'point': //鐐�
-      //     Viewer.camera.flyTo({
-      //       destination: Cesium.Cartesian3.fromDegrees(this.flyEntity.lng, this.flyEntity.lat, 3000),
-
-      //     });
-
-      //     break;
-      //   case 'polyline': //绾�
-      //     debugger
-      //     break;
-      //   case 'rectangle': //鐭╁舰
-
-      //     debugger
-      //     break;
-      //   case 'circle': //鍦�
-      //     debugger
-      //     break;
-      //   case 'polygon': //澶氳竟褰�
-      //     debugger
-      //     break;
-      // }
-    },
     changeValue(value) {
-      // var obj = {};
-      // obj = this.queryOption.find(function (item) {
-      //   return item.value === value;
-      // });
-      // if (obj.value == 'inputFile') {
-      //   this.getMenuTopFile();
-      // }
+      var obj = {};
+      obj = this.queryOption.find(function (item) {
+        return item.value === value;
+      });
+      if (obj.value == 'inputFile') {
+        this.getMenuTopFile();
+      }
     },
     async getAllTable() {
       const data = await inquiry_SelectTabs();
@@ -300,7 +271,16 @@
       //娓呯┖鏍囩粯
       sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
       sgworld.Creator.SimpleGraphic.clear();
-
+      if (this.$store.state.queryInfo.length != 0) {
+        for (var i in this.$store.state.queryInfo) {
+          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
+        }
+        this.$store.state.queryInfo = [];
+      }
+      if (this.$store.state.primitLayer != null) {
+        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
+        this.$store.state.primitLayer = null;
+      }
       if (this.treeChange.length == 0) {
         this.$message.error('璇烽�夋嫨瑕佹煡璇㈢殑鏁版嵁');
         return;
@@ -368,7 +348,7 @@
         properties: { foo: 'bar' },
       };
       var circle = turf.circle(position, radius, options);
-      debugger
+
       this.setJonToWKT(circle);
     },
     setTurfPolyOrLine(res, type) {
@@ -403,22 +383,22 @@
     showMapMenuPop() {
       this.$store.state.mapSpaceQueryLayer = this.treeChange;
       this.$store.state.mapPopBoxFlag = '1';
-      // this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
+      this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close();
       this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.open("绌洪棿鏌ヨ", null, {
         close: () => {
 
-          if (this.$store.state.primitLayer != null) {
-            // sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
-            this.$store.state.primitLayer = null;
-          }
+          // if (this.$store.state.primitLayer != null) {
+          //   // sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
+          //   this.$store.state.primitLayer = null;
+          // }
 
-          if (window.Viewer.scene.primitives.length != 0) {
-            window.Viewer.scene.primitives.removeAll()
-          }
+          // if (window.Viewer.scene.primitives.length != 0) {
+          //   window.Viewer.scene.primitives.removeAll()
+          // }
         }
       });
-      this.$bus.$emit('changeMapMenuTop', 'true');
-      sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
+      // this.$bus.$emit('changeMapMenuTop', 'true');
+
       // sgworld.Creator.SimpleGraphic.clear();
       //娓呯┖inputFile
       // var file = document.getElementById('getMenuTopFile');
@@ -431,24 +411,21 @@
       this.menuTopFrom.queryLayer = null;
       this.menuTopFrom.queryType = 'rectangle';
       this.$refs.tree.setCheckedKeys([]);
- //娓呯┖鏍囩粯
+      //娓呯┖鏍囩粯
       sgworld.Creator.SimpleGraphic.edit(false, { editProp: false });
       sgworld.Creator.SimpleGraphic.clear();
-
-      // //娓呴櫎瀵硅薄
-      // if (window.Viewer.scene.primitives.length != null) {
-      //   window.Viewer.scene.primitives.removeAll();
-      // }
-      // if (this.$store.state.primitLayer != null) {
-      //   sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
-      //   this.$store.state.primitLayer = null;
-      // }
+      if (this.$store.state.queryInfo.length != 0) {
+        for (var i in this.$store.state.queryInfo) {
+          sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
+        }
+        this.$store.state.queryInfo = [];
+      }
       //鍏抽棴绐楀彛
       this.$refs && this.$refs.queryinfo && this.$refs.queryinfo.close("queryinfo");
-
-
-
-
+      if (this.$store.state.primitLayer != null) {
+        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
+        this.$store.state.primitLayer = null;
+      }
     },
     setCartesianToEightFour(res) {
       var std = {};

--
Gitblit v1.9.3