index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  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. children: [{
  26. path: 'home',
  27. name: 'home',
  28. component: () => import('@/views/home/index'),
  29. meta: {title: '首页', icon: 'home'}
  30. }]
  31. }
  32. ]
  33. export const asyncRouterMap = [
  34. {
  35. path: '/pms',
  36. component: Layout,
  37. redirect: '/pms/product',
  38. name: 'pms',
  39. meta: {title: '商品', icon: 'product'},
  40. children: [{
  41. path: 'product',
  42. name: 'product',
  43. component: () => import('@/views/pms/product/index'),
  44. meta: {title: '商品列表', icon: 'product-list'}
  45. },
  46. {
  47. path: 'addProduct',
  48. name: 'addProduct',
  49. component: () => import('@/views/pms/product/add'),
  50. meta: {title: '添加商品', icon: 'product-add'}
  51. },
  52. {
  53. path: 'updateProduct',
  54. name: 'updateProduct',
  55. component: () => import('@/views/pms/product/update'),
  56. meta: {title: '修改商品', icon: 'product-add'},
  57. hidden: true
  58. },
  59. {
  60. path: 'detailProduct',
  61. name: 'detailProduct',
  62. component: () => import('@/views/pms/product/detail'),
  63. meta: {title: '查看商品', icon: 'product-add'},
  64. hidden: true
  65. },
  66. {
  67. path: 'productCate',
  68. name: 'productCate',
  69. component: () => import('@/views/pms/productCate/index'),
  70. meta: {title: '商品分类', icon: 'product-cate'}
  71. },
  72. {
  73. path: 'addProductCate',
  74. name: 'addProductCate',
  75. component: () => import('@/views/pms/productCate/add'),
  76. meta: {title: '添加商品分类'},
  77. hidden: true
  78. },
  79. {
  80. path: 'updateProductCate',
  81. name: 'updateProductCate',
  82. component: () => import('@/views/pms/productCate/update'),
  83. meta: {title: '修改商品分类'},
  84. hidden: true
  85. },
  86. {
  87. path: 'productAttr',
  88. name: 'productAttr',
  89. component: () => import('@/views/pms/productAttr/index'),
  90. meta: {title: '商品类型', icon: 'product-attr'}
  91. },
  92. {
  93. path: 'productAttrList',
  94. name: 'productAttrList',
  95. component: () => import('@/views/pms/productAttr/productAttrList'),
  96. meta: {title: '商品属性列表'},
  97. hidden: true
  98. },
  99. {
  100. path: 'addProductAttr',
  101. name: 'addProductAttr',
  102. component: () => import('@/views/pms/productAttr/addProductAttr'),
  103. meta: {title: '添加商品属性'},
  104. hidden: true
  105. },
  106. {
  107. path: 'updateProductAttr',
  108. name: 'updateProductAttr',
  109. component: () => import('@/views/pms/productAttr/updateProductAttr'),
  110. meta: {title: '修改商品属性'},
  111. hidden: true
  112. },
  113. {
  114. path: 'brand',
  115. name: 'brand',
  116. component: () => import('@/views/pms/brand/index'),
  117. meta: {title: '品牌管理', icon: 'product-brand'}
  118. },
  119. {
  120. path: 'addBrand',
  121. name: 'addBrand',
  122. component: () => import('@/views/pms/brand/add'),
  123. meta: {title: '添加品牌'},
  124. hidden: true
  125. },
  126. {
  127. path: 'updateBrand',
  128. name: 'updateBrand',
  129. component: () => import('@/views/pms/brand/update'),
  130. meta: {title: '编辑品牌'},
  131. hidden: true
  132. }
  133. ]
  134. },
  135. {
  136. path: '/oms',
  137. component: Layout,
  138. redirect: '/oms/order',
  139. name: 'oms',
  140. meta: {title: '订单', icon: 'order'},
  141. children: [
  142. {
  143. path: 'order',
  144. name: 'order',
  145. component: () => import('@/views/oms/order/index'),
  146. meta: {title: '订单列表', icon: 'product-list'}
  147. },
  148. {
  149. path: 'orderDetail',
  150. name: 'orderDetail',
  151. component: () => import('@/views/oms/order/orderDetail'),
  152. meta: {title: '订单详情'},
  153. hidden:true
  154. },
  155. {
  156. path: 'deliverOrderList',
  157. name: 'deliverOrderList',
  158. component: () => import('@/views/oms/order/deliverOrderList'),
  159. meta: {title: '发货列表'},
  160. hidden:true
  161. },
  162. {
  163. path: 'orderSetting',
  164. name: 'orderSetting',
  165. component: () => import('@/views/oms/order/setting'),
  166. meta: {title: '订单设置', icon: 'order-setting'}
  167. },
  168. {
  169. path: 'returnApply',
  170. name: 'returnApply',
  171. component: () => import('@/views/oms/apply/index'),
  172. meta: {title: '退货申请处理', icon: 'order-return'}
  173. },
  174. {
  175. path: 'returnReason',
  176. name: 'returnReason',
  177. component: () => import('@/views/oms/apply/reason'),
  178. meta: {title: '退货原因设置', icon: 'order-return-reason'}
  179. },
  180. {
  181. path: 'returnApplyDetail',
  182. name: 'returnApplyDetail',
  183. component: () => import('@/views/oms/apply/applyDetail'),
  184. meta: {title: '退货原因详情'},
  185. hidden:true
  186. }
  187. ]
  188. },
  189. {
  190. path:'/sms',
  191. component: Layout,
  192. redirect: '/sms/coupon',
  193. name: 'sms',
  194. meta: {title: '营销', icon: 'sms'},
  195. children: [
  196. {
  197. path: 'flash',
  198. name: 'flash',
  199. component: () => import('@/views/sms/flash/index'),
  200. meta: {title: '秒杀活动列表', icon: 'sms-flash'}
  201. },
  202. {
  203. path: 'flashSession',
  204. name: 'flashSession',
  205. component: () => import('@/views/sms/flash/sessionList'),
  206. meta: {title: '秒杀时间段列表'},
  207. hidden:true
  208. },
  209. {
  210. path: 'selectSession',
  211. name: 'selectSession',
  212. component: () => import('@/views/sms/flash/selectSessionList'),
  213. meta: {title: '秒杀时间段选择'},
  214. hidden:true
  215. },
  216. {
  217. path: 'flashProductRelation',
  218. name: 'flashProductRelation',
  219. component: () => import('@/views/sms/flash/productRelationList'),
  220. meta: {title: '秒杀商品列表'},
  221. hidden:true
  222. },
  223. {
  224. path: 'coupon',
  225. name: 'coupon',
  226. component: () => import('@/views/sms/coupon/index'),
  227. meta: {title: '优惠券列表', icon: 'sms-coupon'}
  228. },
  229. {
  230. path: 'addCoupon',
  231. name: 'addCoupon',
  232. component: () => import('@/views/sms/coupon/add'),
  233. meta: {title: '添加优惠券'},
  234. hidden:true
  235. },
  236. {
  237. path: 'updateCoupon',
  238. name: 'updateCoupon',
  239. component: () => import('@/views/sms/coupon/update'),
  240. meta: {title: '修改优惠券'},
  241. hidden:true
  242. },
  243. {
  244. path: 'couponHistory',
  245. name: 'couponHistory',
  246. component: () => import('@/views/sms/coupon/history'),
  247. meta: {title: '优惠券领取详情'},
  248. hidden:true
  249. },
  250. {
  251. path: 'brand',
  252. name: 'homeBrand',
  253. component: () => import('@/views/sms/brand/index'),
  254. meta: {title: '品牌推荐', icon: 'product-brand'}
  255. },
  256. {
  257. path: 'new',
  258. name: 'homeNew',
  259. component: () => import('@/views/sms/new/index'),
  260. meta: {title: '新品推荐', icon: 'sms-new'}
  261. },
  262. {
  263. path: 'hot',
  264. name: 'homeHot',
  265. component: () => import('@/views/sms/hot/index'),
  266. meta: {title: '人气推荐', icon: 'sms-hot'}
  267. },
  268. {
  269. path: 'subject',
  270. name: 'homeSubject',
  271. component: () => import('@/views/sms/subject/index'),
  272. meta: {title: '专题推荐', icon: 'sms-subject'}
  273. },
  274. {
  275. path: 'advertise',
  276. name: 'homeAdvertise',
  277. component: () => import('@/views/sms/advertise/index'),
  278. meta: {title: '广告列表', icon: 'sms-ad'}
  279. },
  280. {
  281. path: 'addAdvertise',
  282. name: 'addHomeAdvertise',
  283. component: () => import('@/views/sms/advertise/add'),
  284. meta: {title: '添加广告'},
  285. hidden:true
  286. },
  287. {
  288. path: 'updateAdvertise',
  289. name: 'updateHomeAdvertise',
  290. component: () => import('@/views/sms/advertise/update'),
  291. meta: {title: '编辑广告'},
  292. hidden:true
  293. }
  294. ]
  295. },
  296. {
  297. path:'/ums',
  298. component: Layout,
  299. redirect: '/ums/admin',
  300. name: 'ums',
  301. meta: {title: '权限', icon: 'ums'},
  302. children: [
  303. {
  304. path: 'admin',
  305. name: 'admin',
  306. component: () => import('@/views/ums/admin/index'),
  307. meta: {title: '用户列表', icon: 'ums-admin'}
  308. },
  309. {
  310. path: 'role',
  311. name: 'role',
  312. component: () => import('@/views/ums/role/index'),
  313. meta: {title: '角色列表', icon: 'ums-role'}
  314. },
  315. {
  316. path: 'allocMenu',
  317. name: 'allocMenu',
  318. component: () => import('@/views/ums/role/allocMenu'),
  319. meta: {title: '分配菜单'},
  320. hidden: true
  321. },
  322. {
  323. path: 'allocResource',
  324. name: 'allocResource',
  325. component: () => import('@/views/ums/role/allocResource'),
  326. meta: {title: '分配资源'},
  327. hidden: true
  328. },
  329. {
  330. path: 'menu',
  331. name: 'menu',
  332. component: () => import('@/views/ums/menu/index'),
  333. meta: {title: '菜单列表', icon: 'ums-menu'}
  334. },
  335. {
  336. path: 'addMenu',
  337. name: 'addMenu',
  338. component: () => import('@/views/ums/menu/add'),
  339. meta: {title: '添加菜单'},
  340. hidden: true
  341. },
  342. {
  343. path: 'updateMenu',
  344. name: 'updateMenu',
  345. component: () => import('@/views/ums/menu/update'),
  346. meta: {title: '修改菜单'},
  347. hidden: true
  348. },
  349. {
  350. path: 'resource',
  351. name: 'resource',
  352. component: () => import('@/views/ums/resource/index'),
  353. meta: {title: '资源列表', icon: 'ums-resource'}
  354. },
  355. {
  356. path: 'resourceCategory',
  357. name: 'resourceCategory',
  358. component: () => import('@/views/ums/resource/categoryList'),
  359. meta: {title: '资源分类'},
  360. hidden: true
  361. }
  362. ]
  363. },
  364. {path: '*', redirect: '/404', hidden: true}
  365. ]
  366. export default new Router({
  367. // mode: 'history', //后端支持可开
  368. scrollBehavior: () => ({y: 0}),
  369. routes: constantRouterMap
  370. })