2026-07-24 15:57:20 +08:00
|
|
|
|
import type { MenuNode } from '@/types';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* ====== 兜底路由配置 ======
|
|
|
|
|
|
*
|
|
|
|
|
|
* 当后端菜单接口不可用时,使用此配置作为降级方案。
|
|
|
|
|
|
* 数据格式与后端 `/menu/tree` 接口返回完全一致,
|
|
|
|
|
|
* 因此可以直接通过 transformMenuToRoutes / transformMenuNode 复用同一套处理逻辑。
|
|
|
|
|
|
*
|
|
|
|
|
|
* ## 后端应返回的数组格式示例
|
|
|
|
|
|
*
|
|
|
|
|
|
* ```json
|
|
|
|
|
|
* [
|
|
|
|
|
|
* { "id": "dashboard", "name": "工作台", "path": "dashboard", "component": "dashboard", "icon": "DashboardOutlined" },
|
|
|
|
|
|
* {
|
|
|
|
|
|
* "id": "events", "name": "赛事管理", "path": "events", "icon": "TrophyOutlined",
|
|
|
|
|
|
* "children": [
|
|
|
|
|
|
* { "id": "events_list", "name": "赛事列表", "path": "events/list", "component": "events/list" },
|
|
|
|
|
|
* { "id": "events_orders", "name": "订单管理", "path": "events/orders", "component": "events/orders" }
|
|
|
|
|
|
* ]
|
|
|
|
|
|
* }
|
|
|
|
|
|
* ]
|
|
|
|
|
|
* ```
|
|
|
|
|
|
*
|
|
|
|
|
|
* ### 字段说明
|
|
|
|
|
|
* | 字段 | 类型 | 必填 | 说明 |
|
|
|
|
|
|
* |------|------|------|------|
|
|
|
|
|
|
* | id | number\|string | 是 | 唯一标识 |
|
|
|
|
|
|
* | name | string | 是 | 菜单名称/路由 name |
|
|
|
|
|
|
* | path | string | 是 | 路由相对路径(不带 / 前缀) |
|
|
|
|
|
|
* | component | string | 否 | 组件路径(映射 src/pages/ 下目录,如 "events/list") |
|
|
|
|
|
|
* | icon | string | 否 | antd 图标名(如 DashboardOutlined) |
|
|
|
|
|
|
* | sort | number | 否 | 排序权重(越小越前) |
|
|
|
|
|
|
* | hideInMenu | boolean | 否 | 是否在菜单中隐藏 |
|
|
|
|
|
|
* | externalLink | string | 否 | 外链地址 |
|
|
|
|
|
|
* | activeMenu | string | 否 | 高亮菜单路径 |
|
|
|
|
|
|
* | disabled | boolean | 否 | 禁用标记(禁用后路由不注册、菜单不显示) |
|
|
|
|
|
|
* | children | MenuNode[] | 否 | 子路由 |
|
|
|
|
|
|
*
|
|
|
|
|
|
* ### 关于 routes → menuItems 的转换
|
|
|
|
|
|
* `menuStore.ts` 中的 `transformMenuNode()` 已完成此功能,
|
|
|
|
|
|
* 它将 MenuNode[] 递归转换为 antd Menu 组件所需的 MenuItemRaw[] 格式。
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
export const FALLBACK_MENU_NODES: MenuNode[] = [
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'events',
|
|
|
|
|
|
name: '赛事管理',
|
|
|
|
|
|
path: 'events',
|
|
|
|
|
|
icon: 'TrophyOutlined',
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'events_list',
|
|
|
|
|
|
name: '赛事列表',
|
|
|
|
|
|
path: 'events/list',
|
|
|
|
|
|
component: 'events/list',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'events_orders',
|
|
|
|
|
|
name: '订单管理',
|
|
|
|
|
|
path: 'events/orders',
|
|
|
|
|
|
component: 'events/orders',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'events_users',
|
|
|
|
|
|
name: '用户列表',
|
|
|
|
|
|
path: 'events/users',
|
|
|
|
|
|
component: 'events/users',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'events_banner',
|
|
|
|
|
|
name: 'Banner配置',
|
|
|
|
|
|
path: 'events/banner',
|
|
|
|
|
|
component: 'events/banner',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'events_logs',
|
|
|
|
|
|
name: '赛事操作日志',
|
|
|
|
|
|
path: 'events/logs',
|
|
|
|
|
|
component: 'events/logs',
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2026-07-25 09:39:56 +08:00
|
|
|
|
{
|
|
|
|
|
|
id: 'finance',
|
|
|
|
|
|
name: '账务管理',
|
|
|
|
|
|
path: 'finance',
|
|
|
|
|
|
icon: 'TransactionOutlined',
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'finance_withdraw',
|
|
|
|
|
|
name: '提现申请',
|
|
|
|
|
|
path: 'finance/withdraw',
|
|
|
|
|
|
component: 'finance/withdraw',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'finance_wallet',
|
|
|
|
|
|
name: '用户钱包',
|
|
|
|
|
|
path: 'finance/wallet',
|
|
|
|
|
|
component: 'finance/wallet',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'finance_payments',
|
|
|
|
|
|
name: '支付流水',
|
|
|
|
|
|
path: 'finance/payments',
|
|
|
|
|
|
component: 'finance/payments',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'finance_reports',
|
|
|
|
|
|
name: '账务报表',
|
|
|
|
|
|
path: 'finance/reports',
|
|
|
|
|
|
component: 'finance/reports',
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'system',
|
|
|
|
|
|
name: '系统管理',
|
|
|
|
|
|
path: 'system',
|
|
|
|
|
|
icon: 'SettingOutlined',
|
|
|
|
|
|
children: [
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'system_users',
|
|
|
|
|
|
name: '用户管理',
|
|
|
|
|
|
path: 'system/users',
|
|
|
|
|
|
component: 'system/users',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'system_roles',
|
|
|
|
|
|
name: '角色权限',
|
|
|
|
|
|
path: 'system/roles',
|
|
|
|
|
|
component: 'system/roles',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
id: 'system_logs',
|
|
|
|
|
|
name: '操作日志',
|
|
|
|
|
|
path: 'system/logs',
|
|
|
|
|
|
component: 'system/logs',
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2026-07-24 15:57:20 +08:00
|
|
|
|
];
|