remaining.ts 4.6 KB

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