Files
art-design/src/router/routes/asyncRoutes copy.ts
T
浅念 7c1766ec79 Merge branch 'develop'
# Conflicts:
#	src/App.vue
#	src/api/menuApi.ts
#	src/components/core/layouts/art-header-bar/index.vue
#	src/router/routes/asyncRoutes.ts
#	src/router/routesAlias.ts
#	src/typings/api.d.ts
#	src/views/system/user-center/index.vue
2025-07-21 11:44:09 +08:00

364 lines
8.4 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 { RoutesAlias } from '../routesAlias'
import { AppRouteRecord } from '@/types/router'
import { WEB_LINKS } from '@/utils/constants'
/**
* 菜单列表、异步路由
*
* 支持两种模式:
* 1. 前端静态配置 - 直接使用本文件中定义的路由配置
* 2. 后端动态配置 - 后端返回菜单数据,前端解析生成路由
*
* 菜单标题(title):
* 可以是 i18n 的 key,也可以是字符串,比如:'用户列表'
*/
export const asyncRoutes: AppRouteRecord[] = [
{
name: 'Dashboard',
path: '/dashboard',
component: RoutesAlias.Home,
meta: {
title: 'menus.dashboard.title',
icon: ''
},
children: [
{
path: 'console',
name: 'Console',
component: RoutesAlias.Dashboard,
meta: {
title: 'menus.dashboard.console',
keepAlive: false,
fixedTab: true
}
},
{
path: 'analysis',
name: 'Analysis',
component: RoutesAlias.Analysis,
meta: {
title: 'menus.dashboard.analysis',
keepAlive: false
}
},
{
path: 'ecommerce',
name: 'Ecommerce',
component: RoutesAlias.Ecommerce,
meta: {
title: 'menus.dashboard.ecommerce',
keepAlive: false
}
}
]
},
{
path: '/work',
name: 'Work',
component: RoutesAlias.Home,
// component:'/work',
meta: {
title: 'menus.work.title',
icon: '',
roles: ['R_SUPER', 'R_ADMIN']
},
children: [
{
path: 'order',
name: '工单列表',
component: RoutesAlias.Order,
meta: {
title: 'menus.work.order',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
},
{
path: 'type',
name: 'Type',
component: RoutesAlias.OrderType,
meta: {
title: 'menus.work.type',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
}
]
},
{
path: '/system',
name: 'System',
component: RoutesAlias.Home,
meta: {
title: 'menus.system.title',
icon: '',
roles: ['R_SUPER', 'R_ADMIN']
},
children: [
{
path: 'user',
name: 'User',
component: RoutesAlias.User,
meta: {
title: 'menus.system.user',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
},
{
path: 'role',
name: 'Role',
component: RoutesAlias.Role,
meta: {
title: 'menus.system.role',
keepAlive: true,
roles: ['R_SUPER']
}
},
{
path: 'user-center',
name: 'UserCenter',
component: RoutesAlias.UserCenter,
meta: {
title: 'menus.system.userCenter',
isHide: true,
keepAlive: true,
isHideTab: true
}
},
{
path: 'menu',
name: 'Menus',
component: RoutesAlias.Menu,
meta: {
title: 'menus.system.menu',
keepAlive: true,
roles: ['R_SUPER'],
authList: [
{
title: '新增',
auth_mark: 'add'
},
{
title: '编辑',
auth_mark: 'edit'
},
{
title: '删除',
auth_mark: 'delete'
}
]
}
},
{
path: 'nested',
name: 'Nested',
component: '',
meta: {
title: 'menus.system.nested',
keepAlive: true
},
children: [
{
path: 'menu1',
name: 'NestedMenu1',
component: RoutesAlias.NestedMenu1,
meta: {
title: 'menus.system.menu1',
icon: '',
keepAlive: true
}
},
{
path: 'menu2',
name: 'NestedMenu2',
component: '',
meta: {
title: 'menus.system.menu2',
icon: '',
keepAlive: true
},
children: [
{
path: 'menu2-1',
name: 'NestedMenu2-1',
component: RoutesAlias.NestedMenu21,
meta: {
title: 'menus.system.menu21',
icon: '',
keepAlive: true
}
}
]
},
{
path: 'menu3',
name: 'NestedMenu3',
component: '',
meta: {
title: 'menus.system.menu3',
icon: '',
keepAlive: true
},
children: [
{
path: 'menu3-1',
name: 'NestedMenu3-1',
component: RoutesAlias.NestedMenu31,
meta: {
title: 'menus.system.menu31',
icon: '',
keepAlive: true
}
},
{
path: 'menu3-2',
name: 'NestedMenu3-2',
component: '',
meta: {
title: 'menus.system.menu32',
icon: '',
keepAlive: true
},
children: [
{
path: 'menu3-2-1',
name: 'NestedMenu3-2-1',
component: RoutesAlias.NestedMenu321,
meta: {
title: 'menus.system.menu321',
icon: '',
keepAlive: true
}
}
]
}
]
}
]
}
]
},
{
path: '/car',
name: 'Car',
component: RoutesAlias.Home,
meta: {
title: 'menus.car.title',
icon: '',
roles: ['R_SUPER', 'R_ADMIN']
},
children: [
{
path: 'usedcar',
name: 'Usedcar',
component: RoutesAlias.Usedcar,
meta: {
title: 'menus.car.used',
keepAlive: true,
roles: ['R_SUPER', 'R_ADMIN']
}
},
{
path: 'newcar',
name: 'Newcar',
component: RoutesAlias.Newcar,
meta: {
title: 'menus.car.newcar',
keepAlive: true,
roles: ['R_SUPER']
}
}
]
},
{
path: '/article',
name: 'Article',
component: RoutesAlias.Home,
meta: {
title: 'menus.article.title',
icon: '',
roles: ['R_SUPER', 'R_ADMIN']
},
children: [
{
path: 'article-list',
name: 'ArticleList',
component: RoutesAlias.ArticleList,
meta: {
title: 'menus.article.articleList',
keepAlive: true,
authList: [
{
title: '新增',
auth_mark: 'add'
},
{
title: '编辑',
auth_mark: 'edit'
}
]
}
},
{
path: 'detail',
name: 'ArticleDetail',
component: RoutesAlias.ArticleDetail,
meta: {
title: 'menus.article.articleDetail',
isHide: true,
keepAlive: true,
activePath: '/article/article-list' // 激活菜单路径
}
},
{
path: 'comment',
name: 'ArticleComment',
component: RoutesAlias.Comment,
meta: {
title: 'menus.article.comment',
keepAlive: true
}
},
{
path: 'publish',
name: 'ArticlePublish',
component: RoutesAlias.ArticlePublish,
meta: {
title: 'menus.article.articlePublish',
keepAlive: true,
authList: [
{
title: '发布',
auth_mark: 'article/article-publish/add'
}
]
}
}
]
},
{
path: '/safeguard',
name: 'Safeguard',
component: RoutesAlias.Home,
meta: {
title: 'menus.safeguard.title',
icon: '',
keepAlive: false
},
children: [
{
path: 'server',
name: 'SafeguardServer',
component: RoutesAlias.Server,
meta: {
title: 'menus.safeguard.server',
keepAlive: true
}
}
]
}
]