routes.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. // Just a mock data
  11. export const constantRoutes = [
  12. {
  13. path: '/redirect',
  14. component: 'layout/Layout',
  15. hidden: true,
  16. children: [
  17. {
  18. path: '/redirect/:path*',
  19. component: 'views/redirect/index'
  20. }
  21. ]
  22. },
  23. {
  24. path: '/login',
  25. component: 'views/login/index',
  26. hidden: true
  27. },
  28. {
  29. path: '/auth-redirect',
  30. component: 'views/login/auth-redirect',
  31. hidden: true
  32. },
  33. {
  34. path: '/404',
  35. component: 'views/error-page/404',
  36. hidden: true
  37. },
  38. {
  39. path: '/401',
  40. component: 'views/error-page/401',
  41. hidden: true
  42. },
  43. {
  44. path: '',
  45. component: 'layout/Layout',
  46. redirect: 'dashboard',
  47. children: [
  48. {
  49. path: 'dashboard',
  50. component: 'views/dashboard/index',
  51. name: 'Dashboard',
  52. meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
  53. }
  54. ]
  55. },
  56. {
  57. path: '/documentation',
  58. component: 'layout/Layout',
  59. children: [
  60. {
  61. path: 'index',
  62. component: 'views/documentation/index',
  63. name: 'Documentation',
  64. meta: { title: 'Documentation', icon: 'documentation', affix: true }
  65. }
  66. ]
  67. },
  68. {
  69. path: '/guide',
  70. component: 'layout/Layout',
  71. redirect: '/guide/index',
  72. children: [
  73. {
  74. path: 'index',
  75. component: 'views/guide/index',
  76. name: 'Guide',
  77. meta: { title: 'Guide', icon: 'guide', noCache: true }
  78. }
  79. ]
  80. }
  81. ]
  82. export const asyncRoutes = [
  83. {
  84. path: '/permission',
  85. component: 'layout/Layout',
  86. redirect: '/permission/index',
  87. alwaysShow: true,
  88. meta: {
  89. title: 'Permission',
  90. icon: 'lock',
  91. roles: ['admin', 'editor']
  92. },
  93. children: [
  94. {
  95. path: 'page',
  96. component: 'views/permission/page',
  97. name: 'PagePermission',
  98. meta: {
  99. title: 'Page Permission',
  100. roles: ['admin']
  101. }
  102. },
  103. {
  104. path: 'directive',
  105. component: 'views/permission/directive',
  106. name: 'DirectivePermission',
  107. meta: {
  108. title: 'Directive Permission'
  109. }
  110. },
  111. {
  112. path: 'role',
  113. component: 'views/permission/role',
  114. name: 'RolePermission',
  115. meta: {
  116. title: 'Role Permission',
  117. roles: ['admin']
  118. }
  119. }
  120. ]
  121. },
  122. {
  123. path: '/icon',
  124. component: 'layout/Layout',
  125. children: [
  126. {
  127. path: 'index',
  128. component: 'views/icons/index',
  129. name: 'Icons',
  130. meta: { title: 'Icons', icon: 'icon', noCache: true }
  131. }
  132. ]
  133. },
  134. {
  135. path: '/components',
  136. component: 'layout/Layout',
  137. redirect: 'noRedirect',
  138. name: 'ComponentDemo',
  139. meta: {
  140. title: 'Components',
  141. icon: 'component'
  142. },
  143. children: [
  144. {
  145. path: 'tinymce',
  146. component: 'views/components-demo/tinymce',
  147. name: 'TinymceDemo',
  148. meta: { title: 'Tinymce' }
  149. },
  150. {
  151. path: 'markdown',
  152. component: 'views/components-demo/markdown',
  153. name: 'MarkdownDemo',
  154. meta: { title: 'Markdown' }
  155. },
  156. {
  157. path: 'json-editor',
  158. component: 'views/components-demo/json-editor',
  159. name: 'JsonEditorDemo',
  160. meta: { title: 'Json Editor' }
  161. },
  162. {
  163. path: 'split-pane',
  164. component: 'views/components-demo/split-pane',
  165. name: 'SplitpaneDemo',
  166. meta: { title: 'SplitPane' }
  167. },
  168. {
  169. path: 'avatar-upload',
  170. component: 'views/components-demo/avatar-upload',
  171. name: 'AvatarUploadDemo',
  172. meta: { title: 'Avatar Upload' }
  173. },
  174. {
  175. path: 'dropzone',
  176. component: 'views/components-demo/dropzone',
  177. name: 'DropzoneDemo',
  178. meta: { title: 'Dropzone' }
  179. },
  180. {
  181. path: 'sticky',
  182. component: 'views/components-demo/sticky',
  183. name: 'StickyDemo',
  184. meta: { title: 'Sticky' }
  185. },
  186. {
  187. path: 'count-to',
  188. component: 'views/components-demo/count-to',
  189. name: 'CountToDemo',
  190. meta: { title: 'Count To' }
  191. },
  192. {
  193. path: 'mixin',
  194. component: 'views/components-demo/mixin',
  195. name: 'ComponentMixinDemo',
  196. meta: { title: 'componentMixin' }
  197. },
  198. {
  199. path: 'back-to-top',
  200. component: 'views/components-demo/back-to-top',
  201. name: 'BackToTopDemo',
  202. meta: { title: 'Back To Top' }
  203. },
  204. {
  205. path: 'drag-dialog',
  206. component: 'views/components-demo/drag-dialog',
  207. name: 'DragDialogDemo',
  208. meta: { title: 'Drag Dialog' }
  209. },
  210. {
  211. path: 'drag-select',
  212. component: 'views/components-demo/drag-select',
  213. name: 'DragSelectDemo',
  214. meta: { title: 'Drag Select' }
  215. },
  216. {
  217. path: 'dnd-list',
  218. component: 'views/components-demo/dnd-list',
  219. name: 'DndListDemo',
  220. meta: { title: 'Dnd List' }
  221. },
  222. {
  223. path: 'drag-kanban',
  224. component: 'views/components-demo/drag-kanban',
  225. name: 'DragKanbanDemo',
  226. meta: { title: 'Drag Kanban' }
  227. }
  228. ]
  229. },
  230. {
  231. path: '/charts',
  232. component: 'layout/Layout',
  233. redirect: 'noRedirect',
  234. name: 'Charts',
  235. meta: {
  236. title: 'Charts',
  237. icon: 'chart'
  238. },
  239. children: [
  240. {
  241. path: 'keyboard',
  242. component: 'views/charts/keyboard',
  243. name: 'KeyboardChart',
  244. meta: { title: 'Keyboard Chart', noCache: true }
  245. },
  246. {
  247. path: 'line',
  248. component: 'views/charts/line',
  249. name: 'LineChart',
  250. meta: { title: 'Line Chart', noCache: true }
  251. },
  252. {
  253. path: 'mixchart',
  254. component: 'views/charts/mixChart',
  255. name: 'MixChart',
  256. meta: { title: 'Mix Chart', noCache: true }
  257. }
  258. ]
  259. },
  260. {
  261. path: '/nested',
  262. component: 'layout/Layout',
  263. redirect: '/nested/menu1/menu1-1',
  264. name: 'Nested',
  265. meta: {
  266. title: 'Nested',
  267. icon: 'nested'
  268. },
  269. children: [
  270. {
  271. path: 'menu1',
  272. component: 'views/nested/menu1/index',
  273. name: 'Menu1',
  274. meta: { title: 'Menu1' },
  275. redirect: '/nested/menu1/menu1-1',
  276. children: [
  277. {
  278. path: 'menu1-1',
  279. component: 'views/nested/menu1/menu1-1',
  280. name: 'Menu1-1',
  281. meta: { title: 'Menu1-1' }
  282. },
  283. {
  284. path: 'menu1-2',
  285. component: 'views/nested/menu1/menu1-2',
  286. name: 'Menu1-2',
  287. redirect: '/nested/menu1/menu1-2/menu1-2-1',
  288. meta: { title: 'Menu1-2' },
  289. children: [
  290. {
  291. path: 'menu1-2-1',
  292. component: 'views/nested/menu1/menu1-2/menu1-2-1',
  293. name: 'Menu1-2-1',
  294. meta: { title: 'Menu1-2-1' }
  295. },
  296. {
  297. path: 'menu1-2-2',
  298. component: 'views/nested/menu1/menu1-2/menu1-2-2',
  299. name: 'Menu1-2-2',
  300. meta: { title: 'Menu1-2-2' }
  301. }
  302. ]
  303. },
  304. {
  305. path: 'menu1-3',
  306. component: 'views/nested/menu1/menu1-3',
  307. name: 'Menu1-3',
  308. meta: { title: 'Menu1-3' }
  309. }
  310. ]
  311. },
  312. {
  313. path: 'menu2',
  314. name: 'Menu2',
  315. component: 'views/nested/menu2/index',
  316. meta: { title: 'Menu2' }
  317. }
  318. ]
  319. },
  320. {
  321. path: '/example',
  322. component: 'layout/Layout',
  323. redirect: '/example/list',
  324. name: 'Example',
  325. meta: {
  326. title: 'Example',
  327. icon: 'example'
  328. },
  329. children: [
  330. {
  331. path: 'create',
  332. component: 'views/example/create',
  333. name: 'CreateArticle',
  334. meta: { title: 'Create Article', icon: 'edit' }
  335. },
  336. {
  337. path: 'edit/:id(\\d+)',
  338. component: 'views/example/edit',
  339. name: 'EditArticle',
  340. meta: { title: 'Edit Article', noCache: true },
  341. hidden: true
  342. },
  343. {
  344. path: 'list',
  345. component: 'views/example/list',
  346. name: 'ArticleList',
  347. meta: { title: 'Article List', icon: 'list' }
  348. }
  349. ]
  350. },
  351. {
  352. path: '/tab',
  353. component: 'layout/Layout',
  354. children: [
  355. {
  356. path: 'index',
  357. component: 'views/tab/index',
  358. name: 'Tab',
  359. meta: { title: 'Tab', icon: 'tab' }
  360. }
  361. ]
  362. },
  363. {
  364. path: '/error',
  365. component: 'layout/Layout',
  366. redirect: 'noRedirect',
  367. name: 'ErrorPages',
  368. meta: {
  369. title: 'Error Pages',
  370. icon: '404'
  371. },
  372. children: [
  373. {
  374. path: '401',
  375. component: 'views/error-page/401',
  376. name: 'Page401',
  377. meta: { title: 'Page 401', noCache: true }
  378. },
  379. {
  380. path: '404',
  381. component: 'views/error-page/404',
  382. name: 'Page404',
  383. meta: { title: 'Page 404', noCache: true }
  384. }
  385. ]
  386. },
  387. {
  388. path: '/error-log',
  389. component: 'layout/Layout',
  390. redirect: 'noRedirect',
  391. children: [
  392. {
  393. path: 'log',
  394. component: 'views/error-log/index',
  395. name: 'ErrorLog',
  396. meta: { title: 'Error Log', icon: 'bug' }
  397. }
  398. ]
  399. },
  400. {
  401. path: '/excel',
  402. component: 'layout/Layout',
  403. redirect: '/excel/export-excel',
  404. name: 'Excel',
  405. meta: {
  406. title: 'Excel',
  407. icon: 'excel'
  408. },
  409. children: [
  410. {
  411. path: 'export-excel',
  412. component: 'views/excel/export-excel',
  413. name: 'ExportExcel',
  414. meta: { title: 'Export Excel' }
  415. },
  416. {
  417. path: 'export-selected-excel',
  418. component: 'views/excel/select-excel',
  419. name: 'SelectExcel',
  420. meta: { title: 'Select Excel' }
  421. },
  422. {
  423. path: 'export-merge-header',
  424. component: 'views/excel/merge-header',
  425. name: 'MergeHeader',
  426. meta: { title: 'Merge Header' }
  427. },
  428. {
  429. path: 'upload-excel',
  430. component: 'views/excel/upload-excel',
  431. name: 'UploadExcel',
  432. meta: { title: 'Upload Excel' }
  433. }
  434. ]
  435. },
  436. {
  437. path: '/zip',
  438. component: 'layout/Layout',
  439. redirect: '/zip/download',
  440. alwaysShow: true,
  441. meta: { title: 'Zip', icon: 'zip' },
  442. children: [
  443. {
  444. path: 'download',
  445. component: 'views/zip/index',
  446. name: 'ExportZip',
  447. meta: { title: 'Export Zip' }
  448. }
  449. ]
  450. },
  451. {
  452. path: '/pdf',
  453. component: 'layout/Layout',
  454. redirect: '/pdf/index',
  455. children: [
  456. {
  457. path: 'index',
  458. component: 'views/pdf/index',
  459. name: 'PDF',
  460. meta: { title: 'PDF', icon: 'pdf' }
  461. }
  462. ]
  463. },
  464. {
  465. path: '/pdf/download',
  466. component: 'views/pdf/download',
  467. hidden: true
  468. },
  469. {
  470. path: '/theme',
  471. component: 'layout/Layout',
  472. redirect: 'noRedirect',
  473. children: [
  474. {
  475. path: 'index',
  476. component: 'views/theme/index',
  477. name: 'Theme',
  478. meta: { title: 'Theme', icon: 'theme' }
  479. }
  480. ]
  481. },
  482. {
  483. path: '/clipboard',
  484. component: 'layout/Layout',
  485. redirect: 'noRedirect',
  486. children: [
  487. {
  488. path: 'index',
  489. component: 'views/clipboard/index',
  490. name: 'ClipboardDemo',
  491. meta: { title: 'Clipboard Demo', icon: 'clipboard' }
  492. }
  493. ]
  494. },
  495. {
  496. path: '/i18n',
  497. component: 'layout/Layout',
  498. children: [
  499. {
  500. path: 'index',
  501. component: 'views/i18n-demo/index',
  502. name: 'I18n',
  503. meta: { title: 'I18n', icon: 'international' }
  504. }
  505. ]
  506. },
  507. {
  508. path: 'external-link',
  509. component: 'layout/Layout',
  510. children: [
  511. {
  512. path: 'https://github.com/PanJiaChen/vue-element-admin',
  513. meta: { title: 'External Link', icon: 'link' }
  514. }
  515. ]
  516. },
  517. { path: '*', redirect: '/404', hidden: true }
  518. ]