月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-07-11 fd4137f911011f741f71f962ecf59ba4af19ca06
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(); // 该方法用于返回store 实例
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";