router.config.js 14 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: '/upms',
  132. name: 'upms',
  133. component: RouteView,
  134. redirect: '/system/user',
  135. meta: { title: '系统管理', icon: 'profile', permission: [ 'upms' ] },
  136. children: [
  137. {
  138. path: '/upms/dept',
  139. name: 'Dept',
  140. component: () => import('@/views/upms/dept/Dept'),
  141. meta: { title: '部门管理', permission: [ 'upms' ] }
  142. },
  143. {
  144. path: '/upms/user',
  145. name: 'User',
  146. component: () => import('@/views/upms/user/User'),
  147. meta: { title: '用户管理', permission: [ 'upms' ] }
  148. },
  149. {
  150. path: '/upms/role',
  151. name: 'Role',
  152. component: () => import('@/views/upms/role/Role'),
  153. meta: { title: '角色管理', permission: [ 'upms' ] }
  154. },
  155. {
  156. path: '/upms/menu',
  157. name: 'Menu',
  158. component: () => import('@/views/upms/menu/Menu'),
  159. meta: { title: '菜单管理', permission: [ 'upms' ] }
  160. },
  161. {
  162. path: '/upms/dict',
  163. name: 'Dict',
  164. component: () => import('@/views/upms/dict/Dict'),
  165. meta: { title: '数据字典', permission: [ 'upms' ] }
  166. },
  167. {
  168. path: '/upms/notice',
  169. name: 'Notice',
  170. component: () => import('@/views/upms/notice/SysNotice'),
  171. meta: { title: '消息管理', permission: [ 'upms' ] }
  172. },
  173. {
  174. path: '/upms/log',
  175. name: 'Log',
  176. component: () => import('@/views/upms/log/Log'),
  177. meta: { title: '系统日志', permission: [ 'upms' ] }
  178. }
  179. ]
  180. },
  181. // profile
  182. {
  183. path: '/profile',
  184. name: 'profile',
  185. component: RouteView,
  186. redirect: '/profile/basic',
  187. meta: { title: '详情页', icon: 'profile', permission: [ 'profile' ] },
  188. children: [
  189. {
  190. path: '/profile/basic',
  191. name: 'ProfileBasic',
  192. component: () => import('@/views/profile/basic/Index'),
  193. meta: { title: '基础详情页', permission: [ 'profile' ] }
  194. },
  195. {
  196. path: '/profile/advanced',
  197. name: 'ProfileAdvanced',
  198. component: () => import('@/views/profile/advanced/Advanced'),
  199. meta: { title: '高级详情页', permission: [ 'profile' ] }
  200. }
  201. ]
  202. },
  203. // result
  204. {
  205. path: '/result',
  206. name: 'result',
  207. component: PageView,
  208. redirect: '/result/success',
  209. meta: { title: '结果页', icon: 'check-circle-o', permission: [ 'result' ] },
  210. children: [
  211. {
  212. path: '/result/success',
  213. name: 'ResultSuccess',
  214. component: () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
  215. meta: { title: '成功', keepAlive: false, hiddenHeaderContent: true, permission: [ 'result' ] }
  216. },
  217. {
  218. path: '/result/fail',
  219. name: 'ResultFail',
  220. component: () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),
  221. meta: { title: '失败', keepAlive: false, hiddenHeaderContent: true, permission: [ 'result' ] }
  222. }
  223. ]
  224. },
  225. // Exception
  226. {
  227. path: '/exception',
  228. name: 'exception',
  229. component: RouteView,
  230. redirect: '/exception/403',
  231. meta: { title: '异常页', icon: 'warning', permission: [ 'exception' ] },
  232. children: [
  233. {
  234. path: '/exception/403',
  235. name: 'Exception403',
  236. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/403'),
  237. meta: { title: '403', permission: [ 'exception' ] }
  238. },
  239. {
  240. path: '/exception/404',
  241. name: 'Exception404',
  242. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404'),
  243. meta: { title: '404', permission: [ 'exception' ] }
  244. },
  245. {
  246. path: '/exception/500',
  247. name: 'Exception500',
  248. component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/500'),
  249. meta: { title: '500', permission: [ 'exception' ] }
  250. }
  251. ]
  252. },
  253. // account
  254. {
  255. path: '/account',
  256. component: RouteView,
  257. redirect: '/account/center',
  258. name: 'account',
  259. meta: { title: '个人页', icon: 'user', keepAlive: true, permission: [ 'user' ] },
  260. children: [
  261. {
  262. path: '/account/center',
  263. name: 'center',
  264. component: () => import('@/views/account/center/Index'),
  265. meta: { title: '个人中心', keepAlive: true, permission: [ 'user' ] }
  266. },
  267. {
  268. path: '/account/settings',
  269. name: 'settings',
  270. component: () => import('@/views/account/settings/Index'),
  271. meta: { title: '个人设置', hideHeader: true, permission: [ 'user' ] },
  272. redirect: '/account/settings/base',
  273. hideChildrenInMenu: true
  274. // children: [
  275. // {
  276. // path: '/account/settings/base',
  277. // name: 'BaseSettings',
  278. // component: () => import('@/views/account/settings/page/BaseSetting'),
  279. // meta: { title: '基本设置', permission: [ 'user' ] }
  280. // },
  281. // {
  282. // path: '/account/settings/security',
  283. // name: 'SecuritySettings',
  284. // component: () => import('@/views/account/settings/page/Security'),
  285. // meta: { title: '安全设置', keepAlive: true, permission: [ 'user' ] }
  286. // },
  287. // {
  288. // path: '/account/settings/custom',
  289. // name: 'CustomSettings',
  290. // component: () => import('@/views/account/settings/page/Custom'),
  291. // meta: { title: '个性化设置', keepAlive: true, permission: [ 'user' ] }
  292. // },
  293. // {
  294. // path: '/account/settings/binding',
  295. // name: 'BindingSettings',
  296. // component: () => import('@/views/account/settings/page/Binding'),
  297. // meta: { title: '账户绑定', keepAlive: true, permission: [ 'user' ] }
  298. // },
  299. // {
  300. // path: '/account/settings/notification',
  301. // name: 'NotificationSettings',
  302. // component: () => import('@/views/account/settings/page/Notification'),
  303. // meta: { title: '新消息通知', keepAlive: true, permission: [ 'user' ] }
  304. // }
  305. // ]
  306. }
  307. ]
  308. },
  309. // other
  310. {
  311. path: '/other',
  312. name: 'otherPage',
  313. component: PageView,
  314. meta: { title: '其他组件', icon: 'slack', permission: [ 'dashboard' ] },
  315. redirect: '/other/icon-selector',
  316. children: [
  317. {
  318. path: '/other/icon-selector',
  319. name: 'TestIconSelect',
  320. component: () => import('@/views/other/IconSelectorView'),
  321. meta: { title: 'IconSelector', icon: 'tool', keepAlive: true, permission: [ 'dashboard' ] }
  322. },
  323. {
  324. path: '/other/list',
  325. component: RouteView,
  326. meta: { title: '业务布局', icon: 'layout', permission: [ 'support' ] },
  327. redirect: '/other/list/tree-list',
  328. children: [
  329. {
  330. path: '/other/list/tree-list',
  331. name: 'TreeList',
  332. component: () => import('@/views/other/TreeList'),
  333. meta: { title: '树目录表格', keepAlive: true }
  334. },
  335. {
  336. path: '/other/list/edit-table',
  337. name: 'EditList',
  338. component: () => import('@/views/other/TableInnerEditList'),
  339. meta: { title: '内联编辑表格', keepAlive: true }
  340. },
  341. {
  342. path: '/other/list/user-list',
  343. name: 'UserList',
  344. component: () => import('@/views/other/UserList'),
  345. meta: { title: '用户列表', keepAlive: true }
  346. },
  347. {
  348. path: '/other/list/role-list',
  349. name: 'RoleList',
  350. component: () => import('@/views/other/RoleList'),
  351. meta: { title: '角色列表', keepAlive: true }
  352. },
  353. {
  354. path: '/other/list/system-role',
  355. name: 'SystemRole',
  356. component: () => import('@/views/role/RoleList'),
  357. meta: { title: '角色列表2', keepAlive: true }
  358. },
  359. {
  360. path: '/other/list/permission-list',
  361. name: 'PermissionList',
  362. component: () => import('@/views/other/PermissionList'),
  363. meta: { title: '权限列表', keepAlive: true }
  364. }
  365. ]
  366. }
  367. ]
  368. }
  369. ]
  370. },
  371. {
  372. path: '*', redirect: '/404', hidden: true
  373. }
  374. ]