Files
admin-govern/src/layouts/admin/components/navBar/classic.vue

112 lines
3.3 KiB
Vue
Raw Normal View History

2023-12-21 16:42:39 +08:00
<template>
<div class="nav-bar">
<div v-if="config.layout.shrink && config.layout.menuCollapse" class="unfold">
2024-12-23 11:30:28 +08:00
<Icon @click="onMenuCollapse" name="fa fa-indent" :color="config.getColorVal('menuActiveColor')"
size="18" />
2023-12-21 16:42:39 +08:00
</div>
2024-12-23 11:30:28 +08:00
<span class="nav-bar-title">{{ getTheme.name }} <span style="font-size: 14px;" v-if="Version?.versionName">
({{ Version?.versionName }})
</span></span>
2023-12-21 16:42:39 +08:00
<NavMenus />
</div>
</template>
<script setup lang="ts">
2024-12-23 11:30:28 +08:00
import { ref } from 'vue'
2023-12-21 16:42:39 +08:00
import { useConfig } from '@/stores/config'
import NavTabs from '@/layouts/admin/components/navBar/tabs.vue'
import NavMenus from '../navMenus.vue'
import { showShade } from '@/utils/pageShade'
2024-12-17 20:57:07 +08:00
import { onMounted } from 'vue'
2024-12-23 11:30:28 +08:00
import { getLastData } from '@/api/systerm'
2023-12-21 16:42:39 +08:00
const config = useConfig()
const getTheme = JSON.parse(window.localStorage.getItem('getTheme') as string)
2024-12-23 11:30:28 +08:00
const Version: any = ref({})
2023-12-21 16:42:39 +08:00
const onMenuCollapse = () => {
showShade('ba-aside-menu-shade', () => {
config.setLayout('menuCollapse', true)
})
config.setLayout('menuCollapse', false)
}
2024-12-17 20:57:07 +08:00
onMounted(() => {
2024-12-23 11:30:28 +08:00
getLastData({ versionType: 'WEB' }).then(res => {
Version.value = res.data
})
2024-12-17 20:57:07 +08:00
document.title = getTheme.name
})
2023-12-21 16:42:39 +08:00
</script>
<style scoped lang="scss">
2023-12-21 16:42:39 +08:00
.nav-bar {
display: flex;
2024-01-05 11:35:13 +08:00
align-items: center;
height: 60px;
2023-12-21 16:42:39 +08:00
width: 100%;
background-color: v-bind('config.getColorVal("headerBarBackground")');
2024-01-05 14:02:22 +08:00
.nav-bar-title {
color: v-bind('config.getColorVal("headerBarTabColor")');
font-size: 24px;
margin-left: 10px;
font-weight: 700;
2024-01-05 14:02:22 +08:00
}
2023-12-21 16:42:39 +08:00
:deep(.nav-tabs) {
display: flex;
height: 100%;
position: relative;
2024-01-05 14:02:22 +08:00
2023-12-21 16:42:39 +08:00
.ba-nav-tab {
display: flex;
align-items: center;
justify-content: center;
padding: 0 20px;
cursor: pointer;
z-index: 1;
height: 100%;
user-select: none;
color: v-bind('config.getColorVal("headerBarTabColor")');
transition: all 0.2s;
-webkit-transition: all 0.2s;
2024-01-05 14:02:22 +08:00
2023-12-21 16:42:39 +08:00
.close-icon {
padding: 2px;
margin: 2px 0 0 4px;
2024-01-03 13:20:19 +08:00
color: v-bind('config.getColorVal("headerBarTabColor")') !important;
2023-12-21 16:42:39 +08:00
}
2024-01-05 14:02:22 +08:00
2023-12-21 16:42:39 +08:00
&.active {
color: v-bind('config.getColorVal("headerBarTabActiveColor")');
2024-01-05 14:02:22 +08:00
2024-01-03 13:20:19 +08:00
.close-icon {
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important;
2024-01-03 13:20:19 +08:00
}
2023-12-21 16:42:39 +08:00
}
2024-01-05 14:02:22 +08:00
2023-12-21 16:42:39 +08:00
&:hover {
2023-12-27 15:06:57 +08:00
color: v-bind('config.getColorVal("headerBarTabActiveColor")');
2023-12-21 16:42:39 +08:00
background-color: v-bind('config.getColorVal("headerBarHoverBackground")');
2024-01-05 14:02:22 +08:00
2024-01-03 13:20:19 +08:00
.close-icon {
color: v-bind('config.getColorVal("headerBarTabActiveColor")') !important;
2024-01-03 13:20:19 +08:00
}
2023-12-21 16:42:39 +08:00
}
}
2024-01-05 14:02:22 +08:00
2023-12-21 16:42:39 +08:00
.nav-tabs-active-box {
position: absolute;
height: 50px;
background-color: v-bind('config.getColorVal("headerBarTabActiveBackground")');
transition: all 0.2s;
-webkit-transition: all 0.2s;
}
}
}
2024-01-05 14:02:22 +08:00
2023-12-21 16:42:39 +08:00
.unfold {
align-self: center;
padding-left: var(--ba-main-space);
}
</style>