<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>
|