router.config.js 11 KB

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