router.config.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. // eslint-disable-next-line
  2. import { UserLayout, BasicLayout, RouteView, BlankLayout, PageView } from '@/layouts'
  3. import { bxAnaalyse } from '@/core/icons'
  4. export const asyncRouterMap = [
  5. {
  6. path: '/',
  7. name: 'index',
  8. component: BasicLayout,
  9. meta: { title: '首页' },
  10. redirect: '/dashboard/workplace',
  11. children: [
  12. // dashboard
  13. {
  14. path: '/dashboard',
  15. name: 'dashboard',
  16. redirect: '/dashboard/workplace',
  17. component: RouteView,
  18. meta: { title: '仪表盘', keepAlive: true, icon: bxAnaalyse, permission: [ 'dashboard' ] },
  19. children: [
  20. {
  21. path: '/dashboard/analysis',
  22. name: 'Analysis',
  23. component: () => import('@/views/dashboard/Analysis'),
  24. meta: { title: '分析页', keepAlive: false, permission: [ 'dashboard' ] }
  25. },
  26. // 外部链接
  27. {
  28. path: 'https://www.baidu.com/',
  29. name: 'Monitor',
  30. meta: { title: '监控页(外部)', target: '_blank' }
  31. },
  32. {
  33. path: '/dashboard/workplace',
  34. name: 'Workplace',
  35. component: () => import('@/views/dashboard/Workplace'),
  36. meta: { title: '工作台', keepAlive: true, permission: [ 'dashboard' ] }
  37. },
  38. {
  39. path: '/dashboard/test-work',
  40. name: 'TestWork',
  41. component: () => import('@/views/dashboard/TestWork'),
  42. meta: { title: '测试功能', keepAlive: true, permission: [ 'dashboard' ] }
  43. }
  44. ]
  45. },
  46. // forms
  47. {
  48. path: '/form',
  49. redirect: '/form/base-form',
  50. component: PageView,
  51. meta: { title: '表单页', icon: 'form', permission: [ 'form' ] },
  52. children: [
  53. {
  54. path: '/form/base-form',
  55. name: 'BaseForm',
  56. component: () => import('@/views/form/BasicForm'),
  57. meta: { title: '基础表单', keepAlive: true, permission: [ 'form' ] }
  58. },
  59. {
  60. path: '/form/step-form',
  61. name: 'StepForm',
  62. component: () => import('@/views/form/stepForm/StepForm'),
  63. meta: { title: '分步表单', keepAlive: true, permission: [ 'form' ] }
  64. },
  65. {
  66. path: '/form/advanced-form',
  67. name: 'AdvanceForm',
  68. component: () => import('@/views/form/advancedForm/AdvancedForm'),
  69. meta: { title: '高级表单', keepAlive: true, permission: [ 'form' ] }
  70. }
  71. ]
  72. },
  73. // list
  74. {
  75. path: '/list',
  76. name: 'list',
  77. component: PageView,
  78. redirect: '/list/table-list',
  79. meta: { title: '列表页', icon: 'table', permission: [ 'table' ] },
  80. children: [
  81. {
  82. path: '/list/table-list/:pageNo([1-9]\\d*)?',
  83. name: 'TableListWrapper',
  84. hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
  85. component: () => import('@/views/list/TableList'),
  86. meta: { title: '查询表格', keepAlive: true, permission: [ 'table' ] }
  87. },
  88. {
  89. path: '/list/basic-list',
  90. name: 'BasicList',
  91. component: () => import('@/views/list/StandardList'),
  92. meta: { title: '标准列表', keepAlive: true, permission: [ 'table' ] }
  93. },
  94. {
  95. path: '/list/card',
  96. name: 'CardList',
  97. component: () => import('@/views/list/CardList'),
  98. meta: { title: '卡片列表', keepAlive: true, permission: [ 'table' ] }
  99. },
  100. {
  101. path: '/list/search',
  102. name: 'SearchList',
  103. component: () => import('@/views/list/search/SearchLayout'),
  104. redirect: '/list/search/article',
  105. meta: { title: '搜索列表', keepAlive: true, permission: [ 'table' ] },
  106. children: [
  107. {
  108. path: '/list/search/article',
  109. name: 'SearchArticles',
  110. component: () => import('../views/list/search/Article'),
  111. meta: { title: '搜索列表(文章)', permission: [ 'table' ] }
  112. },
  113. {
  114. path: '/list/search/project',
  115. name: 'SearchProjects',
  116. component: () => import('../views/list/search/Projects'),
  117. meta: { title: '搜索列表(项目)', permission: [ 'table' ] }
  118. },
  119. {
  120. path: '/list/search/application',
  121. name: 'SearchApplications',
  122. component: () => import('../views/list/search/Applications'),
  123. meta: { title: '搜索列表(应用)', permission: [ 'table' ] }
  124. }
  125. ]
  126. }
  127. ]
  128. },
  129. // profile
  130. {
  131. path: '/profile',
  132. name: 'profile',
  133. component: RouteView,
  134. redirect: '/profile/basic',
  135. meta: { title: '详情页', icon: 'profile', permission: [ 'profile' ] },
  136. children: [
  137. {
  138. path: '/profile/basic',
  139. name: 'ProfileBasic',
  140. component: () => import('@/views/profile/basic/Index'),
  141. meta: { title: '基础详情页', permission: [ 'profile' ] }
  142. },
  143. {
  144. path: '/profile/advanced',
  145. name: 'ProfileAdvanced',
  146. component: () => import('@/views/profile/advanced/Advanced'),
  147. meta: { title: '高级详情页', permission: [ 'profile' ] }
  148. }
  149. ]
  150. },
  151. // result
  152. {
  153. path: '/result',
  154. name: 'result',
  155. component: PageView,
  156. redirect: '/result/success',
  157. meta: { title: '结果页', icon: 'check-circle-o', permission: [ 'result' ] },
  158. children: [
  159. {
  160. path: '/result/success',
  161. name: 'ResultSuccess',
  162. component: () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
  163. meta: { title: '成功', keepAlive: false, hiddenHeaderContent: true, permission: [ 'result' ] }
  164. },
  165. {
  166. path: '/result/fail',
  167. name: 'ResultFail',
  168. component: () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),
  169. meta: { title: '失败', keepAlive: false, hiddenHeaderContent: true, permission: [ 'result' ] }
  170. }
  171. ]
  172. },
  173. // Exception
  174. {
  175. path: '/exception',
  176. name: 'exception',
  177. component: RouteView,
  178. redirect: '/exception/403',
  179. meta: { title: '异常页', icon: 'warning', permission: [ 'exception' ] },
  180. children: [
  181. {
  182. path: '/exception/403',
  183. name: 'Exception403',
  184. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
  185. meta: { title: '403', permission: [ 'exception' ] }
  186. },
  187. {
  188. path: '/exception/404',
  189. name: 'Exception404',
  190. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
  191. meta: { title: '404', permission: [ 'exception' ] }
  192. },
  193. {
  194. path: '/exception/500',
  195. name: 'Exception500',
  196. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
  197. meta: { title: '500', permission: [ 'exception' ] }
  198. }
  199. ]
  200. },
  201. // account
  202. {
  203. path: '/account',
  204. component: RouteView,
  205. redirect: '/account/center',
  206. name: 'account',
  207. meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },
  208. children: [
  209. {
  210. path: '/account/center',
  211. name: 'center',
  212. component: () => import('@/views/account/center/Index'),
  213. meta: { title: '个人中心', keepAlive: true, permission: [ 'user' ] }
  214. },
  215. {
  216. path: '/account/settings',
  217. name: 'settings',
  218. component: () => import('@/views/account/settings/Index'),
  219. meta: { title: '个人设置', hideHeader: true, permission: [ 'user' ] },
  220. redirect: '/account/settings/base',
  221. hideChildrenInMenu: true,
  222. children: [
  223. {
  224. path: '/account/settings/base',
  225. name: 'BaseSettings',
  226. component: () => import('@/views/account/settings/BaseSetting'),
  227. meta: { title: '基本设置', permission: [ 'user' ] }
  228. },
  229. {
  230. path: '/account/settings/security',
  231. name: 'SecuritySettings',
  232. component: () => import('@/views/account/settings/Security'),
  233. meta: { title: '安全设置', keepAlive: true, permission: [ 'user' ] }
  234. },
  235. {
  236. path: '/account/settings/custom',
  237. name: 'CustomSettings',
  238. component: () => import('@/views/account/settings/Custom'),
  239. meta: { title: '个性化设置', keepAlive: true, permission: [ 'user' ] }
  240. },
  241. {
  242. path: '/account/settings/binding',
  243. name: 'BindingSettings',
  244. component: () => import('@/views/account/settings/Binding'),
  245. meta: { title: '账户绑定', keepAlive: true, permission: [ 'user' ] }
  246. },
  247. {
  248. path: '/account/settings/notification',
  249. name: 'NotificationSettings',
  250. component: () => import('@/views/account/settings/Notification'),
  251. meta: { title: '新消息通知', keepAlive: true, permission: [ 'user' ] }
  252. }
  253. ]
  254. }
  255. ]
  256. },
  257. // other
  258. {
  259. path: '/other',
  260. name: 'otherPage',
  261. component: PageView,
  262. meta: { title: '其他组件', icon: 'slack', permission: [ 'dashboard' ] },
  263. redirect: '/other/icon-selector',
  264. children: [
  265. {
  266. path: '/other/icon-selector',
  267. name: 'TestIconSelect',
  268. component: () => import('@/views/other/IconSelectorView'),
  269. meta: { title: 'IconSelector', icon: 'tool', keepAlive: true, permission: [ 'dashboard' ] }
  270. },
  271. {
  272. path: '/other/list',
  273. component: RouteView,
  274. meta: { title: '业务布局', icon: 'layout', permission: [ 'support' ] },
  275. redirect: '/other/list/tree-list',
  276. children: [
  277. {
  278. path: '/other/list/tree-list',
  279. name: 'TreeList',
  280. component: () => import('@/views/other/TreeList'),
  281. meta: { title: '树目录表格', keepAlive: true }
  282. },
  283. {
  284. path: '/other/list/edit-table',
  285. name: 'EditList',
  286. component: () => import('@/views/other/TableInnerEditList'),
  287. meta: { title: '内联编辑表格', keepAlive: true }
  288. },
  289. {
  290. path: '/other/list/user-list',
  291. name: 'UserList',
  292. component: () => import('@/views/other/UserList'),
  293. meta: { title: '用户列表', keepAlive: true }
  294. },
  295. {
  296. path: '/other/list/role-list',
  297. name: 'RoleList',
  298. component: () => import('@/views/other/RoleList'),
  299. meta: { title: '角色列表', keepAlive: true }
  300. },
  301. {
  302. path: '/other/list/system-role',
  303. name: 'SystemRole',
  304. component: () => import('@/views/role/RoleList'),
  305. meta: { title: '角色列表2', keepAlive: true }
  306. },
  307. {
  308. path: '/other/list/permission-list',
  309. name: 'PermissionList',
  310. component: () => import('@/views/other/PermissionList'),
  311. meta: { title: '权限列表', keepAlive: true }
  312. }
  313. ]
  314. }
  315. ]
  316. }
  317. ]
  318. },
  319. {
  320. path: '*', redirect: '/404', hidden: true
  321. }
  322. ]
  323. /**
  324. * 基础路由
  325. * @type { *[] }
  326. */
  327. export const constantRouterMap = [
  328. {
  329. path: '/user',
  330. component: UserLayout,
  331. redirect: '/user/login',
  332. hidden: true,
  333. children: [
  334. {
  335. path: 'login',
  336. name: 'login',
  337. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Login')
  338. },
  339. {
  340. path: 'register',
  341. name: 'register',
  342. component: () => import(/* webpackChunkName: "user" */ '@/views/user/Register')
  343. },
  344. {
  345. path: 'register-result',
  346. name: 'registerResult',
  347. component: () => import(/* webpackChunkName: "user" */ '@/views/user/RegisterResult')
  348. },
  349. {
  350. path: 'recover',
  351. name: 'recover',
  352. component: undefined
  353. }
  354. ]
  355. },
  356. {
  357. path: '/test',
  358. component: BlankLayout,
  359. redirect: '/test/home',
  360. children: [
  361. {
  362. path: 'home',
  363. name: 'TestHome',
  364. component: () => import('@/views/Home')
  365. }
  366. ]
  367. },
  368. {
  369. path: '/404',
  370. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  371. }
  372. ]