remaining.ts 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. import { Layout } from '@/utils/routerHelper'
  2. const { t } = useI18n()
  3. /**
  4. * redirect: noredirect 当设置 noredirect 的时候该路由在面包屑导航中不可被点击
  5. * name:'router-name' 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
  6. * meta : {
  7. hidden: true 当设置 true 的时候该路由不会再侧边栏出现 如404,login等页面(默认 false)
  8. alwaysShow: true 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式,
  9. 只有一个时,会将那个子路由当做根路由显示在侧边栏,
  10. 若你想不管路由下面的 children 声明的个数都显示你的根路由,
  11. 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,
  12. 一直显示根路由(默认 false)
  13. title: 'title' 设置该路由在侧边栏和面包屑中展示的名字
  14. icon: 'svg-name' 设置该路由的图标
  15. noCache: true 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
  16. breadcrumb: false 如果设置为false,则不会在breadcrumb面包屑中显示(默认 true)
  17. affix: true 如果设置为true,则会一直固定在tag项中(默认 false)
  18. noTagsView: true 如果设置为true,则不会出现在tag中(默认 false)
  19. activeMenu: '/dashboard' 显示高亮的路由路径
  20. followAuth: '/dashboard' 跟随哪个路由进行权限过滤
  21. canTo: true 设置为true即使hidden为true,也依然可以进行路由跳转(默认 false)
  22. }
  23. **/
  24. const remainingRouter: AppRouteRecordRaw[] = [
  25. {
  26. path: '/redirect',
  27. component: Layout,
  28. name: 'Redirect',
  29. children: [
  30. {
  31. path: '/redirect/:path(.*)',
  32. name: 'Redirect',
  33. component: () => import('@/views/Redirect/Redirect.vue'),
  34. meta: {}
  35. }
  36. ],
  37. meta: {
  38. hidden: true,
  39. noTagsView: true
  40. }
  41. },
  42. {
  43. path: '/',
  44. component: Layout,
  45. redirect: '/index',
  46. name: 'Home',
  47. meta: {},
  48. children: [
  49. {
  50. path: 'index',
  51. component: () => import('@/views/Home/Index.vue'),
  52. name: 'Index',
  53. meta: {
  54. title: t('router.home'),
  55. icon: 'ep:home-filled',
  56. noCache: false,
  57. affix: true
  58. }
  59. }
  60. ]
  61. },
  62. {
  63. path: '/userinfo',
  64. component: Layout,
  65. name: 'UserInfo',
  66. meta: {
  67. hidden: true
  68. },
  69. children: [
  70. {
  71. path: 'profile',
  72. component: () => import('@/views/Profile/Index.vue'),
  73. name: 'Profile',
  74. meta: {
  75. canTo: true,
  76. hidden: true,
  77. noTagsView: false,
  78. icon: 'ep:user',
  79. title: t('common.profile')
  80. }
  81. }
  82. ]
  83. },
  84. {
  85. path: '/codegen',
  86. component: Layout,
  87. name: 'CodegenEdit',
  88. meta: {
  89. hidden: true
  90. },
  91. children: [
  92. {
  93. path: 'edit',
  94. component: () => import('@/views/infra/codegen/EditTable.vue'),
  95. name: 'EditTable',
  96. meta: {
  97. noCache: true,
  98. hidden: true,
  99. canTo: true,
  100. icon: 'ep:edit',
  101. title: '修改生成配置',
  102. activeMenu: 'infra/codegen/index'
  103. }
  104. }
  105. ]
  106. },
  107. {
  108. path: '/job',
  109. component: Layout,
  110. name: 'JobL',
  111. meta: {
  112. hidden: true
  113. },
  114. children: [
  115. {
  116. path: 'job-log',
  117. component: () => import('@/views/infra/job/JobLog.vue'),
  118. name: 'JobLog',
  119. meta: {
  120. noCache: true,
  121. hidden: true,
  122. canTo: true,
  123. icon: 'ep:edit',
  124. title: '调度日志',
  125. activeMenu: 'infra/job/index'
  126. }
  127. }
  128. ]
  129. },
  130. {
  131. path: '/login',
  132. component: () => import('@/views/Login/Login.vue'),
  133. name: 'Login',
  134. meta: {
  135. hidden: true,
  136. title: t('router.login'),
  137. noTagsView: true
  138. }
  139. },
  140. {
  141. path: '/403',
  142. component: () => import('@/views/Error/403.vue'),
  143. name: 'NoAccess',
  144. meta: {
  145. hidden: true,
  146. title: '403',
  147. noTagsView: true
  148. }
  149. },
  150. {
  151. path: '/404',
  152. component: () => import('@/views/Error/404.vue'),
  153. name: 'NoFound',
  154. meta: {
  155. hidden: true,
  156. title: '404',
  157. noTagsView: true
  158. }
  159. },
  160. {
  161. path: '/500',
  162. component: () => import('@/views/Error/500.vue'),
  163. name: 'Error',
  164. meta: {
  165. hidden: true,
  166. title: '500',
  167. noTagsView: true
  168. }
  169. }
  170. ]
  171. export default remainingRouter