You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.9 KiB

5 years ago
4 years ago
5 years ago
4 years ago
4 years ago
5 years ago
4 years ago
5 years ago
4 years ago
5 years ago
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. const _import = require('./_import_' + process.env.NODE_ENV)
  4. // in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
  5. // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
  6. Vue.use(Router)
  7. /* Layout */
  8. import Layout from '../views/layout/Layout'
  9. import routesWorkflow from './routes_workflow'
  10. import routesForm from './routes_form'
  11. import routesXm from './routes_xm'
  12. import routesDatavXm from './routes_datav_xm'
  13. import routesArc from './routes_arc'
  14. import routesIm from './routes_im'
  15. export { Layout }
  16. /** note: submenu only apppear when children.length>=1
  17. * detail see https://panjiachen.github.io/vue-element-admin-site/#/router-and-nav?id=sidebar
  18. **/
  19. /**
  20. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  21. * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
  22. * if not set alwaysShow, only more than one route under the children
  23. * it will becomes nested mode, otherwise not show the root menu
  24. * redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
  25. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  26. * meta : {
  27. roles: ['admin','editor'] will control the page roles (you can set multiple roles)
  28. title: 'title' the name show in submenu and breadcrumb (recommend set)
  29. icon: 'svg-name' the icon show in the sidebar,
  30. noCache: true if true ,the page will no be cached(default is false)
  31. }
  32. **/
  33. export const constantRouterMap = [
  34. { path: '/login', component: _import('login/index'), hidden: true },
  35. { path: '/404', component: _import('errorPage/404'), hidden: true },
  36. { path: '/401', component: _import('errorPage/401'), hidden: true },
  37. {
  38. path: '',
  39. component: Layout,
  40. redirect: 'dashboard',
  41. children: [{
  42. path: 'dashboard',
  43. component: _import('xm/core/xmProject/XmProjectMng'),
  44. name: 'dashboard',
  45. meta: { title: 'dashboard', icon: 'home-page', noCache: true }
  46. },
  47. {
  48. path: 'updateUserInfo',
  49. component: _import('mdp/sys/user/UpdateUserInfo'),
  50. name: '账户设置',
  51. meta: {
  52. title: 'updateUserInfo',
  53. icon: 'component'
  54. }
  55. }
  56. ],
  57. hidden: true
  58. },
  59. ]
  60. export default new Router({
  61. // mode: 'history', // require service support
  62. scrollBehavior: () => ({ y: 0 }),
  63. routes: constantRouterMap
  64. })
  65. let allRoutes = []
  66. allRoutes=allRoutes.concat(routesXm.routes);
  67. allRoutes=allRoutes.concat(routesDatavXm.routes);
  68. allRoutes=allRoutes.concat(routesWorkflow.routes).concat(routesForm.routes)
  69. allRoutes=allRoutes.concat(routesArc.routes);
  70. allRoutes=allRoutes.concat(routesIm.routes);
  71. export const asyncRouterMap = allRoutes