天波用户运营管理后台系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

297 lines
7.6KB

  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. Vue.use(Router)
  4. /* Layout */
  5. import Layout from '@/layout'
  6. /**
  7. * Note: sub-menu only appear when route children.length >= 1
  8. * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
  9. *
  10. * hidden: true if set true, item will not show in the sidebar(default is false)
  11. * alwaysShow: true if set true, will always show the root menu
  12. * if not set alwaysShow, when item has more than one children route,
  13. * it will becomes nested mode, otherwise not show the root menu
  14. * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
  15. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  16. * meta : {
  17. roles: ['admin','editor'] control the page roles (you can set multiple roles)
  18. title: 'title' the name show in sidebar and breadcrumb (recommend set)
  19. icon: 'svg-name'/'el-icon-x' the icon show in the sidebar
  20. breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
  21. activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
  22. }
  23. */
  24. /**
  25. * constantRoutes
  26. * a base page that does not have permission requirements
  27. * all roles can be accessed
  28. */
  29. export const constantRoutes = [{
  30. path: '/redirect',
  31. component: Layout,
  32. hidden: true,
  33. children: [{
  34. path: '/redirect/:path(.*)',
  35. component: () => import('@/views/redirect/index')
  36. }]
  37. },
  38. {
  39. path: '/login',
  40. component: () => import('@/views/login/index'),
  41. hidden: true
  42. },
  43. {
  44. path: '/404',
  45. component: () => import('@/views/404'),
  46. hidden: true
  47. },
  48. {
  49. path: '/',
  50. component: Layout,
  51. redirect: '/dashboard',
  52. children: [{
  53. path: 'dashboard',
  54. name: '首页',
  55. component: () => import('@/views/dashboard/index'),
  56. meta: {
  57. title: '首页',
  58. icon: 'el-icon-s-home',
  59. affix: true
  60. }
  61. }]
  62. },
  63. // 收单系统 todo
  64. {
  65. path: '/collection-order-system',
  66. component: Layout,
  67. redirect: '/collection-order-list',
  68. name: 'collection-order-system',
  69. meta: {
  70. title: '收单系统',
  71. icon: 'el-icon-s-help'
  72. },
  73. children: [
  74. {
  75. path: '/collection-order-list',
  76. name: 'collection-order-list',
  77. component: () => import('@/views/collection-order-system/main/collection-order-list/index'),
  78. meta: {
  79. title: '收单系统', //收单列表
  80. icon: 'el-icon-s-order'
  81. }
  82. },
  83. ]
  84. },
  85. // 众筹拼单系统
  86. {
  87. path: 'crowd-funding-otrder-system',
  88. component: Layout,
  89. redirect: '/package-manage',
  90. name: 'crowd-funding-otrder-system',
  91. meta: {
  92. title: '众筹拼单系统',
  93. icon: 'el-icon-s-help'
  94. },
  95. children: [
  96. {
  97. path: '/package-manage',
  98. name: 'package-manage',
  99. component: () => import('@/views/crowd-funding-otrder-system/main/package-manage/index'),
  100. meta: {
  101. title: '套餐管理',
  102. icon: 'el-icon-burger'
  103. }
  104. },
  105. {
  106. path: '/crowd-funding-otrder-manage',
  107. name: 'crowd-funding-otrder-manage',
  108. component: () => import('@/views/crowd-funding-otrder-system/main/crowd-funding-otrder-manage/index'),
  109. meta: {
  110. title: '拼单管理',
  111. icon: 'el-icon-c-scale-to-original'
  112. }
  113. },
  114. {
  115. path: '/participants-manage',
  116. name: 'participants-manage',
  117. component: () => import('@/views/crowd-funding-otrder-system/main/participants-manage/index'),
  118. meta: {
  119. title: '参与人管理',
  120. icon: 'el-icon-s-custom'
  121. }
  122. },
  123. {
  124. path: '/order-fulfillment',
  125. name: 'order-fulfillment',
  126. component: () => import('@/views/crowd-funding-otrder-system/main/order-fulfillment/index'),
  127. meta: {
  128. title: '订单执行',
  129. icon: 'el-icon-s-ticket'
  130. }
  131. },
  132. {
  133. path: '/customer-statistics',
  134. name: 'customer-statistics',
  135. component: () => import('@/views/crowd-funding-otrder-system/main/customer-statistics/index'),
  136. meta: {
  137. title: '客户统计',
  138. icon: 'el-icon-s-data'
  139. }
  140. },
  141. {
  142. path: '/rules-setting',
  143. name: 'rules-setting',
  144. component: () => import('@/views/crowd-funding-otrder-system/main/rules-setting/index'),
  145. meta: {
  146. title: '规则设置',
  147. icon: 'el-icon-s-unfold'
  148. }
  149. },
  150. ]
  151. },
  152. // 公众号消息管理
  153. {
  154. path: 'message-manage',
  155. component: Layout,
  156. redirect: '/wechat-fans',
  157. name: 'message-manage',
  158. meta: {
  159. title: '消息管理',
  160. icon: 'el-icon-message-solid'
  161. },
  162. children: [
  163. {
  164. path: '/wechat-fans',
  165. name: 'wechat-fans',
  166. component: () => import('@/views/message-manage/main/wechat-fans/index'),
  167. meta: {
  168. title: '公众号粉丝',
  169. icon: 'el-icon-user-solid'
  170. }
  171. },
  172. {
  173. path: '/add-articles',
  174. name: 'add-articles',
  175. component: () => import('@/views/message-manage/main/add-articles/index'),
  176. meta: {
  177. title: '添加文章',
  178. icon: 'el-icon-edit'
  179. }
  180. },
  181. {
  182. path: '/add-mass',
  183. name: 'add-mass',
  184. component: () => import('@/views/message-manage/main/add-mass/index'),
  185. meta: {
  186. title: '添加群发',
  187. icon: 'el-icon-s-promotion'
  188. }
  189. },
  190. {
  191. path: '/mass-list',
  192. name: 'mass-list',
  193. component: () => import('@/views/message-manage/main/mass-list/index'),
  194. meta: {
  195. title: '群发列表',
  196. icon: 'el-icon-document'
  197. }
  198. },
  199. {
  200. path: '/unsubscribe-list',
  201. name: 'unsubscribe-list',
  202. component: () => import('@/views/message-manage/main/unsubscribe-list/index'),
  203. meta: {
  204. title: '退订列表',
  205. icon: 'el-icon-notebook-2'
  206. }
  207. },
  208. ]
  209. },
  210. // 系统管理 todo
  211. {
  212. path: '/system-manage',
  213. component: Layout,
  214. redirect: '/system-setting',
  215. name: 'system-manage',
  216. meta: {
  217. title: '系统管理',
  218. icon: 'el-icon-s-tools'
  219. },
  220. children: [
  221. {
  222. path: '/system-setting',
  223. name: 'system-setting',
  224. component: () => import('@/views/system-manage/main/system-setting/index'),
  225. meta: {
  226. title: '系统管理', //系统设置
  227. icon: 'el-icon-s-tools'
  228. }
  229. },
  230. ]
  231. },
  232. // 测试,例子
  233. /* {
  234. path: '/off-limits-manage',
  235. component: Layout,
  236. redirect: '/off-limits-manage/off-limits-type',
  237. name: 'off-limits-manage',
  238. meta: {
  239. title: '页面测试',
  240. icon: 'el-icon-s-help'
  241. },
  242. children: [
  243. {
  244. path: 'off-limits-type',
  245. name: 'off-limits-type',
  246. component: () => import('@/views/off-limits-manage/off-limits-main/off-limits-type/index'),
  247. meta: {
  248. title: '测试',
  249. icon: 'el-icon-s-order'
  250. }
  251. },
  252. ]
  253. }, */
  254. // 404 page must be placed at the end !!!
  255. {
  256. path: '*',
  257. redirect: '/404',
  258. hidden: true
  259. }
  260. ]
  261. export const asyncRoutes = [];
  262. const createRouter = () => new Router({
  263. // mode: 'history', // require service support
  264. scrollBehavior: () => ({
  265. y: 0
  266. }),
  267. routes: constantRoutes
  268. })
  269. const router = createRouter()
  270. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  271. export function resetRouter() {
  272. const newRouter = createRouter()
  273. router.matcher = newRouter.matcher // reset router
  274. }
  275. export default router