From fd4137f911011f741f71f962ecf59ba4af19ca06 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期二, 11 七月 2023 09:21:45 +0800
Subject: [PATCH] 空间查询移动和拖拽修改

---
 src/views/Index.vue |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/src/views/Index.vue b/src/views/Index.vue
index c603ed5..0f8bc5c 100644
--- a/src/views/Index.vue
+++ b/src/views/Index.vue
@@ -11,6 +11,10 @@
     <menus></menus>
     <bottom-btn></bottom-btn>
     <mouse-move></mouse-move>
+    <spatial-box
+      v-if="layerSpatialshow"
+      @SETspatialClose="SETspatialClose"
+    ></spatial-box>
   </div>
 </template>
 
@@ -32,14 +36,17 @@
 import InitMap from "@/assets/js/Map/index.js";
 //缁忕含搴︽樉绀�
 import mouseMove from "@/components/mouseMove.vue";
-import router from "@/router";
-// import * as SmartEarth from "../../public/CIMSDK/index.js";
-// import * as SmartEarth from "../assets/js/CIMSDK/index.js";
+//绌洪棿鏌ヨ
+import spatialBox from "@/views/query/SpatialQuery.vue";
 
+import router from "@/router";
+import { useStore } from "vuex"; // 寮曞叆useStore 鏂规硶
+import { dataQuery_selectByPage } from "@/api/api";
 let map;
 var viewer;
+const store = useStore(); // 璇ユ柟娉曠敤浜庤繑鍥瀞tore 瀹炰緥
 const layerExportshow = ref(false);
-
+const layerSpatialshow = ref(false);
 const init = () => {
   viewer = InitMap.Viewer;
   map = InitMap.sgworld;
@@ -54,7 +61,23 @@
     case "exportMap":
       layerExportshow.value = res.value;
       break;
+    case "spatialQuery":
+      setSpatialQuery(res);
+      break;
   }
+};
+const setSpatialQuery = async (res) => {
+  layerSpatialshow.value = true;
+  store.state.spatialQueryData.wkt = res.value;
+  store.state.spatialQueryData.hasGeom = 1;
+  store.state.spatialQueryData.filter = "";
+  store.state.spatialQueryData.name = "lunarplacenane";
+  var obj = store.state.spatialQueryData;
+  const data = await dataQuery_selectByPage(obj);
+  debugger;
+};
+const SETspatialClose = (res) => {
+  layerSpatialshow.value = res;
 };
 onMounted(() => {
   var token = getToken();
@@ -66,7 +89,6 @@
   init();
   const infobar = document.getElementsByClassName("map-info-bar")[0];
   infobar.style.display = "none";
-
   const navigation = document.getElementsByClassName("navigation-controls")[0];
   navigation.style.top = "calc(100% - 182px)";
   navigation.style.right = "70px";

--
Gitblit v1.9.3