| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433 |
- 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' // 激活菜单路径
- }
- },
- ]
|