Newer
Older
KaiFengPC / src / router / index.js
@zhangdeliang zhangdeliang on 18 Jul 2 KB update
  1. import { createWebHashHistory, createRouter } from 'vue-router';
  2. /* Layout */
  3. import Layout from '@/layout';
  4.  
  5. // 公共路由
  6. export const constantRoutes = [
  7. {
  8. path: '/login',
  9. name: 'login',
  10. component: () => import('@/views/login'),
  11. hidden: true,
  12. },
  13. {
  14. path: '/autoLogin',
  15. name: 'autoLogin',
  16. component: () => import('@/views/autoLogin'),
  17. hidden: true,
  18. },
  19. // 系统首页
  20. {
  21. path: '/door',
  22. name: 'door',
  23. component: () => import('@/views/door'),
  24. hidden: true,
  25. },
  26. {
  27. path: '/',
  28. component: () => import('@/views/door'),
  29. hidden: true,
  30. },
  31. // 无路由时跳转404
  32. {
  33. path: '/:pathMatch(.*)*',
  34. component: () => import('@/views/error/404'),
  35. hidden: true,
  36. },
  37. // 401无权限
  38. {
  39. path: '/401',
  40. component: () => import('@/views/error/401'),
  41. hidden: true,
  42. },
  43. // 首页
  44. {
  45. path: '/index',
  46. component: Layout,
  47. redirect: '/index',
  48. children: [
  49. {
  50. path: '',
  51. component: () => import('@/views/index'),
  52. name: '系统内置首页',
  53. meta: { title: '系统内置首页', icon: 'dashboard', affix: true, noCache: true },
  54. },
  55. ],
  56. },
  57. // 4k城管委分辨率
  58. {
  59. path: '/chengguanweiScreen',
  60. name: 'chengguanweiScreen',
  61. component: () => import('@/views/sponeScreen/chengguanweiScreen/index'),
  62. hidden: true,
  63. },
  64.  
  65. {
  66. path: '/examinemanage',
  67. component: Layout,
  68. hidden: true,
  69. permissions: ['examinemanage:control'],
  70. children: [
  71. {
  72. path: 'control/:controlId(\\d+)',
  73. component: () => import('@/views/spongePerformance/longTerm/examinemanage/control/index'),
  74. name: 'control',
  75. meta: { title: '绩效评估-指标管理', activeMenu: '/spongePerformance/examinemanage' },
  76. },
  77. ],
  78. },
  79.  
  80. {
  81. path: '/management',
  82. component: Layout,
  83. hidden: true,
  84. permissions: ['management:control'],
  85. children: [
  86. {
  87. path: 'control/:controlId(\\d+)',
  88. component: () => import('@/views/spongePerformance/management/control/index'),
  89. name: 'management',
  90. meta: { title: '考核指标管理-指标项', activeMenu: '/spongePerformance/management' },
  91. },
  92. ],
  93. },
  94. ];
  95.  
  96. const router = createRouter({
  97. history: createWebHashHistory(),
  98. routes: constantRoutes,
  99. scrollBehavior(to, from, savedPosition) {
  100. if (savedPosition) {
  101. return savedPosition;
  102. } else {
  103. return { top: 0 };
  104. }
  105. },
  106. });
  107.  
  108. export default router;