From 36fbd1e5a40e319e6ac5f43d11c99ba4b66e93a3 Mon Sep 17 00:00:00 2001
From: surprise <15810472099@163.com>
Date: 星期三, 29 十一月 2023 16:50:16 +0800
Subject: [PATCH] 坡度分析下载修改

---
 src/views/Index.vue |  118 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 100 insertions(+), 18 deletions(-)

diff --git a/src/views/Index.vue b/src/views/Index.vue
index 936ea97..4396f08 100644
--- a/src/views/Index.vue
+++ b/src/views/Index.vue
@@ -1,13 +1,25 @@
 <template>
-  <div class="body_box">
-    <div
-      id="cesiumContainer"
-      style="width: 100%; height: 100%; position: absolute"
-    ></div>
-
+  <div class="body_box" v-loading="store.state.loading" element-loading-background="rgba(0, 0, 0, 0.8)">
+    <export-map v-if="layerExportshow" @SETexportMap="SETexportMap"></export-map>
+    <export-list v-if="store.state.setExportList"></export-list>
     <menus></menus>
-    <bottom-btn></bottom-btn>
-    <top-btn></top-btn>
+    <bottom-btn v-if="store.state.isShowMap"></bottom-btn>
+    <mouse-move v-if="store.state.isShowMap"></mouse-move>
+    <spatial-box v-if="layerSpatialshow" @SETspatialClose="SETspatialClose"></spatial-box>
+    <coord-location v-if="layerLocationshow" @SETcoordClose="setCoordLocation">
+    </coord-location>
+    <details-query v-if="store.state.details.showDetails"> </details-query>
+    <div v-if="store.state.isShowMap">
+      <map-view></map-view>
+    </div>
+    <div v-if="!store.state.isShowMap">
+      <ol-map></ol-map>
+    </div>
+    <plotting-inquire></plotting-inquire>
+    <attribute-info v-if="store.state.setEditTemporaryShow"></attribute-info>
+    <slopeQuery v-if="store.state.showSlopeQuey"></slopeQuery>
+    <legend-layer  v-if="store.state.showlegendLayer"></legend-layer>
+    <legend-analysis v-if="store.state.showlegendLayer"></legend-analysis>
   </div>
 </template>
 
@@ -20,25 +32,95 @@
   defineProps,
   defineEmits,
 } from "vue";
+import { removeToken, getToken } from "@/utils/auth";
 //宸︿晶鑿滃崟
 import menus from "@/views/menus.vue";
 //搴曢儴鑿滃崟
 import bottomBtn from "@/components/bottomBtn.vue";
-//椤堕儴鑿滃崟
-import topBtn from "@/components/topBtn.vue";
+import exportMap from "./export/exportMap.vue";
+import mapView from "@/views/Map/mapView.vue";
+import olMap from "@/views/Map/olMap.vue";
+//缁忕含搴︽樉绀�
+import mouseMove from "@/components/mouseMove.vue";
+//绌洪棿鏌ヨ
+import spatialBox from "@/views/query/SpatialQuery.vue";
+//鍧愭爣瀹氫綅
+import CoordLocation from "@/views/query/CoordLocation.vue";
+//闃村奖鍒嗘瀽
+import mapclock from "@/views/mapClock/index.vue";
+//鐭㈤噺鏁版嵁淇℃伅寮圭獥
+import detailsQuery from "@/views/query/detailsQuery.vue";
+//鍑哄浘鍒楄〃
+import exportList from "./export/exportList.vue";
+//鏍囩粯鏌ヨ
+import plottingInquire from "./plotting/plottingInquire.vue";
+//灞炴�х紪杈�
+import attributeInfo from "./plotting/attributeInfo.vue";
+// 鍧″害鍊�
+import slopeQuery from "./query/slopeQuery.vue";
+//鍥惧垪
+import legendLayer from '@/views/Map/legendLayer';
+import legendAnalysis from "./Map/legendAnalysis.vue";
+import router from "@/router";
+import { useStore } from "vuex"; // 寮曞叆useStore 鏂规硶
 
-import InitMap from "@/assets/js/Map/index.js";
+const store = useStore(); // 璇ユ柟娉曠敤浜庤繑鍥瀞tore 瀹炰緥
+const layerExportshow = ref(false);
+const layerSpatialshow = ref(false);
+const layerLocationshow = ref(false);
 
-let map;
-var viewer;
-const init = () => {
-  viewer = InitMap.Viewer;
-  map = InitMap.sgworld;
+//鍏抽棴鐘舵��
+const SETexportMap = (res) => {
+  layerExportshow.value = res;
+};
+const functionForJs = (res) => {
+  switch (res.type) {
+    case "exportMap":
+      store.state.exportImgUrl = res.url;
+      layerExportshow.value = res.value;
+
+      break;
+    case "spatialQuery":
+      setSpatialQuery(res);
+      break;
+    case "closeNavigatBar":
+      setCloseNavigatBar();
+      break;
+    case "coordLocation":
+      setCoordLocation(res);
+      break;
+  }
+};
+const setCoordLocation = (res) => {
+  layerLocationshow.value = res;
+};
+const setCloseNavigatBar = () => {
+  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";
+  const compass = document.getElementsByClassName("compass")[0];
+  compass.style.top = "calc(100% - 280px)";
+  compass.style.right = "38px";
+};
+const setSpatialQuery = async (res) => {
+  store.state.spatialQueryData.wkt = res.value;
+  layerSpatialshow.value = true;
+};
+const SETspatialClose = (res) => {
+  layerSpatialshow.value = res;
 };
 
 onMounted(() => {
-  InitMap.init3DMap();
-  init();
+  var token = getToken();
+  if (!token) {
+    router.push("/Login");
+  }
+
+  // setCloseNavigatBar();
+  window.functionForJs = functionForJs;
+  store.state.isShowMap = true;
 });
 </script>
 <style lang="less" scoped>

--
Gitblit v1.9.3