- 删除 frontend/src/views/systemMonitor/2026-04-22-disk-monitor-design.md 设计文档 - 删除 frontend/src/views/tools/addLedger/API_DEBUG.md 调试文档 - 在 AGENTS.md 中新增前端页面结构归档章节,规范复杂工具页结构 - 明确 index.vue、components/、utils/ 职责边界和拆分原则 - 规定页面级类型和 contract 脚本管理方式 - 统一复杂页面拆分优先顺序和注意事项
99 lines
2.9 KiB
Vue
99 lines
2.9 KiB
Vue
<template>
|
|
<template v-for="subItem in menuList" :key="subItem.path">
|
|
<el-sub-menu v-if="subItem.children?.length" :index="subItem.path">
|
|
<template #title>
|
|
<el-icon>
|
|
<component :is="subItem.meta.icon"></component>
|
|
</el-icon>
|
|
<span class="sle">{{ subItem.meta.title }}</span>
|
|
</template>
|
|
<SubMenu :menu-list="subItem.children" />
|
|
</el-sub-menu>
|
|
<el-menu-item v-else :index="subItem.path" @click="handleClickMenu(subItem)">
|
|
<el-icon>
|
|
<component :is="subItem.meta.icon"></component>
|
|
</el-icon>
|
|
<template #title>
|
|
<span class="sle">{{ subItem.meta.title }}</span>
|
|
</template>
|
|
</el-menu-item>
|
|
</template>
|
|
</template>
|
|
<script setup lang="ts">
|
|
import { useRouter } from 'vue-router'
|
|
import { resolveBusinessMenuPath } from '@/stores/modules/auth'
|
|
|
|
defineProps<{ menuList: Menu.MenuOptions[] }>()
|
|
const router = useRouter()
|
|
const handleClickMenu = async (subItem: Menu.MenuOptions) => {
|
|
if (subItem.meta?.isLink) {
|
|
window.open(subItem.meta.isLink, '_blank')
|
|
return
|
|
}
|
|
await router.push(resolveBusinessMenuPath(subItem))
|
|
}
|
|
</script>
|
|
<style lang="scss">
|
|
.el-sub-menu .el-sub-menu__title:hover {
|
|
// color: var(--el-menu-hover-text-color) !important;
|
|
// background-color: transparent !important;
|
|
color: #fff !important; //一级导航文字选中颜色
|
|
//background-color: #5274a5 !important; //一级导航选中背景色
|
|
|
|
background-color: var(--el-color-primary-light-3) !important;
|
|
}
|
|
.el-menu--collapse {
|
|
.is-active {
|
|
.el-sub-menu__title {
|
|
color: #ffffff !important;
|
|
// background-color: var(--el-color-primary) !important;
|
|
//background-color: #5274a5 !important;
|
|
background-color: var(--el-color-primary-light-3) !important;
|
|
|
|
border-bottom: 0 !important;
|
|
}
|
|
}
|
|
}
|
|
.el-menu-item {
|
|
&:hover {
|
|
color: var(--el-menu-hover-text-color);
|
|
}
|
|
&.is-active {
|
|
// color: var(--el-menu-active-color) !important;
|
|
// background-color: var(--el-menu-active-bg-color) !important;
|
|
color: #fff !important; //一级导航文字选中颜色
|
|
//background-color: #5274a5 !important; //一级导航选中背景色
|
|
background-color: var(--el-color-primary-light-3) !important;
|
|
|
|
&::before {
|
|
position: absolute;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: 4px;
|
|
content: '';
|
|
background-color: var(--el-color-primary);
|
|
}
|
|
}
|
|
}
|
|
.vertical,
|
|
.classic,
|
|
.transverse {
|
|
.el-menu-item {
|
|
&.is-active {
|
|
&::before {
|
|
left: 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
.columns {
|
|
.el-menu-item {
|
|
&.is-active {
|
|
&::before {
|
|
right: 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|