天波用户运营管理后台系统
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.

321 lines
8.2KB

  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. hidden: true,
  70. meta: {
  71. title: '收单系统',
  72. icon: 'el-icon-s-help'
  73. },
  74. children: [
  75. {
  76. path: '/collection-order-list',
  77. name: 'collection-order-list',
  78. component: () => import('@/views/collection-order-system/main/collection-order-list/index'),
  79. meta: {
  80. title: '收单系统', //收单列表
  81. icon: 'el-icon-s-order'
  82. }
  83. },
  84. ]
  85. },
  86. // 流量统计 todo
  87. {
  88. path: '/traffic-statistics',
  89. component: Layout,
  90. redirect: '/ssjl-statistics',
  91. name: 'traffic-statistics',
  92. hidden: false,
  93. meta: {
  94. title: '流量统计',
  95. icon: 'el-icon-data-line'
  96. },
  97. children: [
  98. {
  99. path: '/ssjl-statistics',
  100. name: 'ssjl-statistics',
  101. component: () => import('@/views/traffic-statistics/main/ssjl-statistics/index'),
  102. meta: {
  103. title: '家长端流量统计', //收单列表
  104. icon: 'el-icon-office-building'
  105. }
  106. },
  107. ]
  108. },
  109. // 众筹拼单系统
  110. {
  111. path: 'crowd-funding-otrder-system',
  112. component: Layout,
  113. redirect: '/package-manage',
  114. name: 'crowd-funding-otrder-system',
  115. meta: {
  116. title: '众筹拼单系统',
  117. icon: 'el-icon-s-help'
  118. },
  119. children: [
  120. {
  121. path: '/package-manage',
  122. name: 'package-manage',
  123. component: () => import('@/views/crowd-funding-otrder-system/main/package-manage/index'),
  124. meta: {
  125. title: '套餐管理',
  126. icon: 'el-icon-burger'
  127. }
  128. },
  129. {
  130. path: '/crowd-funding-otrder-manage',
  131. name: 'crowd-funding-otrder-manage',
  132. component: () => import('@/views/crowd-funding-otrder-system/main/crowd-funding-otrder-manage/index'),
  133. meta: {
  134. title: '拼单管理',
  135. icon: 'el-icon-c-scale-to-original'
  136. }
  137. },
  138. {
  139. path: '/participants-manage',
  140. name: 'participants-manage',
  141. component: () => import('@/views/crowd-funding-otrder-system/main/participants-manage/index'),
  142. meta: {
  143. title: '参与人管理',
  144. icon: 'el-icon-s-custom'
  145. }
  146. },
  147. {
  148. path: '/order-fulfillment',
  149. name: 'order-fulfillment',
  150. component: () => import('@/views/crowd-funding-otrder-system/main/order-fulfillment/index'),
  151. meta: {
  152. title: '订单执行',
  153. icon: 'el-icon-s-ticket'
  154. }
  155. },
  156. {
  157. path: '/customer-statistics',
  158. name: 'customer-statistics',
  159. component: () => import('@/views/crowd-funding-otrder-system/main/customer-statistics/index'),
  160. meta: {
  161. title: '客户统计',
  162. icon: 'el-icon-s-data'
  163. }
  164. },
  165. {
  166. path: '/rules-setting',
  167. name: 'rules-setting',
  168. component: () => import('@/views/crowd-funding-otrder-system/main/rules-setting/index'),
  169. meta: {
  170. title: '规则设置',
  171. icon: 'el-icon-s-unfold'
  172. }
  173. },
  174. ]
  175. },
  176. // 公众号消息管理
  177. {
  178. path: 'message-manage',
  179. component: Layout,
  180. redirect: '/wechat-fans',
  181. name: 'message-manage',
  182. meta: {
  183. title: '消息发送系统',
  184. icon: 'el-icon-message-solid'
  185. },
  186. children: [
  187. {
  188. path: '/wechat-fans',
  189. name: 'wechat-fans',
  190. component: () => import('@/views/message-manage/main/wechat-fans/index'),
  191. meta: {
  192. title: '公众号粉丝',
  193. icon: 'el-icon-user-solid'
  194. }
  195. },
  196. {
  197. path: '/add-articles',
  198. name: 'add-articles',
  199. component: () => import('@/views/message-manage/main/add-articles/index'),
  200. meta: {
  201. title: '添加文章',
  202. icon: 'el-icon-edit'
  203. }
  204. },
  205. {
  206. path: '/add-mass',
  207. name: 'add-mass',
  208. component: () => import('@/views/message-manage/main/add-mass/index'),
  209. meta: {
  210. title: '添加群发',
  211. icon: 'el-icon-s-promotion'
  212. }
  213. },
  214. {
  215. path: '/mass-list',
  216. name: 'mass-list',
  217. component: () => import('@/views/message-manage/main/mass-list/index'),
  218. meta: {
  219. title: '群发列表',
  220. icon: 'el-icon-document'
  221. }
  222. },
  223. {
  224. path: '/unsubscribe-list',
  225. name: 'unsubscribe-list',
  226. component: () => import('@/views/message-manage/main/unsubscribe-list/index'),
  227. meta: {
  228. title: '退订列表',
  229. icon: 'el-icon-notebook-2'
  230. }
  231. },
  232. ]
  233. },
  234. // 系统管理 todo
  235. {
  236. path: '/system-manage',
  237. component: Layout,
  238. redirect: '/system-setting',
  239. name: 'system-manage',
  240. meta: {
  241. title: '系统管理',
  242. icon: 'el-icon-s-tools'
  243. },
  244. children: [
  245. {
  246. path: '/system-setting',
  247. name: 'system-setting',
  248. component: () => import('@/views/system-manage/main/system-setting/index'),
  249. meta: {
  250. title: '系统管理', //系统设置
  251. icon: 'el-icon-s-tools'
  252. }
  253. },
  254. ]
  255. },
  256. // 测试,例子
  257. /* {
  258. path: '/off-limits-manage',
  259. component: Layout,
  260. redirect: '/off-limits-manage/off-limits-type',
  261. name: 'off-limits-manage',
  262. meta: {
  263. title: '页面测试',
  264. icon: 'el-icon-s-help'
  265. },
  266. children: [
  267. {
  268. path: 'off-limits-type',
  269. name: 'off-limits-type',
  270. component: () => import('@/views/off-limits-manage/off-limits-main/off-limits-type/index'),
  271. meta: {
  272. title: '测试',
  273. icon: 'el-icon-s-order'
  274. }
  275. },
  276. ]
  277. }, */
  278. // 404 page must be placed at the end !!!
  279. {
  280. path: '*',
  281. redirect: '/404',
  282. hidden: true
  283. }
  284. ]
  285. export const asyncRoutes = [];
  286. const createRouter = () => new Router({
  287. // mode: 'history', // require service support
  288. scrollBehavior: () => ({
  289. y: 0
  290. }),
  291. routes: constantRoutes
  292. })
  293. const router = createRouter()
  294. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  295. export function resetRouter() {
  296. const newRouter = createRouter()
  297. router.matcher = newRouter.matcher // reset router
  298. }
  299. export default router