router.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833
  1. /**
  2. * @description router全局配置,如有必要可分文件抽离,其中asyncRoutes只有在intelligence模式下才会用到,pro版只支持remixIcon图标,具体配置请查看vip群文档
  3. */
  4. const List = [
  5. {
  6. path: '/',
  7. name: 'Root',
  8. component: 'Layout',
  9. meta: {
  10. title: '首页',
  11. icon: 'home-2-line',
  12. breadcrumbHidden: true,
  13. },
  14. children: [
  15. {
  16. path: 'index',
  17. name: 'Index',
  18. component: '@/views/index',
  19. meta: {
  20. title: '首页',
  21. icon: 'home-2-line',
  22. noClosable: true,
  23. },
  24. },
  25. {
  26. path: 'workbench',
  27. name: 'Workbench',
  28. component: '@/views/index/workbench',
  29. meta: {
  30. title: '工作台',
  31. icon: 'settings-6-line',
  32. dot: true,
  33. },
  34. },
  35. ],
  36. },
  37. {
  38. path: '/vab',
  39. name: 'Vab',
  40. component: 'Layout',
  41. meta: {
  42. title: '组件',
  43. icon: 'code-box-line',
  44. },
  45. children: [
  46. {
  47. path: 'icon',
  48. name: 'Icon',
  49. meta: {
  50. title: '图标',
  51. icon: 'remixicon-line',
  52. },
  53. children: [
  54. {
  55. path: 'remixIcon',
  56. name: 'RemixIcon',
  57. component: '@/views/vab/icon/remixIcon',
  58. meta: {
  59. title: '小清新图标',
  60. },
  61. },
  62. {
  63. path: 'iconSelector',
  64. name: 'IconSelector',
  65. component: '@/views/vab/icon/iconSelector',
  66. meta: {
  67. title: '图标选择器',
  68. },
  69. },
  70. ],
  71. },
  72. {
  73. path: 'permission',
  74. name: 'Permission',
  75. component: '@/views/vab/permission',
  76. meta: {
  77. title: '角色权限',
  78. icon: 'user-3-line',
  79. badge: 'Pro',
  80. },
  81. },
  82. {
  83. path: 'table',
  84. name: 'Table',
  85. meta: {
  86. title: '表格',
  87. guard: {
  88. role: ['Editor'],
  89. mode: 'except',
  90. },
  91. icon: 'table-2',
  92. },
  93. children: [
  94. {
  95. path: 'comprehensiveTable',
  96. name: 'ComprehensiveTable',
  97. component: '@/views/vab/table/comprehensiveTable',
  98. meta: {
  99. title: '综合表格',
  100. },
  101. },
  102. {
  103. path: 'detail',
  104. name: 'Detail',
  105. component: '@/views/vab/table/detail',
  106. meta: {
  107. hidden: true,
  108. title: '详情页',
  109. activeMenu: '/vab/table/comprehensiveTable',
  110. dynamicNewTab: true,
  111. },
  112. },
  113. {
  114. path: 'inlineEditTable',
  115. name: 'InlineEditTable',
  116. component: '@/views/vab/table/inlineEditTable',
  117. meta: {
  118. title: '行内编辑表格',
  119. noKeepAlive: true,
  120. },
  121. },
  122. {
  123. path: 'customTable',
  124. name: 'CustomTable',
  125. component: '@/views/vab/table/customTable',
  126. meta: {
  127. title: '自定义表格',
  128. },
  129. },
  130. ],
  131. },
  132. {
  133. path: 'card',
  134. name: 'Card',
  135. component: '@/views/vab/card',
  136. meta: {
  137. title: '卡片',
  138. guard: ['Admin'],
  139. icon: 'inbox-line',
  140. },
  141. },
  142. {
  143. path: 'list',
  144. name: 'List',
  145. component: '@/views/vab/list',
  146. meta: {
  147. title: '列表',
  148. guard: ['Admin'],
  149. icon: 'list-check-2',
  150. },
  151. },
  152. {
  153. path: 'form',
  154. name: 'Form',
  155. meta: {
  156. title: '表单',
  157. guard: ['Admin'],
  158. icon: 'file-list-2-line',
  159. },
  160. children: [
  161. {
  162. path: 'comprehensiveForm',
  163. name: 'ComprehensiveForm',
  164. component: '@/views/vab/form/comprehensiveForm',
  165. meta: {
  166. title: '综合表单',
  167. },
  168. },
  169. {
  170. path: 'stepForm',
  171. name: 'StepForm',
  172. component: '@/views/vab/form/stepForm',
  173. meta: {
  174. title: '分步表单',
  175. },
  176. },
  177. {
  178. path: 'button',
  179. name: 'Button',
  180. component: '@/views/vab/form/button',
  181. meta: {
  182. title: '按钮',
  183. },
  184. },
  185. {
  186. path: 'link',
  187. name: 'Link',
  188. component: '@/views/vab/form/link',
  189. meta: {
  190. title: '文字链接',
  191. },
  192. },
  193. {
  194. path: 'radio',
  195. name: 'Radio',
  196. component: '@/views/vab/form/radio',
  197. meta: {
  198. title: '单选框',
  199. },
  200. },
  201. {
  202. path: 'checkbox',
  203. name: 'Checkbox',
  204. component: '@/views/vab/form/checkbox',
  205. meta: {
  206. title: '多选框',
  207. },
  208. },
  209. {
  210. path: 'input',
  211. name: 'Input',
  212. component: '@/views/vab/form/input',
  213. meta: {
  214. title: '输入框',
  215. },
  216. },
  217. {
  218. path: 'inputNumber',
  219. name: 'InputNumber',
  220. component: '@/views/vab/form/inputNumber',
  221. meta: {
  222. title: '计数器',
  223. },
  224. },
  225. {
  226. path: 'select',
  227. name: 'Select',
  228. component: '@/views/vab/form/select',
  229. meta: {
  230. title: '选择器',
  231. },
  232. },
  233. {
  234. path: 'switch',
  235. name: 'Switch',
  236. component: '@/views/vab/form/switch',
  237. meta: {
  238. title: '开关',
  239. },
  240. },
  241. {
  242. path: 'slider',
  243. name: 'Slider',
  244. component: '@/views/vab/form/slider',
  245. meta: {
  246. title: '滑块',
  247. },
  248. },
  249. {
  250. path: 'timePicker',
  251. name: 'TimePicker',
  252. component: '@/views/vab/form/timePicker',
  253. meta: {
  254. title: '时间选择器',
  255. },
  256. },
  257. {
  258. path: 'datePicker',
  259. name: 'DatePicker',
  260. component: '@/views/vab/form/datePicker',
  261. meta: {
  262. title: '日期选择器',
  263. },
  264. },
  265. {
  266. path: 'dateTimePicker',
  267. name: 'DateTimePicker',
  268. component: '@/views/vab/form/dateTimePicker',
  269. meta: {
  270. title: '日期时间选择器',
  271. },
  272. },
  273. {
  274. path: 'rate',
  275. name: 'Rate',
  276. component: '@/views/vab/form/rate',
  277. meta: {
  278. title: '评分',
  279. },
  280. },
  281. ],
  282. },
  283. {
  284. path: 'editor',
  285. name: 'Editor',
  286. meta: {
  287. title: '编辑器',
  288. guard: ['Admin'],
  289. icon: 'edit-2-line',
  290. },
  291. children: [
  292. {
  293. path: 'richTextEditor',
  294. name: 'RichTextEditor',
  295. component: '@/views/vab/editor/richTextEditor',
  296. meta: {
  297. title: '富文本编辑器',
  298. guard: ['Admin'],
  299. },
  300. },
  301. {
  302. path: 'markdownEditor',
  303. name: 'MarkdownEditor',
  304. component: '@/views/vab/editor/markdownEditor',
  305. meta: {
  306. title: 'Markdown编辑器',
  307. guard: ['Admin'],
  308. },
  309. },
  310. ],
  311. },
  312. ],
  313. },
  314. {
  315. path: '/other',
  316. name: 'Other',
  317. component: 'Layout',
  318. meta: {
  319. title: '其他',
  320. icon: 'archive-line',
  321. guard: ['Admin'],
  322. },
  323. children: [
  324. {
  325. path: 'workflow',
  326. name: 'Workflow',
  327. component: '@/views/other/workflow',
  328. meta: {
  329. title: '工作流',
  330. guard: ['Admin'],
  331. icon: 'flow-chart',
  332. },
  333. },
  334. {
  335. path: 'echarts',
  336. name: 'Echarts',
  337. component: '@/views/other/echarts',
  338. meta: {
  339. title: '图表',
  340. guard: ['Admin'],
  341. icon: 'bubble-chart-line',
  342. },
  343. },
  344. {
  345. path: 'print',
  346. name: 'Print',
  347. component: '@/views/other/print',
  348. meta: {
  349. title: '打印',
  350. guard: ['Admin'],
  351. icon: 'printer-line',
  352. },
  353. },
  354. {
  355. path: 'cropper',
  356. name: 'Cropper',
  357. component: '@/views/other/cropper',
  358. meta: {
  359. title: '头像裁剪',
  360. guard: ['Admin'],
  361. icon: 'crop-line',
  362. },
  363. },
  364. {
  365. path: 'notice',
  366. name: 'Notice',
  367. component: '@/views/other/notice',
  368. meta: {
  369. title: '通知',
  370. guard: ['Admin'],
  371. icon: 'message-2-line',
  372. },
  373. },
  374. {
  375. path: 'timeline',
  376. name: 'Timeline',
  377. component: '@/views/other/timeline',
  378. meta: {
  379. title: '时间线',
  380. guard: ['Admin'],
  381. icon: 'time-line',
  382. },
  383. },
  384. {
  385. path: 'count',
  386. name: 'Count',
  387. component: '@/views/other/count',
  388. meta: {
  389. title: '数字自增长',
  390. guard: ['Admin'],
  391. icon: 'number-9',
  392. },
  393. },
  394. {
  395. path: 'tabs',
  396. name: 'Tabs',
  397. component: '@/views/other/tabs',
  398. meta: {
  399. title: '多标签',
  400. guard: ['Admin'],
  401. icon: 'bank-card-line',
  402. },
  403. },
  404. {
  405. path: 'dynamicMeta',
  406. name: 'DynamicMeta',
  407. component: '@/views/other/dynamicMeta',
  408. meta: {
  409. title: '动态Meta',
  410. guard: ['Admin'],
  411. icon: 'notification-badge-line',
  412. badge: '0',
  413. },
  414. },
  415. {
  416. path: 'dynamicSegment',
  417. name: 'DynamicSegment',
  418. redirect: '/other/dynamicSegment/test1/1',
  419. meta: {
  420. title: '动态路径参数',
  421. guard: ['Admin'],
  422. icon: 'arrow-left-right-line',
  423. },
  424. children: [
  425. {
  426. path: 'test1/:id',
  427. name: 'Test1',
  428. component: '@/views/other/dynamicSegment/test1',
  429. meta: {
  430. hidden: true,
  431. title: 'Params',
  432. dynamicNewTab: true,
  433. },
  434. },
  435. {
  436. path: 'test1/1',
  437. name: 'test1/1',
  438. component: '@/views/other/dynamicSegment/test1',
  439. meta: { title: 'Params id=1' },
  440. },
  441. {
  442. path: 'test2',
  443. name: 'Test2',
  444. component: '@/views/other/dynamicSegment/test2',
  445. meta: {
  446. hidden: true,
  447. title: 'Query',
  448. dynamicNewTab: true,
  449. },
  450. },
  451. {
  452. path: 'test2?id=1',
  453. name: 'test2?id=1',
  454. component: '@/views/other/dynamicSegment/test2',
  455. meta: { title: 'Query id=1' },
  456. },
  457. ],
  458. },
  459. {
  460. path: 'drag',
  461. name: 'Drag',
  462. meta: {
  463. title: '拖拽',
  464. guard: ['Admin'],
  465. icon: 'drag-drop-line',
  466. },
  467. children: [
  468. {
  469. path: 'dialogDrag',
  470. name: 'DialogDrag',
  471. component: '@/views/other/drag/dialogDrag',
  472. meta: {
  473. title: '弹窗拖拽',
  474. },
  475. },
  476. {
  477. path: 'cardDrag',
  478. name: 'CardDrag',
  479. component: '@/views/other/drag/cardDrag',
  480. meta: {
  481. title: '卡片拖拽',
  482. },
  483. },
  484. {
  485. path: 'flowSheetDrag',
  486. name: 'FlowSheetDrag',
  487. component: '@/views/other/drag/flowSheetDrag',
  488. meta: {
  489. title: '流程图拖拽',
  490. noKeepAlive: true,
  491. },
  492. },
  493. ],
  494. },
  495. {
  496. path: 'contextmenu',
  497. name: 'Contextmenu',
  498. component: '@/views/other/contextmenu',
  499. meta: {
  500. title: '右键菜单',
  501. guard: ['Admin'],
  502. icon: 'menu-2-fill',
  503. },
  504. },
  505. {
  506. path: 'loading',
  507. name: 'Loading',
  508. component: '@/views/other/loading',
  509. meta: {
  510. title: '加载',
  511. guard: ['Admin'],
  512. icon: 'loader-line',
  513. },
  514. },
  515. {
  516. path: 'player',
  517. name: 'Player',
  518. component: '@/views/other/player',
  519. meta: {
  520. title: '视频播放器',
  521. guard: ['Admin'],
  522. icon: 'video-line',
  523. noKeepAlive: true,
  524. },
  525. },
  526. {
  527. path: 'upload',
  528. name: 'Upload',
  529. component: '@/views/other/upload',
  530. meta: {
  531. title: '上传',
  532. guard: ['Admin'],
  533. icon: 'chat-upload-line',
  534. },
  535. },
  536. {
  537. path: 'menu1',
  538. name: 'Menu1',
  539. meta: {
  540. title: '多级路由缓存',
  541. guard: ['Admin'],
  542. icon: 'route-line',
  543. },
  544. children: [
  545. {
  546. path: 'menu1-1',
  547. name: 'Menu11',
  548. meta: {
  549. title: '多级路由1-1',
  550. },
  551. children: [
  552. {
  553. path: 'menu1-1-1',
  554. name: 'Menu111',
  555. meta: {
  556. title: '多级路由1-1-1',
  557. },
  558. children: [
  559. {
  560. path: 'menu1-1-1-1',
  561. name: 'Menu1111',
  562. meta: {
  563. title: '多级路由1-1-1-1',
  564. },
  565. component:
  566. '@/views/other/nested/menu1/menu1-1/menu1-1-1/menu1-1-1-1',
  567. },
  568. ],
  569. },
  570. ],
  571. },
  572. ],
  573. },
  574. {
  575. path: 'log',
  576. name: 'Log',
  577. component: '@/views/other/errorLog',
  578. meta: {
  579. title: '错误日志模拟',
  580. guard: ['Admin'],
  581. icon: 'error-warning-line',
  582. },
  583. },
  584. {
  585. path: 'cssfx',
  586. name: 'Cssfx',
  587. component: '@/views/other/cssfx',
  588. meta: {
  589. title: 'Css动画',
  590. guard: ['Admin'],
  591. icon: 'css3-line',
  592. },
  593. },
  594. {
  595. path: 'social',
  596. name: 'Social',
  597. component: '@/views/other/social',
  598. meta: {
  599. title: '第三方登录',
  600. guard: ['Admin'],
  601. icon: 'github-fill',
  602. },
  603. },
  604. {
  605. path: '//github.com/chuzhixin/vue-admin-beautiful?utm_source=gold_browser_extension',
  606. name: 'ExternalLink',
  607. meta: {
  608. title: '外链',
  609. target: '_blank',
  610. guard: {
  611. role: ['Admin', 'Editor'],
  612. mode: 'oneOf',
  613. },
  614. icon: 'external-link-line',
  615. },
  616. },
  617. {
  618. path: 'iframe',
  619. name: 'Iframe',
  620. redirect: '/other/iframe/search',
  621. meta: {
  622. title: 'Iframe',
  623. guard: ['Admin'],
  624. icon: 'window-line',
  625. },
  626. children: [
  627. {
  628. path: 'view',
  629. name: 'IframeView',
  630. component: '@/views/other/iframe/view',
  631. meta: {
  632. hidden: true,
  633. title: 'Iframe',
  634. icon: 'window-line',
  635. dynamicNewTab: true,
  636. },
  637. },
  638. {
  639. path: 'view?url=https%3A%2Fwww.baidu.com&title=%E7%99%BE%E5%BA%A6',
  640. name: 'baiduIframe',
  641. component: '@/views/other/iframe/view',
  642. meta: { title: '百度', icon: 'baidu-fill' },
  643. },
  644. {
  645. path: 'view?url=https%3A%2Fgitee.com%2Fchu1204505056%2Fvue-admin-beautiful&title=Gitee',
  646. name: 'githubIframe',
  647. component: '@/views/other/iframe/view',
  648. meta: { title: 'Gitee', icon: 'github-fill' },
  649. },
  650. {
  651. path: 'search',
  652. name: 'IframeSearch',
  653. component: '@/views/other/iframe/search',
  654. meta: {
  655. title: '自定义Iframe',
  656. icon: 'search-2-line',
  657. },
  658. },
  659. ],
  660. },
  661. {
  662. path: 'excel',
  663. name: 'Excel',
  664. meta: {
  665. title: 'Excel',
  666. guard: ['Admin'],
  667. icon: 'file-excel-2-line',
  668. },
  669. children: [
  670. {
  671. path: 'exportExcel',
  672. name: 'ExportExcel',
  673. component: '@/views/other/excel/exportExcel',
  674. meta: {
  675. title: '导出Excel',
  676. },
  677. },
  678. {
  679. path: 'exportSelectedExcel',
  680. name: 'SelectExcel',
  681. component: '@/views/other/excel/exportSelectExcel',
  682. meta: {
  683. title: '导出选中行Excel',
  684. },
  685. },
  686. {
  687. path: 'exportMergeHeaderExcel',
  688. name: 'MergeHeaderExcel',
  689. component: '@/views/other/excel/exportMergeHeaderExcel',
  690. meta: {
  691. title: '导出合并Excel',
  692. },
  693. },
  694. ],
  695. },
  696. ],
  697. },
  698. {
  699. path: '/mall',
  700. name: 'Mall',
  701. component: 'Layout',
  702. meta: {
  703. title: '物料源',
  704. icon: 'apps-line',
  705. levelHidden: true,
  706. guard: ['Admin'],
  707. },
  708. children: [
  709. {
  710. path: 'goods',
  711. name: 'Goods',
  712. component: '@/views/mall/goods',
  713. meta: {
  714. title: '物料市场',
  715. icon: 'shopping-cart-line',
  716. badge: 'Hot',
  717. },
  718. },
  719. ],
  720. },
  721. {
  722. path: '/setting',
  723. name: 'PersonnelManagement',
  724. component: 'Layout',
  725. redirect: '/system/userManagement',
  726. meta: {
  727. title: '配置',
  728. icon: 'user-settings-line',
  729. roles: ['admin'],
  730. },
  731. children: [
  732. {
  733. path: 'personalCenter',
  734. name: 'PersonalCenter',
  735. component: '@/views/setting/personalCenter',
  736. meta: {
  737. title: '个人中心',
  738. icon: 'map-pin-user-line',
  739. },
  740. },
  741. {
  742. path: 'userManagement',
  743. name: 'UserManagement',
  744. component: '@/views/setting/userManagement',
  745. meta: {
  746. title: '用户管理',
  747. icon: 'user-3-line',
  748. },
  749. },
  750. {
  751. path: 'roleManagement',
  752. name: 'RoleManagement',
  753. component: '@/views/setting/roleManagement',
  754. meta: {
  755. title: '角色管理',
  756. icon: 'admin-line',
  757. },
  758. },
  759. {
  760. path: 'departmentManagement',
  761. name: 'DepartmentManagement',
  762. component: '@/views/setting/departmentManagement',
  763. meta: {
  764. title: '部门管理',
  765. icon: 'group-line',
  766. },
  767. },
  768. {
  769. path: 'menuManagement',
  770. name: 'MenuManagement',
  771. component: '@/views/setting/menuManagement',
  772. meta: {
  773. title: '菜单管理',
  774. icon: 'menu-2-fill',
  775. },
  776. },
  777. {
  778. path: 'systemLog',
  779. name: 'SystemLog',
  780. component: '@/views/setting/systemLog',
  781. meta: {
  782. title: '系统日志',
  783. icon: 'file-shield-2-line',
  784. },
  785. },
  786. ],
  787. },
  788. {
  789. path: '/error',
  790. name: 'Error',
  791. component: 'Layout',
  792. meta: {
  793. title: '错误页',
  794. icon: 'error-warning-line',
  795. levelHidden: true,
  796. },
  797. children: [
  798. {
  799. path: '403',
  800. name: 'Error403',
  801. component: '@/views/403',
  802. meta: {
  803. title: '403',
  804. icon: 'error-warning-line',
  805. },
  806. },
  807. {
  808. path: '404',
  809. name: 'Error404',
  810. component: '@/views/404',
  811. meta: {
  812. title: '404',
  813. icon: 'error-warning-line',
  814. },
  815. },
  816. ],
  817. },
  818. ]
  819. module.exports = [
  820. {
  821. url: '/router/getList',
  822. type: 'get',
  823. response() {
  824. return {
  825. code: 200,
  826. msg: 'success',
  827. data: { list: List },
  828. }
  829. },
  830. },
  831. ]