109 lines
2.8 KiB
Vue
Raw Normal View History

<template>
2025-05-20 08:53:11 +08:00
<div class="brand-layout">
<el-container class="brand-layout-container">
<el-aside class="brand-aside-menu">
<!-- 菜单部分 -->
2025-05-21 13:44:54 +08:00
<el-menu :default-active="activeMenu" class="aside-menu" @select="handleSelect">
<el-menu-item index="apply">
<img :src="getAssetsFile('images/brand/Apply.png')" class="menu-icon" alt="申请图标" />
2025-05-20 13:32:43 +08:00
<span>使用申请</span>
2025-05-20 08:53:11 +08:00
</el-menu-item>
2025-05-21 13:44:54 +08:00
<el-menu-item index="auth">
<img :src="getAssetsFile('images/brand/autho.png')" class="menu-icon" alt="" />
2025-05-20 08:53:11 +08:00
<span>授权管理</span>
</el-menu-item>
2025-05-21 13:44:54 +08:00
<el-menu-item index="monitor">
<img :src="getAssetsFile('images/brand/supervision.png')" class="menu-icon" alt="" />
2025-05-20 08:53:11 +08:00
<span>使用监管</span>
</el-menu-item>
</el-menu>
</el-aside>
2025-05-20 08:53:11 +08:00
<el-main class="brand-main">
2025-05-21 13:44:54 +08:00
<router-view />
2025-05-20 08:53:11 +08:00
</el-main>
</el-container>
</div>
</template>
2025-05-20 08:53:11 +08:00
<script setup>
2025-05-21 13:44:54 +08:00
import { computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { getAssetsFile } from '@/utils/index.js';
2025-05-21 13:44:54 +08:00
const router = useRouter();
const route = useRoute();
// 激活菜单项
const activeMenu = computed(() => {
const path = route.path;
if (path.includes('/apply')) return 'apply';
if (path.includes('/auth')) return 'auth';
if (path.includes('/monitor')) return 'monitor';
return '';
});
2025-05-20 08:53:11 +08:00
// 菜单切换处理
2025-05-21 13:44:54 +08:00
function handleSelect(index) {
router.push(`/sub-operation-service/brand/${index}`);
}
</script>
2025-05-20 08:53:11 +08:00
<style lang="scss" scoped>
.brand-layout {
width: 100%;
height: calc(100vh - 230px);
.brand-layout-container {
height: 100%;
width: $width-main;
margin: auto;
.brand-aside-menu {
width: 240px;
background-color: $color-fff;
border-radius: 8px;
.aside-menu {
border-right: none;
.el-menu-item {
height: 48px;
line-height: 48px;
margin: 4px 8px;
border-radius: 4px;
2025-05-21 13:44:54 +08:00
font-size: 20px;
font-weight: 400;
text-align: left;
2025-05-20 08:53:11 +08:00
&:hover {
background-color: #f5f7fa;
}
.el-icon {
color: #666;
margin-right: 12px;
font-size: 18px;
vertical-align: middle;
}
2025-05-21 13:44:54 +08:00
.menu-icon {
width: 1.5em;
height: 1.5em;
margin-right: 8px;
vertical-align: -0.15em;
}
2025-05-20 08:53:11 +08:00
span {
vertical-align: middle;
}
}
}
}
.brand-main {
width: calc(100% - 240px - 16px);
margin-left: 16px;
// background-color: #f0f0f0;
padding: 0;
}
.brand-main::-webkit-scrollbar {
display: none;
}
}
}
</style>