import {RoutesAlias} from '../routesAlias' import {AppRouteRecord} from '@/types/router' import {WEB_LINKS} from '@/utils/constants' /** * 菜单列表、异步路由 * * 支持两种模式: * 前端静态配置 - 直接使用本文件中定义的路由配置 * 后端动态配置 - 后端返回菜单数据,前端解析生成路由 * * 菜单标题(title): * 可以是 i18n 的 key,也可以是字符串,比如:'用户列表' * * 注意事项: * 1、RoutesAlias.Layout 指向的是布局容器,后端返回的菜单数据中,component 字段需要指向 /index/index * 2、path、name 不要和动态路由冲突,否则会导致路由冲突无法访问 * 3、id没有设置或为0表示不需要权限,id 和 LewaimaiAdminPingtaiAuth.php 保持一致 */ export const asyncRoutes: AppRouteRecord[] = [ // 主页一级菜单配置示例: { name: 'Home', path: '/dashboard/console', component: RoutesAlias.Dashboard, meta: { title: 'menus.dashboard.console', icon: '', keepAlive: false, fixedTab: true, } }, { id: 12, path: '/school', name: 'SchoolManage', component: RoutesAlias.Layout, meta: { title: 'menus.school.list', icon: '' }, children: [ { id: 1201, path: 'list', name: 'school', component: RoutesAlias.SchoolList, meta: { title: 'menus.school.list', keepAlive: false, authList: [ { id: 120100, title: '列表', }, { id: 120101, title: '新增', }, { id: 120102, title: '编辑', } ] } }, { path: 'edit', name: 'SchoolEdit', component: RoutesAlias.SchoolEdit, meta: { title: 'menus.school.edit', isHide: true, keepAlive: false, activePath: '/school/list' // 激活菜单路径 } }, { path: 'info', name: 'SchoolInfo', component: RoutesAlias.SchoolInfo, meta: { title: 'menus.school.info', isHide: true, keepAlive: false, activePath: '/school/list' // 激活菜单路径 } }, { id: 1202, path: 'relation', name: 'schoolRelation', component: RoutesAlias.SchoolRelation, meta: { title: 'menus.school.relation', keepAlive: false, authList: [ { id: 120200, title: '列表', }, { id: 120201, title: '新增', }, { id: 120202, title: '编辑', }, { id: 120203, title: '删除', }, ] } }, { id: 1203, path: 'follow', name: 'schoolFollow', component: RoutesAlias.SchoolFollow, meta: { title: 'menus.school.follow', // keepAlive: true, authList: [ { id: 120300, title: '列表', }, { id: 120301, title: '编辑', } ] } }, { path: 'follow/info', name: 'SchoolFollowInfo', component: RoutesAlias.SchoolFollowInfo, meta: { title: 'menus.school.followInfo', isHide: true, keepAlive: false, activePath: '/school/follow' // 激活菜单路径 } }, ] }, { id: 13, path: '/canteen', name: 'CanteenManage', component: RoutesAlias.Layout, meta: { title: 'menus.canteen.list', icon: '' }, children: [ { id: 1301, path: 'list', name: 'canteen', component: RoutesAlias.CanteenList, meta: { title: 'menus.canteen.list', keepAlive: false, authList: [ { id: 130100, title: '列表', }, { id: 130101, title: '新增', }, { id: 130102, title: '编辑', } ] } }, { path: 'edit', name: 'canteenEdit', component: RoutesAlias.CanteenEdit, meta: { title: 'menus.canteen.edit', isHide: true, keepAlive: false, activePath: '/canteen/list' // 激活菜单路径 } }, { path: 'info', name: 'canteenInfo', component: RoutesAlias.CanteenInfo, meta: { title: 'menus.canteen.info', isHide: true, keepAlive: false, activePath: '/canteen/list' // 激活菜单路径 }, }, { id: 1303, path: 'follow', name: 'canteenFollow', component: RoutesAlias.CanteenFollow, meta: { title: 'menus.canteen.follow', // keepAlive: true, authList: [ { id: 130300, title: '列表', }, { id: 130301, title: '编辑', } ] } }, { path: 'follow/info', name: 'canteenFollowInfo', component: RoutesAlias.CanteenFollowInfo, meta: { title: 'menus.canteen.followInfo', isHide: true, keepAlive: false, activePath: '/canteen/follow' // 激活菜单路径 } }, ] }, { id: 14, path: '/company', name: 'CompanyManage', component: RoutesAlias.Layout, meta: { title: 'menus.company.list', icon: '' }, children: [ { id: 1401, path: 'list', name: 'company', component: RoutesAlias.CompanyList, meta: { title: 'menus.company.list', keepAlive: false, authList: [ { id: 140100, title: '列表', }, { id: 140101, title: '新增', }, { id: 140102, title: '编辑', }, ] } }, { path: 'edit', name: 'CompanyEdit', component: RoutesAlias.CompanyEdit, meta: { title: 'menus.company.edit', isHide: true, keepAlive: false, activePath: '/company/list' // 激活菜单路径 } }, { path: 'info', name: 'CompanyInfo', component: RoutesAlias.CompanyInfo, meta: { title: 'menus.company.info', isHide: true, keepAlive: false, activePath: '/company/list' // 激活菜单路径 } }, { id: 1402, path: 'relation', name: 'companyRelation', component: RoutesAlias.CompanyRelation, meta: { title: 'menus.company.relation', keepAlive: false, authList: [ { id: 140200, title: '列表', }, { id: 140201, title: '新增', }, { id: 140202, title: '编辑', }, { id: 140203, title: '删除', }, ] } }, { id: 1403, path: 'follow', name: 'companyFollow', component: RoutesAlias.CompanyFollow, meta: { title: 'menus.company.follow', // keepAlive: true, authList: [ { id: 140300, title: '列表', }, { id: 140301, title: '编辑', } ] } }, { path: 'follow/info', name: 'CompanyFollowInfo', component: RoutesAlias.CompanyFollowInfo, meta: { title: 'menus.company.followInfo', isHide: true, keepAlive: false, activePath: '/company/follow' // 激活菜单路径 } }, ] }, { id: 11, path: '/system', name: 'System', component: RoutesAlias.Layout, meta: { title: 'menus.system.title', icon: '' }, children: [ { id: 1101, path: 'user', name: 'User', component: RoutesAlias.User, meta: { title: 'menus.system.user', keepAlive: false, authList: [ { id: 110100, title: '列表', }, { id: 110101, title: '编辑', }, { id: 110102, title: '删除', } ] } }, { id: 1102, path: 'role', name: 'Role', component: RoutesAlias.Role, meta: { title: 'menus.system.role', keepAlive: false, authList: [ { id: 110200, title: '列表', }, { id: 110201, title: '分配权限', }, { id: 110202, title: '编辑', }, { id: 110203, title: '删除', } ] } } ] }, { path: '/system/user-center', name: 'UserCenter', component: RoutesAlias.UserCenter, meta: { title: 'menus.system.userCenter', isHide: true, keepAlive: false, activePath: '/system/user' // 激活菜单路径 } }, ]