ec-admin/src/config/menu.ts
liuyun 6ef0b1121c feat: admin layout shell with Element Plus and configurable theme
- 集成 Element Plus(on-demand resolver + 中文 locale + 暗黑 css-vars)
- 布局壳组件(ty-header/ty-mixbar/ty-sidebar/ty-tabs/ty-breadcrumb/ty-footer/ty-setting/ty-setting-panel),中划线 + ty 前缀 + 自动导入,props/emits 解耦
- 5 种布局/导航模式 + 主题色(#2E7FA3) + 暗黑 + 侧栏折叠/宽度 + 固定顶栏/底栏 + 面包屑/多页签/全屏/手风琴
- 默认值集中配置 src/config/layout.ts;菜单字段对齐后端 resource(src/types/resource.ts + src/config/menu.ts)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-11 00:12:59 +08:00

134 lines
3.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { ResourceNode } from '@/types/resource'
/**
* 占位菜单树(字段严格对齐后端 resource,children 已按 parentCode 组装)。
* 后续替换为后端「当前用户菜单树」接口返回,数据结构不变。
*/
export const placeholderMenus: ResourceNode[] = [
{
id: 'menu-dashboard',
code: 'dashboard',
name: '工作台',
parentCode: null,
type: 'menu',
path: '/',
component: 'dashboard/index',
icon: 'mdi:view-dashboard',
sort: 1,
},
{
id: 'menu-system',
code: 'system',
name: '系统管理',
parentCode: null,
type: 'menu',
path: '/system',
component: 'Layout',
icon: 'mdi:cog',
sort: 2,
children: [
{
id: 'menu-user',
code: 'user',
name: '用户管理',
parentCode: 'system',
type: 'menu',
path: '/system/user',
component: 'system/user/index',
icon: 'mdi:account-group',
sort: 1,
},
{
id: 'menu-role',
code: 'role',
name: '角色管理',
parentCode: 'system',
type: 'menu',
path: '/system/role',
component: 'system/role/index',
icon: 'mdi:account-key',
sort: 2,
},
{
id: 'menu-resource',
code: 'resource',
name: '资源管理',
parentCode: 'system',
type: 'menu',
path: '/system/resource',
component: 'system/resource/index',
icon: 'mdi:view-list',
sort: 3,
},
{
id: 'menu-org',
code: 'org',
name: '组织管理',
parentCode: 'system',
type: 'menu',
path: '/system/org',
component: 'system/org/index',
icon: 'mdi:sitemap',
sort: 4,
},
{
id: 'menu-dict',
code: 'dict',
name: '字典管理',
parentCode: 'system',
type: 'menu',
path: '/system/dict',
component: 'system/dict/index',
icon: 'mdi:book-open-variant',
sort: 5,
},
{
id: 'menu-config',
code: 'config',
name: '参数配置',
parentCode: 'system',
type: 'menu',
path: '/system/config',
component: 'system/config/index',
icon: 'mdi:tune',
sort: 6,
},
],
},
{
id: 'menu-monitor',
code: 'monitor',
name: '系统监控',
parentCode: null,
type: 'menu',
path: '/monitor',
component: 'Layout',
icon: 'mdi:monitor-dashboard',
sort: 3,
children: [
{
id: 'menu-audit',
code: 'audit',
name: '操作日志',
parentCode: 'monitor',
type: 'menu',
path: '/monitor/audit',
component: 'monitor/audit/index',
icon: 'mdi:clipboard-text',
sort: 1,
},
{
id: 'menu-login-log',
code: 'login-log',
name: '登录日志',
parentCode: 'monitor',
type: 'menu',
path: '/monitor/login-log',
component: 'monitor/login-log/index',
icon: 'mdi:login',
sort: 2,
},
],
},
]