index.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. path: '/pms',
  34. component: Layout,
  35. redirect: '/pms/product',
  36. name: 'pms',
  37. meta: {title: '商品', icon: 'product'},
  38. children: [{
  39. path: 'product',
  40. name: 'product',
  41. component: () => import('@/views/pms/product/index'),
  42. meta: {title: '商品列表', icon: 'product-list'}
  43. },
  44. {
  45. path: 'addProduct',
  46. name: 'addProduct',
  47. component: () => import('@/views/pms/product/add'),
  48. meta: {title: '添加商品', icon: 'product-add'}
  49. },
  50. {
  51. path: 'updateProduct',
  52. name: 'updateProduct',
  53. component: () => import('@/views/pms/product/update'),
  54. meta: {title: '修改商品', icon: 'product-add'},
  55. hidden: true
  56. },
  57. {
  58. path: 'productRecycle',
  59. name: 'productRecycle',
  60. component: () => import('@/views/pms/product/index'),
  61. meta: {title: '商品回收站', icon: 'product-recycle'},
  62. hidden: true
  63. },
  64. {
  65. path: 'productComment',
  66. name: 'productComment',
  67. component: () => import('@/views/pms/product/index'),
  68. meta: {title: '商品评价', icon: 'product-comment'},
  69. hidden: true
  70. },
  71. {
  72. path: 'productCate',
  73. name: 'productCate',
  74. component: () => import('@/views/pms/productCate/index'),
  75. meta: {title: '商品分类', icon: 'product-cate'}
  76. },
  77. {
  78. path: 'addProductCate',
  79. name: 'addProductCate',
  80. component: () => import('@/views/pms/productCate/add'),
  81. meta: {title: '添加商品分类'},
  82. hidden: true
  83. },
  84. {
  85. path: 'updateProductCate',
  86. name: 'updateProductCate',
  87. component: () => import('@/views/pms/productCate/update'),
  88. meta: {title: '修改商品分类'},
  89. hidden: true
  90. },
  91. {
  92. path: 'productAttr',
  93. name: 'productAttr',
  94. component: () => import('@/views/pms/productAttr/index'),
  95. meta: {title: '商品类型', icon: 'product-attr'}
  96. },
  97. {
  98. path: 'productAttrList',
  99. name: 'productAttrList',
  100. component: () => import('@/views/pms/productAttr/productAttrList'),
  101. meta: {title: '商品属性列表'},
  102. hidden: true
  103. },
  104. {
  105. path: 'addProductAttr',
  106. name: 'addProductAttr',
  107. component: () => import('@/views/pms/productAttr/addProductAttr'),
  108. meta: {title: '添加商品属性'},
  109. hidden: true
  110. },
  111. {
  112. path: 'updateProductAttr',
  113. name: 'updateProductAttr',
  114. component: () => import('@/views/pms/productAttr/updateProductAttr'),
  115. meta: {title: '修改商品属性'},
  116. hidden: true
  117. },
  118. {
  119. path: 'brand',
  120. name: 'brand',
  121. component: () => import('@/views/pms/brand/index'),
  122. meta: {title: '品牌管理', icon: 'product-brand'}
  123. },
  124. {
  125. path: 'addBrand',
  126. name: 'addBrand',
  127. component: () => import('@/views/pms/brand/add'),
  128. meta: {title: '添加品牌'},
  129. hidden: true
  130. },
  131. {
  132. path: 'updateBrand',
  133. name: 'updateBrand',
  134. component: () => import('@/views/pms/brand/update'),
  135. meta: {title: '编辑品牌'},
  136. hidden: true
  137. }
  138. ]
  139. },
  140. {
  141. path: '/oms',
  142. component: Layout,
  143. redirect: '/oms/order',
  144. name: 'oms',
  145. meta: {title: '订单', icon: 'order'},
  146. children: [
  147. {
  148. path: 'order',
  149. name: 'order',
  150. component: () => import('@/views/oms/order/index'),
  151. meta: {title: '订单列表', icon: 'product-list'}
  152. },
  153. {
  154. path: 'deliverOrderList',
  155. name: 'deliverOrderList',
  156. component: () => import('@/views/oms/order/deliverOrderList'),
  157. meta: {title: '发货列表'},
  158. hidden:true
  159. },
  160. {
  161. path: 'orderSetting',
  162. name: 'orderSetting',
  163. component: () => import('@/views/oms/order/setting'),
  164. meta: {title: '订单设置', icon: 'order-setting'}
  165. },
  166. {
  167. path: 'returnApply',
  168. name: 'returnApply',
  169. component: () => import('@/views/oms/apply/index'),
  170. meta: {title: '退货申请处理', icon: 'order-return'}
  171. },
  172. {
  173. path: 'returnReason',
  174. name: 'returnReason',
  175. component: () => import('@/views/oms/apply/reason'),
  176. meta: {title: '退货原因设置', icon: 'order-return-reason'}
  177. },
  178. {
  179. path: 'returnApplyDetail',
  180. name: 'returnApplyDetail',
  181. component: () => import('@/views/oms/apply/applyDetail'),
  182. meta: {title: '退货原因详情'},
  183. hidden:true
  184. }
  185. ]
  186. },
  187. {path: '*', redirect: '/404', hidden: true}
  188. ]
  189. export default new Router({
  190. // mode: 'history', //后端支持可开
  191. scrollBehavior: () => ({y: 0}),
  192. routes: constantRouterMap
  193. })