router.config.js 14 KB

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