index.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import Vue from 'vue';
  2. import Router from 'vue-router';
  3. Vue.use(Router);
  4. /* Layout */
  5. import Layout from '@/pages/layout/layout';
  6. /* Router Modules */
  7. // 管理员管理
  8. import adminManageRouter from './modules/admin-manage';
  9. // 授权主体管理
  10. import authSubjectManageRouter from './modules/auth-subject-manage';
  11. // 授权客体管理
  12. import authObjectManageRouter from './modules/auth-object-manage';
  13. // 应用功能授权管理
  14. import appfunAuthManageRouter from './modules/appfun-auth-manage';
  15. // 数据授权管理
  16. // import dataAuthManageRouter from './modules/data-auth-manage';
  17. // 名单管理
  18. import listManageRouter from './modules/list-manage';
  19. // 日志管理
  20. import logManage from './modules/log-manage';
  21. // 统计报表
  22. import statisticsManageRouter from './modules/statistics-manage';
  23. import logReport from './modules/log-report';
  24. /** note: Submenu only appear when children.length>=1
  25. * detail see https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  26. **/
  27. /**
  28. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  29. * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
  30. * if not set alwaysShow, only more than one route under the children
  31. * it will becomes nested mode, otherwise not show the root menu
  32. * redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
  33. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  34. * meta : {
  35. permission: ['menu_key1',"menu_key2"] will control the page permission (you can set multiple permissions)
  36. title: 'title' the name show in submenu and breadcrumb (recommend set)
  37. icon: 'svg-name' the icon show in the sidebar
  38. noCache: true if true, the page will no be cached(default is false)
  39. breadcrumb: false if false, the item will hidden in breadcrumb(default is true)
  40. }
  41. **/
  42. export const constantRouterMap = [];
  43. export const asyncRouterMap = [
  44. {
  45. path: '/',
  46. component: Layout,
  47. redirect: '/home'
  48. },
  49. // 全文匹配
  50. {
  51. path: '*',
  52. redirect: '/'
  53. },
  54. {
  55. path: '/redirect',
  56. component: Layout,
  57. hidden: true,
  58. children: [
  59. {
  60. path: '/redirect/:path*',
  61. component: () => import('@/pages/common/redirect/index')
  62. }
  63. ]
  64. },
  65. // 登录
  66. {
  67. path: '/login',
  68. component: () => import('@/pages/common/login/index'),
  69. // component: () => import("@/pages/common/login-page/login-type-1"),
  70. hidden: true
  71. },
  72. // 我的主页
  73. {
  74. path: '/home',
  75. component: Layout,
  76. redirect: '/home/index',
  77. meta: { title: '我的主页', icon: 'icon-home', noCache: true },
  78. hidden: true,
  79. children: [
  80. {
  81. path: 'index',
  82. component: () => import('@/pages/home'),
  83. name: 'index',
  84. meta: { title: '我的主页', noCache: true }
  85. }
  86. ]
  87. },
  88. adminManageRouter,
  89. authSubjectManageRouter,
  90. authObjectManageRouter,
  91. appfunAuthManageRouter,
  92. // 服务授权管理
  93. {
  94. path: '/service-auth-manage',
  95. component: Layout,
  96. meta: { title: '服务授权管理', icon: 'icon-fwsqgl', noCache: true, permission: ['QXGL_SQGL_SJSQGL_RYSQ'] },
  97. children: [
  98. {
  99. path: 'init',
  100. component: () => import('@/pages/service-auth-manage'),
  101. name: 'service-auth-manage',
  102. meta: { title: '服务授权管理', noCache: true, permission: ['QXGL_SQGL_SJSQGL_RYSQ'] }
  103. }
  104. ]
  105. },
  106. // dataAuthManageRouter,
  107. // // 权限自助管理
  108. // {
  109. // path: '/permission-selfhelp-manage',
  110. // component: Layout,
  111. // meta: { title: '权限自助管理', icon: 'icon-handle', noCache: true },
  112. // children: [
  113. // {
  114. // path: 'init',
  115. // component: () => import('@/pages/permission-selfhelp-manage'),
  116. // name: 'permission-selfhelp-manage',
  117. // meta: { title: '权限自助管理', noCache: true }
  118. // }
  119. // ]
  120. // },
  121. // {
  122. // path: '/data-auth-search',
  123. // component: Layout,
  124. // meta: { title: '数据权限查询', icon: 'icon-othersearch', noCache: true },
  125. // children: [
  126. // {
  127. // path: 'init',
  128. // component: () => import('@/pages/permission-to-search/data-auth-search.vue'),
  129. // name: 'data-auth-search',
  130. // meta: { title: '数据权限查询', noCache: true, layout: "page" }
  131. // }
  132. // ]
  133. // },
  134. // 权限综合查询
  135. // path: '/permission-to-searchS',
  136. // component: Layout,
  137. // meta: { title: '权限综合查询', icon: 'icon-othersearch', noCache: true, permission: ['QXGL_SQCX'] },
  138. // children: [
  139. // {
  140. // path: 'data-auth-search',
  141. // component: () => import('@/pages/permission-to-search/data-auth-search.vue'),
  142. // name: 'data-auth-search',
  143. // meta: { title: '数据权限查询', noCache: true, layout: 'page', permission: ['QXGL_SQCX_SJSQCX'] }
  144. // }
  145. // ]
  146. // },
  147. // listManageRouter,
  148. ...logManage,
  149. statisticsManageRouter
  150. ];
  151. export default new Router({
  152. // mode: "history", // require service support
  153. scrollBehavior: () => ({ y: 0 }),
  154. routes: constantRouterMap
  155. });