No Description

index.js 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. const _import = require('./_import_' + process.env.NODE_ENV)
  4. // in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
  5. // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
  6. Vue.use(Router)
  7. /* Layout */
  8. import Layout from '../views/layout/Layout'
  9. /**
  10. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  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('login/index'), hidden: true },
  20. { path: '/401', component: _import('errorPage/401'), hidden: true },
  21. { path: '/404', component: _import('errorPage/404'), hidden: true },
  22. // { path: '/game', component: _import('gambleGameBucketOpen/index'), hidden: true },
  23. // { path: '/game/round', component: _import('gambleGameBucketOpen/detail/index'), hidden: true },
  24. {
  25. path: '',
  26. component: Layout,
  27. redirect: 'dashboard',
  28. name: 'Dashboard',
  29. children: [
  30. {
  31. path: 'dashboard',
  32. name: 'dashboard',
  33. component: _import('dashboard/index'),
  34. meta: {
  35. title: '首頁',
  36. icon: 'dashboard',
  37. noCache: true
  38. // role: ['dd']
  39. }
  40. }
  41. ]
  42. },
  43. {
  44. path: '/room',
  45. component: Layout,
  46. redirect: '/room/index',
  47. name: 'Room',
  48. children: [
  49. {
  50. path: 'index',
  51. component: _import('room/index'),
  52. name: 'room',
  53. // redirect: '/round/index/gambleMember/index',
  54. meta: {
  55. title: '房間管理',
  56. icon: 'form'
  57. // role: ['dd']
  58. },
  59. children: [
  60. {
  61. path: '/room/index/gambleMember/index',
  62. name: 'GambleMember',
  63. component: _import('room/gambleMember/index'),
  64. hidden: true,
  65. meta: {
  66. title: '會員管理'
  67. // role: ['dd']
  68. },
  69. children: [
  70. {
  71. path: '/room/index/gambleMember/index/gameHistory',
  72. name: 'gameHistory',
  73. component: _import('room/gameHistory/index'),
  74. hidden: true,
  75. meta: {
  76. title: '歷史紀錄'
  77. // role: ['dd']
  78. }
  79. },
  80. {
  81. path: '/room/index/gambleMember/index/chipsHistory',
  82. name: 'chipsHistory',
  83. component: _import('room/chipsHistory/index'),
  84. hidden: true,
  85. meta: {
  86. title: '上下分紀錄'
  87. // role: ['dd']
  88. }
  89. }
  90. ]
  91. }
  92. ]
  93. }
  94. ]
  95. },
  96. {
  97. path: '/gambleGameBucket',
  98. component: Layout,
  99. redirect: '/gambleGameBucket/index',
  100. children: [
  101. {
  102. path: 'index',
  103. name: 'GambleGameBucket',
  104. component: _import('gambleGameBucket/index'),
  105. meta: {
  106. title: '每場紀錄',
  107. icon: 'table'
  108. // role: ['dd']
  109. },
  110. children: [
  111. {
  112. path: '/gambleGameBucket/index/detail',
  113. name: 'GambleGameBucketDetail',
  114. component: _import('gambleGameBucket/detail/index'),
  115. hidden: true,
  116. meta: {
  117. title: '詳細紀錄'
  118. // role: ['dd']
  119. }
  120. }
  121. ]
  122. }
  123. ]
  124. },
  125. {
  126. path: '/agent',
  127. component: Layout,
  128. redirect: '/agent/index',
  129. children: [
  130. {
  131. path: 'index',
  132. name: 'AgentManagement',
  133. component: _import('agnetManagement/index'),
  134. meta: {
  135. title: '代理商管理',
  136. icon: 'table'
  137. // role: ['dd']
  138. },
  139. children: [
  140. {
  141. path: '/agent/index/gambleMemberManagement',
  142. name: 'GambleMemberManagement',
  143. component: _import('agnetManagement/gambleMemberManagement/index'),
  144. hidden: true,
  145. meta: {
  146. title: '會員管理'
  147. // role: ['dd']
  148. },
  149. children: [
  150. {
  151. path: '/agent/index/gambleMemberManagement/index/gameHistory',
  152. name: 'AgnentMemberGameHistory',
  153. component: _import('room/gameHistory/index'),
  154. hidden: true,
  155. meta: {
  156. title: '歷史紀錄'
  157. // role: ['dd']
  158. }
  159. }
  160. ]
  161. }
  162. ]
  163. }
  164. ]
  165. },
  166. // {
  167. // path: '/example',
  168. // component: Layout,
  169. // redirect: '/example/table',
  170. // name: 'Example',
  171. // meta: { title: 'Example', icon: 'example' },
  172. // children: [
  173. // {
  174. // path: 'table',
  175. // name: 'Table',
  176. // component: _import('table/index'),
  177. // meta: { title: 'Table', icon: 'table' }
  178. // },
  179. // {
  180. // path: 'tree',
  181. // name: 'Tree',
  182. // component: _import('tree/index'),
  183. // meta: { title: 'Tree', icon: 'tree' }
  184. // }
  185. // ]
  186. // },
  187. // {
  188. // path: '/form',
  189. // component: Layout,
  190. // children: [
  191. // {
  192. // path: 'index',
  193. // name: 'Form',
  194. // component: _import('form/index'),
  195. // meta: { title: 'Form', icon: 'form' }
  196. // }
  197. // ]
  198. // },
  199. { path: '*', redirect: '/404', hidden: true }
  200. ]
  201. export default new Router({
  202. // mode: 'history', //后端支持可开
  203. scrollBehavior: () => ({ y: 0 }),
  204. routes: constantRouterMap
  205. })