Нет описания

index.js 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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: '/example',
  127. // component: Layout,
  128. // redirect: '/example/table',
  129. // name: 'Example',
  130. // meta: { title: 'Example', icon: 'example' },
  131. // children: [
  132. // {
  133. // path: 'table',
  134. // name: 'Table',
  135. // component: _import('table/index'),
  136. // meta: { title: 'Table', icon: 'table' }
  137. // },
  138. // {
  139. // path: 'tree',
  140. // name: 'Tree',
  141. // component: _import('tree/index'),
  142. // meta: { title: 'Tree', icon: 'tree' }
  143. // }
  144. // ]
  145. // },
  146. // {
  147. // path: '/form',
  148. // component: Layout,
  149. // children: [
  150. // {
  151. // path: 'index',
  152. // name: 'Form',
  153. // component: _import('form/index'),
  154. // meta: { title: 'Form', icon: 'form' }
  155. // }
  156. // ]
  157. // },
  158. { path: '*', redirect: '/404', hidden: true }
  159. ]
  160. export default new Router({
  161. // mode: 'history', //后端支持可开
  162. scrollBehavior: () => ({ y: 0 }),
  163. routes: constantRouterMap
  164. })