月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-06-06 b035823c711d43902a06838065598f4f805ab408
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<template>
  <div class="top_btn">
    <div class="menu_Box">
      <div
        class="first_Menu"
        :title="item.name"
        v-for="(item,i) in menuOptions"
        @click="setMenuClick(item)"
      >
        <div class="First_img">
          <img
            class="imgIcon"
            :src="require('../assets/img/topBtn/'+item.imgUrl)"
          >
        </div>
        <div
          class="menu_second"
          v-if="item.children && item.children.length > 0"
          v-show="menuFlag == item.id"
        >
          <div class="upTop">
            <div class="upimg"></div>
          </div>
          <div class="second_Box">
            <div
              class="second_Menu"
              :title="res.name"
              v-for="(res,j) in item.children"
              @click="setMenuClick(res)"
              :class="{'second_Menu_click':checkFlag == res.id}"
            >
              <img
                class="imgIcon"
                style="margin-bottom: 5px;"
                :src="require('../assets/img/topBtn/'+res.imgUrl)"
              >
              <div>
                {{ res.name }}
              </div>
 
            </div>
          </div>
 
        </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 menuFlag = ref(null);
const menuOptions = ref([]);
const checkFlag = ref(null);
const setMenuClick = (res) => {
  if (res.children) {
    if (menuFlag.value && menuFlag.value == res.id) {
      menuFlag.value = null;
      checkFlag.value = null;
    } else {
      menuFlag.value = res.id;
    }
  } else {
    if (res.level == 1) {
      checkFlag.value = null;
    } else if (res.level == 2) {
      checkFlag.value = res.id;
    }
    menuFlag.value = null;
    menuTool.topTools(res);
  }
};
onMounted(() => {
  menuOptions.value = menuData.topMenu;
});
</script>
 
<style lang="less" scoped>
.top_btn {
  position: absolute;
  top: 23px;
  right: 0px;
  display: flex;
  cursor: pointer;
  .menu_Box {
    margin-right: 104px;
    display: flex;
    .imgIcon {
      width: 30px;
      height: 30px;
    }
    .first_Menu {
      min-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;
      }
    }
    .menu_second {
      margin-top: 0px;
    }
    .second_Box {
      background: #07080e;
      box-shadow: inset 0px 0px 15px 0px rgb(38, 47, 71, 0.68);
 
      .second_Menu {
        background: #07080e;
        box-shadow: inset 0px 0px 8px 0px rgb(38, 47, 71, 0.68);
        margin-top: 1px;
        font-size: 12px;
        font-family: Source Han Sans CN;
        padding: 10px 10px;
        font-weight: 300;
        color: #d1e0ff;
        line-height: 7px;
        text-align: center;
        border: 1px solid none;
      }
 
      .second_Menu_click {
        background: #171e2e;
        border: 1px solid;
        border-image: linear-gradient(47deg, #397bc9, #77a5cd, #397bc9) 1 1;
        box-shadow: 0px 0px 6px 0px #080c13,
          0px 7px 8px 0px rgba(38, 47, 71, 0.68);
      }
    }
  }
}
</style>