月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-09-04 d80d032784216bc4a61692476947ab36f53788d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<template>
  <div class="top_btn">
    <div class="menu_Box">
      <div
        class="first_Menu"
        :title="item.name"
        v-for="(item, i) in menuOptions"
        :key="i"
        @click="setMenuClick(item)"
      >
        <div class="First_img">
          <img
            v-if="checkMenuFlag != item.id"
            class="imgIcon"
            :src="require('../../assets/img/topBtn/' + item.imgUrl)"
          />
          <img
            v-if="checkMenuFlag == item.id"
            class="imgIcon"
            :src="require('../../assets/img/topBtn/' + item.checkImgUrl)"
          />
        </div>
      </div>
    </div>
  </div>
</template>
 
<script lang="ts" setup>
import {
  ref,
  onMounted,
  onBeforeUnmount,
  reactive,
  defineProps,
  defineEmits,
} from "vue";
import menuData from "@/assets/js/Map/menuData.js";
import menuTool from "@/assets/js/Map/menuTool.js";
const checkMenuFlag = ref("");
const menuFlag = ref(null);
const menuOptions = ref([]);
const checkFlag = ref(null);
let checkArr = ref([]);
const setMenuClick = (res) => {
  if (checkMenuFlag.value && checkMenuFlag.value == res.id) {
    checkMenuFlag.value = null;
  } else {
    checkMenuFlag.value = res.id;
    menuTool.thematicTools(res);
  }
};
onMounted(() => {
  menuOptions.value = menuData.thematicMenu;
});
</script>
 
<style lang="less" scoped>
.top_btn {
  position: absolute;
  top: 23px;
  right: 0px;
  display: flex;
  cursor: pointer;
  z-index: 40;
  .menu_Box {
    margin-right: 104px;
    display: flex;
    .imgIcon {
      width: 30px;
      height: 30px;
    }
    .first_Menu {
      width: 50px;
      height: 50px;
      margin-right: 7px;
      background: url("../../assets/img/topBtn/图标bj.png") no-repeat;
      background-size: 100% 100%;
      .First_img {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
      }
    }
 
    .upTop {
      width: 100%;
      height: 10px;
      display: flex;
      justify-content: center;
      .upimg {
        width: 15px;
        height: 100%;
        background: url("../../assets/img/topBtn/向上1.png") no-repeat;
      }
    }
  }
}
</style>