<template>
|
<div class="page-mode">
|
<div @mouseenter="item.childrenFlag = true" :class="{ active: buttonIndex == item.value }"
|
@mouseleave="item.childrenFlag = false" @click="goToPath(item)" v-for="(item, index) in menuList" :key="index">
|
{{ item.menuName }}
|
</div>
|
</div>
|
</template>
|
|
<script setup>
|
import { ref, reactive, watch } from 'vue'
|
import { useRouter, useRoute } from 'vue-router'
|
import { Search } from '@element-plus/icons-vue'
|
import { getTime } from '@/utils/getTime.js'
|
import { usePointStore } from 'store/usepoint'
|
const useAppStore = usePointStore()
|
let router = useRouter()
|
let currentUrl = ref('statistics')
|
|
const menuList = ref(
|
[
|
{
|
menuName: '企业信息',
|
value: 1,
|
},
|
{
|
menuName: '应急物资',
|
value: 2,
|
},
|
{
|
menuName: '应急空间',
|
value: 3,
|
},
|
{
|
menuName: '三道防线',
|
value: 4,
|
}
|
]
|
)
|
let { buttonIndex } = defineProps({
|
buttonIndex: Number
|
})
|
|
// 父级方法
|
const emit = defineEmits(['childEvent'])
|
|
const goToPath = (params) => {
|
if (params.value == 1) {
|
emit('childEvent', params.value)
|
return
|
} else if (params.value == 2) {
|
emit('childEvent', params.value)
|
return
|
} else if (params.value == 3) {
|
emit('childEvent', params.value)
|
return
|
} else if (params.value == 4) {
|
emit('childEvent', params.value)
|
return
|
}
|
}
|
|
watch(
|
() => router.currentRoute.value,
|
(newValue, oldValue) => {
|
currentUrl.value = newValue.path
|
},
|
{ immediate: true }
|
)
|
|
const userName = ref('管理员')
|
</script>
|
|
<style lang="scss" scoped>
|
.page-mode {
|
position: absolute;
|
top: auto;
|
bottom: 55px;
|
left: 50%;
|
z-index: 99;
|
transform: translateX(-50%);
|
display: flex;
|
pointer-events: auto;
|
|
&>div {
|
background-image: url(/images/mode-tab.png);
|
background-size: cover;
|
width: 150px;
|
height: 50px;
|
font-size: 16px;
|
text-align: center;
|
font-weight: bold;
|
color: #BFD3E5;
|
line-height: 32px;
|
padding-top: 12px;
|
margin-right: -20px;
|
font-style: italic;
|
cursor: pointer;
|
box-sizing: border-box;
|
|
&:last-child {
|
margin-right: 0px;
|
}
|
|
&.active {
|
color: #F6FCFF;
|
background-image: url(/images/mode-tab-ac.png);
|
}
|
|
&:hover {
|
background-image: url(/images/mode-tab-ac.png);
|
}
|
}
|
}
|
</style>
|