index.js 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /* Layout */
  5. import Layout from '@/layout'
  6. /* Router Modules */
  7. import componentsRouter from './modules/components'
  8. import chartsRouter from './modules/charts'
  9. import tableRouter from './modules/table'
  10. import nestedRouter from './modules/nested'
  11. import dangyunlong from './modules/dangyunlong'
  12. /**
  13. * Note: sub-menu only appear when route children.length >= 1
  14. * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  15. *
  16. * hidden: true if set true, item will not show in the sidebar(default is false)
  17. * alwaysShow: true if set true, will always show the root menu
  18. * if not set alwaysShow, when item has more than one children route,
  19. * it will becomes nested mode, otherwise not show the root menu
  20. * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
  21. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  22. * meta : {
  23. roles: ['admin','editor'] control the page roles (you can set multiple roles)
  24. title: 'title' the name show in sidebar and breadcrumb (recommend set)
  25. icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
  26. noCache: true if set true, the page will no be cached(default is false)
  27. affix: true if set true, the tag will affix in the tags-view
  28. breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
  29. activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
  30. }
  31. */
  32. /**
  33. * constantRoutes
  34. * a base page that does not have permission requirements
  35. * all roles can be accessed
  36. */
  37. export const constantRoutes = [
  38. ...dangyunlong,
  39. {
  40. path: '/redirect',
  41. component: Layout,
  42. hidden: true,
  43. children: [
  44. {
  45. path: '/redirect/:path(.*)',
  46. component: () => import('@/views/redirect/index')
  47. }
  48. ]
  49. },
  50. {
  51. path: '/login',
  52. component: () => import('@/views/login/index'),
  53. hidden: true
  54. },
  55. {
  56. path: '/auth-redirect',
  57. component: () => import('@/views/login/auth-redirect'),
  58. hidden: true
  59. },
  60. {
  61. path: '/404',
  62. component: () => import('@/views/error-page/404'),
  63. hidden: true
  64. },
  65. {
  66. path: '/401',
  67. component: () => import('@/views/error-page/401'),
  68. hidden: true
  69. },
  70. {
  71. path: '/',
  72. component: Layout,
  73. redirect: '/dashboard', //访问/的时候会跳转到dashboard
  74. children: [
  75. {
  76. path: 'dashboard',
  77. component: () => import('@/views/dashboard/index'),
  78. name: '首页',
  79. meta: {
  80. title: '首页',
  81. icon: require('@/assets/public/sidebar/default/index.png'),
  82. selected_icon: require('@/assets/public/sidebar/select/index.png'),
  83. affix: true,
  84. }
  85. }
  86. ]
  87. },
  88. //增加新的路由 站点列表
  89. //注意必须含有component:Layout项目否则会导致页面找不到模板
  90. //必须含有children中的path且两个path必须一致
  91. {
  92. path: '/website',
  93. component: Layout,
  94. children: [
  95. {
  96. name: '', //直接就是根目录所以为空
  97. path: '',
  98. component: () => import('@/views/website/WebsiteList'),
  99. meta: {
  100. title: '网站管理', // 设置菜单和面包屑显示的标题
  101. hidden: true, // 不在侧边菜单显示
  102. breadcrumb: true // 强制在面包屑中显示
  103. }
  104. }
  105. ]
  106. },
  107. {
  108. path: '/addWebsite',
  109. component: Layout,
  110. children: [
  111. {
  112. name: '', //直接就是根目录所以为空
  113. path: '',
  114. component: () => import('@/views/website/addWebsite'),
  115. meta: {
  116. title: '添加网站', // 设置菜单和面包屑显示的标题
  117. hidden: true, // 不在侧边菜单显示
  118. breadcrumb: true // 强制在面包屑中显示
  119. }
  120. }
  121. ]
  122. },
  123. {
  124. path: '/categoryList',
  125. component: Layout,
  126. children: [
  127. {
  128. name: '',
  129. path: '',
  130. component: () => import('@/views/website/categoryList'),
  131. meta: {
  132. title: '栏目名称',
  133. hidden: true,
  134. breadcrumb: true
  135. }
  136. }
  137. ]
  138. },
  139. {
  140. path: '/websiteColumn',
  141. component: Layout,
  142. children: [
  143. {
  144. name: '',
  145. path: '',
  146. component: () => import('@/views/website/websiteColumn'),
  147. meta: {
  148. title: '栏目分配',
  149. hidden: true,
  150. breadcrumb: true
  151. }
  152. }
  153. ]
  154. },
  155. {
  156. path: '/editNavigation',
  157. component: Layout,
  158. children: [
  159. {
  160. name: '',
  161. path: '',
  162. component: () => import('@/views/website/editNavigation'),
  163. meta: {
  164. title: '栏目详情',
  165. hidden: true,
  166. breadcrumb: true
  167. }
  168. }
  169. ]
  170. },
  171. {
  172. path: '/articleList',
  173. component: Layout,
  174. children: [
  175. {
  176. name: '',
  177. path: '',
  178. component: () => import('@/views/news/NewList'),
  179. meta: {
  180. title: '资讯列表',
  181. hidden: true,
  182. breadcrumb: true
  183. }
  184. }
  185. ]
  186. },
  187. {
  188. path: '/examine',
  189. component: Layout,
  190. children: [
  191. {
  192. name: '',
  193. path: '',
  194. component: () => import('@/views/news/examine'),
  195. meta: {
  196. title: '待审核列表',
  197. hidden: true,
  198. breadcrumb: true
  199. }
  200. }
  201. ]
  202. },
  203. {
  204. path: '/creatNews',
  205. component: Layout,
  206. children: [
  207. {
  208. name: '',
  209. path: '',
  210. component: () => import('@/views/news/creatNews'),
  211. meta: {
  212. title: '添加资讯',
  213. hidden: true,
  214. breadcrumb: true
  215. }
  216. }
  217. ]
  218. },
  219. {
  220. path: '/menuList',
  221. component: Layout,
  222. children: [
  223. {
  224. name: '',
  225. path: '',
  226. component: () => import('@/views/menu/menulist'),
  227. meta: {
  228. title: '菜单列表',
  229. hidden: true,
  230. breadcrumb: true
  231. }
  232. }
  233. ]
  234. },
  235. {
  236. path: '/complaintList',
  237. component: Layout,
  238. children: [
  239. {
  240. name: '',
  241. path: '',
  242. component: () => import('@/views/complaint/complaintList'),
  243. meta: {
  244. title: '投诉举报',
  245. hidden: true,
  246. breadcrumb: true
  247. }
  248. }
  249. ]
  250. },
  251. {
  252. path: '/roleList',
  253. component: Layout,
  254. children: [
  255. {
  256. name: '',
  257. path: '',
  258. component: () => import('@/views/role/roleList'),
  259. meta: {
  260. title: '角色管理',
  261. hidden: true,
  262. breadcrumb: true
  263. }
  264. }
  265. ]
  266. },
  267. {
  268. path: '/userList',
  269. component: Layout,
  270. children: [
  271. {
  272. name: '',
  273. path: '',
  274. component: () => import('@/views/role/userList'),
  275. meta: {
  276. title: '用户管理',
  277. hidden: true,
  278. breadcrumb: true
  279. }
  280. }
  281. ]
  282. },
  283. {
  284. path: '/creatUser',
  285. component: Layout,
  286. children: [
  287. {
  288. name: '',
  289. path: '',
  290. component: () => import('@/views/role/creatUser'),
  291. meta: {
  292. title: '添加用户',
  293. hidden: true,
  294. breadcrumb: true
  295. }
  296. }
  297. ]
  298. },
  299. {
  300. path: '/department',
  301. component: Layout,
  302. children: [
  303. {
  304. name: '',
  305. path: '',
  306. component: () => import('@/views/menu/department'),
  307. meta: {
  308. title: '行政职能',
  309. hidden: true,
  310. breadcrumb: true
  311. }
  312. }
  313. ]
  314. },
  315. {
  316. path: '/hall',
  317. component: Layout,
  318. children: [
  319. {
  320. name: '',
  321. path: '',
  322. component: () => import('@/views/chat/hall'),
  323. meta: {
  324. title: '聊天',
  325. hidden: true,
  326. breadcrumb: true
  327. }
  328. }
  329. ]
  330. },
  331. {
  332. path: '/creatWebsite',
  333. component: Layout,
  334. children: [
  335. {
  336. name: '',
  337. path: '',
  338. component: () => import('@/views/website/creatWebsite'),
  339. meta: {
  340. title: '搭建网站',
  341. hidden: true,
  342. breadcrumb: true
  343. }
  344. }
  345. ]
  346. },
  347. {
  348. path: '/contacts',
  349. component: Layout,
  350. children: [
  351. {
  352. name: '',
  353. path: '',
  354. component: () => import('@/views/chat/contacts'),
  355. meta: {
  356. title: '通讯录',
  357. hidden: true,
  358. breadcrumb: true
  359. }
  360. }
  361. ]
  362. },
  363. {
  364. path: '/webCrawler',
  365. component: Layout,
  366. children: [
  367. {
  368. name: '',
  369. path: '',
  370. component: () => import('@/views/crawler/webCrawler'),
  371. meta: {
  372. title: '建立网站',
  373. hidden: true,
  374. breadcrumb: true
  375. }
  376. }
  377. ]
  378. },
  379. // ----fr-课题分类
  380. {
  381. path: '/topicType',
  382. component: Layout,
  383. children: [
  384. {
  385. name: '',
  386. path: '',
  387. component: () => import('@/views/chat/topicType'),
  388. meta: {
  389. title: '课题分类',
  390. hidden: true,
  391. breadcrumb: true
  392. }
  393. }
  394. ]
  395. },
  396. {
  397. path: '/surveyList',
  398. component: Layout,
  399. children: [
  400. {
  401. name: '',
  402. path: '',
  403. component: () => import('@/views/news/surveyList'),
  404. meta: {
  405. title: '投票列表',
  406. hidden: true,
  407. breadcrumb: true
  408. }
  409. }
  410. ]
  411. },
  412. // -----------fr---------
  413. // ----------liuj------------
  414. {
  415. path: '/goodList',
  416. component: Layout,
  417. children: [
  418. {
  419. name: '',
  420. path: '',
  421. component: () => import('@/views/news/GoodList'),
  422. meta: {
  423. title: '商品列表',
  424. hidden: true,
  425. breadcrumb: true
  426. }
  427. }
  428. ]
  429. },
  430. {
  431. path: '/goodListApply',
  432. component: Layout,
  433. children: [
  434. {
  435. name: '',
  436. path: '',
  437. component: () => import('@/views/news/GoodListApply'),
  438. meta: {
  439. title: '商品待审核列表',
  440. hidden: true,
  441. breadcrumb: true
  442. }
  443. }
  444. ]
  445. },
  446. {
  447. path: '/addGood',
  448. component: Layout,
  449. children: [
  450. {
  451. name: '',
  452. path: '',
  453. component: () => import('@/views/news/addGood'),
  454. meta: {
  455. title: '添加商品',
  456. hidden: true,
  457. breadcrumb: true
  458. }
  459. }
  460. ]
  461. },
  462. {
  463. path: '/jobHuntingList',
  464. component: Layout,
  465. children: [
  466. {
  467. name: '',
  468. path: '',
  469. component: () => import('@/views/news/jobHuntingList'),
  470. meta: {
  471. title: '求职信息',
  472. hidden: true,
  473. breadcrumb: true
  474. }
  475. }
  476. ]
  477. },
  478. {
  479. path: '/jobHuntingListApply',
  480. component: Layout,
  481. children: [
  482. {
  483. name: '',
  484. path: '',
  485. component: () => import('@/views/news/jobHuntingListApply'),
  486. meta: {
  487. title: '求职信息',
  488. hidden: true,
  489. breadcrumb: true
  490. }
  491. }
  492. ]
  493. },
  494. {
  495. path: '/addJobHunting',
  496. component: Layout,
  497. children: [
  498. {
  499. name: '',
  500. path: '',
  501. component: () => import('@/views/news/addJobHunting'),
  502. meta: {
  503. title: '添加求职',
  504. hidden: true,
  505. breadcrumb: true
  506. }
  507. }
  508. ]
  509. },
  510. {
  511. path: '/addNotice',
  512. component: Layout,
  513. children: [
  514. {
  515. name: '',
  516. path: '',
  517. component: () => import('@/views/news/addNotice'),
  518. meta: {
  519. title: '添加通知',
  520. hidden: true,
  521. breadcrumb: true
  522. }
  523. }
  524. ]
  525. },
  526. {
  527. path: '/noticeList',
  528. component: Layout,
  529. children: [
  530. {
  531. name: '',
  532. path: '',
  533. component: () => import('@/views/news/noticeList'),
  534. meta: {
  535. title: '行政通知列表',
  536. hidden: true,
  537. breadcrumb: true
  538. }
  539. }
  540. ]
  541. },
  542. {
  543. path: '/noticeListApply',
  544. component: Layout,
  545. children: [
  546. {
  547. name: '',
  548. path: '',
  549. component: () => import('@/views/news/noticeListApply'),
  550. meta: {
  551. title: '行政通知审核列表',
  552. hidden: true,
  553. breadcrumb: true
  554. }
  555. }
  556. ]
  557. },
  558. {
  559. path: '/ncomplaintList',
  560. component: Layout,
  561. children: [
  562. {
  563. name: '',
  564. path: '',
  565. component: () => import('@/views/news/ncomplaintList'),
  566. meta: {
  567. title: '投诉举报',
  568. hidden: true,
  569. breadcrumb: true
  570. }
  571. }
  572. ]
  573. },
  574. {
  575. path: '/ncomplaintListApply',
  576. component: Layout,
  577. children: [
  578. {
  579. name: '',
  580. path: '',
  581. component: () => import('@/views/news/ncomplaintListApply'),
  582. meta: {
  583. title: '投诉举报',
  584. hidden: true,
  585. breadcrumb: true
  586. }
  587. }
  588. ]
  589. },
  590. {
  591. path: '/addNcomplaint',
  592. component: Layout,
  593. children: [
  594. {
  595. name: '',
  596. path: '',
  597. component: () => import('@/views/news/addNcomplaint'),
  598. meta: {
  599. title: '添加投诉举报',
  600. hidden: true,
  601. breadcrumb: true
  602. }
  603. }
  604. ]
  605. },
  606. // ----------liuj------------
  607. {
  608. path: '/topic',
  609. component: Layout,
  610. children: [
  611. {
  612. name: '',
  613. path: '',
  614. component: () => import('@/views/chat/topic'),
  615. meta: {
  616. title: '课题',
  617. hidden: true,
  618. breadcrumb: true
  619. }
  620. }
  621. ]
  622. },
  623. {
  624. path: '/webRule',
  625. component: Layout,
  626. children: [
  627. {
  628. name: '',
  629. path: '',
  630. component: () => import('@/views/crawler/webRule'),
  631. meta: {
  632. title: '规则列表',
  633. hidden: true,
  634. breadcrumb: true
  635. }
  636. }
  637. ]
  638. },
  639. {
  640. path: '/creatTopic',
  641. component: Layout,
  642. children: [
  643. {
  644. name: '',
  645. path: '',
  646. component: () => import('@/views/chat/creatTopic'),
  647. meta: {
  648. title: '编辑课题',
  649. hidden: true,
  650. breadcrumb: true
  651. }
  652. }
  653. ]
  654. },
  655. {
  656. path: '/webCrawlerList',
  657. component: Layout,
  658. children: [
  659. {
  660. name: '',
  661. path: '',
  662. component: () => import('@/views/crawler/webCrawlerList'),
  663. meta: {
  664. title: '采集列表',
  665. hidden: true,
  666. breadcrumb: true
  667. }
  668. }
  669. ]
  670. },
  671. {
  672. path: '/webCrawlerListEdit',
  673. component: Layout,
  674. children: [
  675. {
  676. name: '',
  677. path: '',
  678. component: () => import('@/views/crawler/webCrawlerListEdit'),
  679. meta: {
  680. title: '编辑资讯',
  681. hidden: true,
  682. breadcrumb: true
  683. }
  684. }
  685. ]
  686. },
  687. {
  688. path: '/adList',
  689. component: Layout,
  690. children: [
  691. {
  692. name: '',
  693. path: '',
  694. component: () => import('@/views/advertise/advertiseList.vue'),
  695. meta: {
  696. title: '广告列表',
  697. hidden: true,
  698. breadcrumb: true
  699. }
  700. }
  701. ]
  702. },
  703. {
  704. path: '/adPlaceList',
  705. component: Layout,
  706. children: [
  707. {
  708. name: '',
  709. path: '',
  710. component: () => import('@/views/advertise/adPlaceList'),
  711. meta: {
  712. title: '广告位管理',
  713. hidden: true,
  714. breadcrumb: true
  715. }
  716. }
  717. ]
  718. },
  719. {//站点标识
  720. path: '/websiteTag',
  721. component: Layout,
  722. children: [
  723. {
  724. name: '',
  725. path: '',
  726. component: () => import('@/views/website/websiteTag'),
  727. meta: {
  728. title: '网站分组',
  729. hidden: true,
  730. breadcrumb: true
  731. }
  732. }
  733. ]
  734. },
  735. {
  736. path: '/adPlaceDetail',
  737. component: Layout,
  738. children: [
  739. {
  740. name: '',
  741. path: '',
  742. component: () => import('@/views/advertise/adPlaceDetail'),
  743. meta: {
  744. title: '广告位详情',
  745. hidden: true,
  746. breadcrumb: true
  747. }
  748. }
  749. ]
  750. },
  751. {
  752. path: '/blogroll',
  753. component: Layout,
  754. children: [
  755. {
  756. name: '',
  757. path: '',
  758. component: () => import('@/views/website/blogroll.vue'),
  759. meta: {
  760. title: '友情链接',
  761. hidden: true,
  762. breadcrumb: true
  763. }
  764. }
  765. ]
  766. },
  767. {
  768. path: '/blackWordList',
  769. component: Layout,
  770. children: [
  771. {
  772. name: '',
  773. path: '',
  774. component: () => import('@/views/website/blackWordList.vue'),
  775. meta: {
  776. title: '违禁词',
  777. hidden: true,
  778. breadcrumb: true
  779. }
  780. }
  781. ]
  782. },
  783. {
  784. path: '/tabbar',
  785. component: Layout,
  786. children: [
  787. {
  788. name: '',
  789. path: '',
  790. component: () => import('@/views/tabbar/tabbar.vue'),
  791. meta: {
  792. title: '单页',
  793. hidden: true,
  794. breadcrumb: true
  795. }
  796. }
  797. ]
  798. },
  799. {
  800. path: '/tabbarDetail',
  801. component: Layout,
  802. children: [
  803. {
  804. name: '',
  805. path: '',
  806. component: () => import('@/views/tabbar/tabbarDetail.vue'),
  807. meta: {
  808. title: '单页详情',
  809. hidden: true,
  810. breadcrumb: true
  811. }
  812. }
  813. ]
  814. },
  815. // {
  816. // path: '/documentation',
  817. // component: Layout,
  818. // children: [
  819. // {
  820. // path: 'index',
  821. // component: () => import('@/views/documentation/index'),
  822. // name: 'Documentation',
  823. // meta: { title: 'documentation', icon: 'documentation', affix: true }
  824. // }
  825. // ]
  826. // },
  827. // {
  828. // path: '/guide',
  829. // component: Layout,
  830. // redirect: '/guide/index',
  831. // children: [
  832. // {
  833. // path: 'index',
  834. // component: () => import('@/views/guide/index'),
  835. // name: 'Guide',
  836. // meta: { title: 'guide', icon: 'guide', noCache: true }
  837. // }
  838. // ]
  839. // },
  840. {
  841. path: '/profile',
  842. component: Layout,
  843. redirect: '/profile/index',
  844. hidden: true,
  845. children: [
  846. {
  847. path: 'index',
  848. component: () => import('@/views/profile/index'),
  849. name: 'Profile',
  850. meta: {
  851. title: '个人中心',
  852. hidden: true,
  853. breadcrumb: true
  854. }
  855. }
  856. ]
  857. }
  858. ]
  859. /**
  860. * asyncRoutes
  861. * the routes that need to be dynamically loaded based on user roles
  862. */
  863. export const asyncRoutes = [
  864. {
  865. path: '/permission',
  866. component: Layout,
  867. redirect: '/permission/page',
  868. alwaysShow: true, // will always show the root menu
  869. name: 'Permission',
  870. meta: {
  871. title: 'permission',
  872. icon: 'lock',
  873. roles: ['admin', 'editor'] // you can set roles in root nav
  874. },
  875. children: [
  876. {
  877. path: 'page',
  878. component: () => import('@/views/permission/page'),
  879. name: 'PagePermission',
  880. meta: {
  881. title: 'pagePermission',
  882. roles: ['admin'] // or you can only set roles in sub nav
  883. }
  884. },
  885. {
  886. path: 'directive',
  887. component: () => import('@/views/permission/directive'),
  888. name: 'DirectivePermission',
  889. meta: {
  890. title: 'directivePermission'
  891. // if do not set roles, means: this page does not require permission
  892. }
  893. },
  894. {
  895. path: 'role',
  896. component: () => import('@/views/permission/role'),
  897. name: 'RolePermission',
  898. meta: {
  899. title: 'rolePermission',
  900. roles: ['admin']
  901. }
  902. }
  903. ]
  904. },
  905. {
  906. path: '/icon',
  907. component: Layout,
  908. children: [
  909. {
  910. path: 'index',
  911. component: () => import('@/views/icons/index'),
  912. name: 'Icons',
  913. meta: { title: 'icons', icon: 'icon', noCache: true }
  914. }
  915. ]
  916. },
  917. /** when your routing map is too long, you can split it into small modules **/
  918. componentsRouter,
  919. chartsRouter,
  920. nestedRouter,
  921. tableRouter,
  922. {
  923. path: '/example',
  924. component: Layout,
  925. redirect: '/example/list',
  926. name: 'Example',
  927. meta: {
  928. title: 'example',
  929. icon: 'el-icon-s-help'
  930. },
  931. children: [
  932. {
  933. path: 'create',
  934. component: () => import('@/views/example/create'),
  935. name: 'CreateArticle',
  936. meta: { title: 'createArticle', icon: 'edit' }
  937. },
  938. {
  939. path: 'edit/:id(\\d+)',
  940. component: () => import('@/views/example/edit'),
  941. name: 'EditArticle',
  942. meta: { title: 'editArticle', noCache: true, activeMenu: '/example/list' },
  943. hidden: true
  944. },
  945. {
  946. path: 'list',
  947. component: () => import('@/views/example/list'),
  948. name: 'ArticleList',
  949. meta: { title: 'articleList', icon: 'list' }
  950. }
  951. ]
  952. },
  953. {
  954. path: '/tab',
  955. component: Layout,
  956. children: [
  957. {
  958. path: 'index',
  959. component: () => import('@/views/tab/index'),
  960. name: 'Tab',
  961. meta: { title: 'tab', icon: 'tab' }
  962. }
  963. ]
  964. },
  965. {
  966. path: '/error',
  967. component: Layout,
  968. redirect: 'noRedirect',
  969. name: 'ErrorPages',
  970. meta: {
  971. title: 'errorPages',
  972. icon: '404'
  973. },
  974. children: [
  975. {
  976. path: '401',
  977. component: () => import('@/views/error-page/401'),
  978. name: 'Page401',
  979. meta: { title: 'page401', noCache: true }
  980. },
  981. {
  982. path: '404',
  983. component: () => import('@/views/error-page/404'),
  984. name: 'Page404',
  985. meta: { title: 'page404', noCache: true }
  986. }
  987. ]
  988. },
  989. {
  990. path: '/error-log',
  991. component: Layout,
  992. children: [
  993. {
  994. path: 'log',
  995. component: () => import('@/views/error-log/index'),
  996. name: 'ErrorLog',
  997. meta: { title: 'errorLog', icon: 'bug' }
  998. }
  999. ]
  1000. },
  1001. {
  1002. path: '/excel',
  1003. component: Layout,
  1004. redirect: '/excel/export-excel',
  1005. name: 'Excel',
  1006. meta: {
  1007. title: 'excel',
  1008. icon: 'excel'
  1009. },
  1010. children: [
  1011. {
  1012. path: 'export-excel',
  1013. component: () => import('@/views/excel/export-excel'),
  1014. name: 'ExportExcel',
  1015. meta: { title: 'exportExcel' }
  1016. },
  1017. {
  1018. path: 'export-selected-excel',
  1019. component: () => import('@/views/excel/select-excel'),
  1020. name: 'SelectExcel',
  1021. meta: { title: 'selectExcel' }
  1022. },
  1023. {
  1024. path: 'export-merge-header',
  1025. component: () => import('@/views/excel/merge-header'),
  1026. name: 'MergeHeader',
  1027. meta: { title: 'mergeHeader' }
  1028. },
  1029. {
  1030. path: 'upload-excel',
  1031. component: () => import('@/views/excel/upload-excel'),
  1032. name: 'UploadExcel',
  1033. meta: { title: 'uploadExcel' }
  1034. }
  1035. ]
  1036. },
  1037. {
  1038. path: '/zip',
  1039. component: Layout,
  1040. redirect: '/zip/download',
  1041. alwaysShow: true,
  1042. name: 'Zip',
  1043. meta: { title: 'zip', icon: 'zip' },
  1044. children: [
  1045. {
  1046. path: 'download',
  1047. component: () => import('@/views/zip/index'),
  1048. name: 'ExportZip',
  1049. meta: { title: 'exportZip' }
  1050. }
  1051. ]
  1052. },
  1053. {
  1054. path: '/pdf',
  1055. component: Layout,
  1056. redirect: '/pdf/index',
  1057. children: [
  1058. {
  1059. path: 'index',
  1060. component: () => import('@/views/pdf/index'),
  1061. name: 'PDF',
  1062. meta: { title: 'pdf', icon: 'pdf' }
  1063. }
  1064. ]
  1065. },
  1066. {
  1067. path: '/pdf/download',
  1068. component: () => import('@/views/pdf/download'),
  1069. hidden: true
  1070. },
  1071. {
  1072. path: '/theme',
  1073. component: Layout,
  1074. children: [
  1075. {
  1076. path: 'index',
  1077. component: () => import('@/views/theme/index'),
  1078. name: 'Theme',
  1079. meta: { title: 'theme', icon: 'theme' }
  1080. }
  1081. ]
  1082. },
  1083. {
  1084. path: '/clipboard',
  1085. component: Layout,
  1086. children: [
  1087. {
  1088. path: 'index',
  1089. component: () => import('@/views/clipboard/index'),
  1090. name: 'ClipboardDemo',
  1091. meta: { title: 'clipboardDemo', icon: 'clipboard' }
  1092. }
  1093. ]
  1094. },
  1095. {
  1096. path: '/i18n',
  1097. component: Layout,
  1098. children: [
  1099. {
  1100. path: 'index',
  1101. component: () => import('@/views/i18n-demo/index'),
  1102. name: 'I18n',
  1103. meta: { title: 'i18n', icon: 'international' }
  1104. }
  1105. ]
  1106. },
  1107. {
  1108. path: 'external-link',
  1109. component: Layout,
  1110. children: [
  1111. {
  1112. path: 'https://github.com/PanJiaChen/vue-element-admin',
  1113. meta: { title: 'externalLink', icon: 'link' }
  1114. }
  1115. ]
  1116. },
  1117. // 404 page must be placed at the end !!!
  1118. { path: '*', redirect: '/404', hidden: true }
  1119. ]
  1120. const createRouter = () => new Router({
  1121. // mode: 'history', // require service support
  1122. scrollBehavior: () => ({ y: 0 }),
  1123. routes: constantRoutes
  1124. })
  1125. const router = createRouter()
  1126. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  1127. export function resetRouter() {
  1128. const newRouter = createRouter()
  1129. router.matcher = newRouter.matcher // reset router
  1130. }
  1131. export default router