index.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /* Layout */
  5. import Layout from '../views/layout/Layout'
  6. /**
  7. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  8. * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
  9. * if not set alwaysShow, only more than one route under the children
  10. * it will becomes nested mode, otherwise not show the root menu
  11. * redirect: noredirect if `redirect:noredirect` will no redirct in the breadcrumb
  12. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  13. * meta : {
  14. title: 'title' the name show in submenu and breadcrumb (recommend set)
  15. icon: 'svg-name' the icon show in the sidebar,
  16. }
  17. **/
  18. export const constantRouterMap = [
  19. {path: '/login', component: () => import('@/views/login/index'), hidden: true},
  20. {path: '/404', component: () => import('@/views/404'), hidden: true},
  21. {
  22. path: '',
  23. component: Layout,
  24. redirect: '/home',
  25. meta: {title: '首页', icon: 'home'},
  26. children: [{
  27. path: 'home',
  28. name: 'home',
  29. component: () => import('@/views/home/index'),
  30. meta: {title: '首页', icon: 'home'}
  31. },]
  32. }
  33. ]
  34. export const asyncRouterMap = [
  35. {
  36. path: '/channel',
  37. component: Layout,
  38. redirect: '/channel/info',
  39. name: 'channel',
  40. meta: {title: '渠道管理', icon: 'cms-subject'},
  41. children: [{
  42. path: 'info',
  43. name: 'info',
  44. component: () => import('@/views/channel/info/index'),
  45. meta: {title: '基础信息', icon: 'BasicsInfo'},
  46. },
  47. {
  48. path: 'useCondition',
  49. name: 'useCondition',
  50. component: () => import('@/views/channel/useCondition/index'),
  51. meta: {title: '使用情况', icon: 'useCondition'}
  52. },
  53. {
  54. path: 'upCheck',
  55. name: 'upCheck',
  56. component: () => import('@/views/channel/upCheck/index'),
  57. meta: {title: '上账情况', icon: 'settleAccounts'}
  58. },
  59. ]
  60. },
  61. {
  62. path: '/distribution',
  63. component: Layout,
  64. redirect: '/distribution/distributionSet',
  65. name: 'distribution',
  66. meta: {title: '分销管理', icon: 'total-yesterday'},
  67. children: [{
  68. path: 'distributionSet',
  69. name: 'distributionSet',
  70. component: () => import('@/views/distribution/distributionSet/index'),
  71. meta: {title: '分销设置', icon: 'setting'}
  72. },
  73. {
  74. path: 'userList',
  75. name: 'userList',
  76. component: () => import('@/views/distribution/userList/index'),
  77. meta: {title: '用户列表', icon: 'user'}
  78. },
  79. {
  80. path: 'peopleManage',
  81. name: 'peopleManage',
  82. component: () => import('@/views/distribution/peopleManage/index'),
  83. meta: {title: '分销员管理', icon: 'peopleChannel'}
  84. },
  85. {
  86. path: 'junior',
  87. name: 'junior',
  88. component: () => import('@/views/distribution/peopleManage/junior'),
  89. meta: {title: '下级查看', icon: 'peopleChannel'},
  90. hidden: true
  91. },
  92. {
  93. path: 'setCommission',
  94. name: 'setCommission',
  95. component: () => import('@/views/distribution/peopleManage/setCommission'),
  96. meta: {title: '分销佣金设置', icon: 'peopleChannel'},
  97. hidden: true
  98. },
  99. {
  100. path: 'settingsPrice',
  101. name: 'settingsPrice',
  102. component: () => import('@/views/distribution/peopleManage/settingsPrice'),
  103. meta: {title: '代理价设置', icon: 'peopleChannel'},
  104. hidden: true
  105. },
  106. {
  107. path: 'firstSetPrice',
  108. name: 'firstSetPrice',
  109. component: () => import('@/views/distribution/peopleManage/firstSetPrice'),
  110. meta: {title: '代理价设置', icon: 'peopleChannel'},
  111. hidden: true
  112. },
  113. {
  114. path: 'statistics',
  115. name: 'statistics',
  116. component: () => import('@/views/distribution/statistics/index'),
  117. meta: {title: '业绩统计', icon: 'performance'}
  118. },
  119. {
  120. path: 'records',
  121. name: 'records',
  122. component: () => import('@/views/distribution/records/index'),
  123. meta: {title: '分销记录', icon: 'example'}
  124. },
  125. {
  126. path: 'finance',
  127. name: 'finance',
  128. component: () => import('@/views/distribution/finance/index'),
  129. meta: {title: '结算记录', icon: 'order-return-reason'}
  130. },
  131. {
  132. path: 'changePwd',
  133. name: 'changePwd',
  134. component: () => import('@/views/distribution/changePwd/index'),
  135. meta: {title: '修改密码'},
  136. hidden: true
  137. }
  138. ]
  139. },
  140. {
  141. path:'/ums',
  142. component: Layout,
  143. redirect: '/ums/admin',
  144. name: 'ums',
  145. meta: {title: '权限管理', icon: 'ums'},
  146. children: [
  147. {
  148. path: 'admin',
  149. name: 'admin',
  150. component: () => import('@/views/ums/admin/index'),
  151. meta: {title: '平台成员', icon: 'ums-admin'}
  152. },
  153. {
  154. path: 'role',
  155. name: 'role',
  156. component: () => import('@/views/ums/role/index'),
  157. meta: {title: '角色列表', icon: 'ums-role'}
  158. },
  159. {
  160. path: 'allocMenu',
  161. name: 'allocMenu',
  162. component: () => import('@/views/ums/role/allocMenu'),
  163. meta: {title: '分配菜单'},
  164. hidden: true
  165. },
  166. {
  167. path: 'allocResource',
  168. name: 'allocResource',
  169. component: () => import('@/views/ums/role/allocResource'),
  170. meta: {title: '分配资源'},
  171. hidden: true
  172. },
  173. {
  174. path: 'menu',
  175. name: 'menu',
  176. component: () => import('@/views/ums/menu/index'),
  177. meta: {title: '菜单列表', icon: 'ums-menu'}
  178. },
  179. {
  180. path: 'addMenu',
  181. name: 'addMenu',
  182. component: () => import('@/views/ums/menu/add'),
  183. meta: {title: '添加菜单'},
  184. hidden: true
  185. },
  186. {
  187. path: 'updateMenu',
  188. name: 'updateMenu',
  189. component: () => import('@/views/ums/menu/update'),
  190. meta: {title: '修改菜单'},
  191. hidden: true
  192. },
  193. {
  194. path: 'resource',
  195. name: 'resource',
  196. component: () => import('@/views/ums/resource/index'),
  197. meta: {title: '资源列表', icon: 'ums-resource'}
  198. },
  199. {
  200. path: 'resourceCategory',
  201. name: 'resourceCategory',
  202. component: () => import('@/views/ums/resource/categoryList'),
  203. meta: {title: '资源分类'},
  204. hidden: true
  205. }
  206. ]
  207. },
  208. {path: '*', redirect: '/404', hidden: true}
  209. ]
  210. export default new Router({
  211. // mode: 'history', //后端支持可开
  212. scrollBehavior: () => ({y: 0}),
  213. routes: constantRouterMap
  214. })