index.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /* Layout */
  5. import Layout from '@/layout'
  6. import ParentView from '@/components/ParentView';
  7. import approval from '../views/workbench/approval';
  8. import handled from '../views/workbench/handled';
  9. import process from '../views/workbench/process';
  10. console.log(approval,handled,process,12)
  11. /**
  12. * Note: 路由配置项
  13. *
  14. * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
  15. * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
  16. * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
  17. * // 若你想不管路由下面的 children 声明的个数都显示你的根路由
  18. * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
  19. * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
  20. * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
  21. * meta : {
  22. noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
  23. title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
  24. icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
  25. breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
  26. }
  27. */
  28. // 公共路由
  29. export const constantRoutes = [
  30. {
  31. path: '/redirect',
  32. component: Layout,
  33. hidden: true,
  34. children: [
  35. {
  36. path: '/redirect/:path(.*)',
  37. component: (resolve) => require(['@/views/redirect'], resolve)
  38. }
  39. ]
  40. },
  41. {
  42. path: '/login',
  43. component: (resolve) => require(['@/views/login'], resolve),
  44. hidden: true
  45. },
  46. {
  47. path: '/404',
  48. component: (resolve) => require(['@/views/error/404'], resolve),
  49. hidden: true
  50. },
  51. {
  52. path: '/401',
  53. component: (resolve) => require(['@/views/error/401'], resolve),
  54. hidden: true
  55. },
  56. {
  57. path: '',
  58. component: Layout,
  59. redirect: 'index',
  60. meta: { title: '首页', icon: '', noCache: true, affix: true },
  61. children: [
  62. {
  63. path: 'index',
  64. component: (resolve) => require(['@/views/index'], resolve),
  65. name: '首页',
  66. meta: { title: '首页', icon: 'dashboard', noCache: true, affix: true }
  67. },
  68. {
  69. path: 'index/approval',
  70. hidden: false,
  71. component: approval,
  72. name: '待我审批',
  73. meta: { title: '待我审批', icon: 'dashboard', noCache: false},
  74. },
  75. {
  76. path: 'index/handled',
  77. hidden: false,
  78. component: handled,
  79. name: '已办理',
  80. meta: { title: '已办理', icon: 'dashboard', noCache: false},
  81. },
  82. // {
  83. // path: 'index/process',
  84. // hidden: false,
  85. // component: process,
  86. // name: '我的流程',
  87. // meta: { title: '我的流程', icon: '', noCache: false},
  88. // },
  89. // {
  90. // path: '',
  91. // name: '流程工作台',
  92. // hidden: false,
  93. // alwaysShow: true,
  94. // meta: { title: '流程工作台', icon: 'spot', noCache: true },
  95. // children: [{
  96. // path: 'index/approval',
  97. // hidden: false,
  98. // component: approval,
  99. // name: '待我审批',
  100. // meta: { title: '待我审批', icon: '', noCache: false},
  101. // },{
  102. // path: 'index/handled',
  103. // hidden: false,
  104. // component: handled,
  105. // name: '已办理',
  106. // meta: { title: '已办理', icon: '', noCache: false},
  107. // }, {
  108. // path: 'index/process',
  109. // hidden: false,
  110. // component: process,
  111. // name: '我的流程',
  112. // meta: { title: '我的流程', icon: '', noCache: false},
  113. // }]
  114. // }
  115. ]
  116. },
  117. {
  118. path: '/user',
  119. component: Layout,
  120. hidden: true,
  121. redirect: 'noredirect',
  122. children: [
  123. {
  124. path: 'profile',
  125. component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
  126. name: 'Profile',
  127. meta: { title: '个人中心', icon: 'user' }
  128. }
  129. ]
  130. },
  131. {
  132. path: '/dict',
  133. component: Layout,
  134. hidden: true,
  135. children: [
  136. {
  137. path: 'type/data/:dictId(\\d+)',
  138. component: (resolve) => require(['@/views/system/dict/data'], resolve),
  139. name: 'Data',
  140. meta: { title: '字典数据', icon: '' }
  141. }
  142. ]
  143. },
  144. {
  145. path: '/job',
  146. component: Layout,
  147. hidden: true,
  148. children: [
  149. {
  150. path: 'log',
  151. component: (resolve) => require(['@/views/monitor/job/log'], resolve),
  152. name: 'JobLog',
  153. meta: { title: '调度日志' }
  154. }
  155. ]
  156. },
  157. {
  158. path: '/gen',
  159. component: Layout,
  160. hidden: true,
  161. children: [
  162. {
  163. path: 'edit/:tableId(\\d+)',
  164. component: (resolve) => require(['@/views/tool/gen/editTable'], resolve),
  165. name: 'GenEdit',
  166. meta: { title: '修改生成配置' }
  167. }
  168. ]
  169. }
  170. ]
  171. export default new Router({
  172. mode: 'history', // 去掉url中的#
  173. scrollBehavior: () => ({ y: 0 }),
  174. routes: constantRoutes
  175. })