index.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. // 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;
  4. // detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
  5. Vue.use(Router)
  6. /* Layout */
  7. import Layout from '../views/layout/Layout'
  8. /**
  9. * hidden: true if `hidden:true` will not show in the sidebar(default is false)
  10. * alwaysShow: true if set true, will always show the root menu, whatever its child routes length
  11. * if not set alwaysShow, only more than one route under the children
  12. * it will becomes nested mode, otherwise not show the root menu
  13. * redirect: noredirect if `redirect:noredirect` will no redirect in the breadcrumb
  14. * name:'router-name' the name is used by <keep-alive> (must set!!!)
  15. * meta : {
  16. title: 'title' the name show in submenu and breadcrumb (recommend set)
  17. icon: 'svg-name' the icon show in the sidebar,
  18. AuthKey: 'roleManage:find', 该页面进入的权限码
  19. keepAlive: true, 该页面需要缓存(注意: name值必须设置 与组件内部name 一致 配合isback属性)
  20. isback : false
  21. }
  22. * AuthKey: 'roleManage:find' 该页面进入的权限码
  23. **/
  24. export const constantRouterMap = [
  25. {
  26. path: '/login',
  27. component: () => import('@/views/login'), hidden: true
  28. },
  29. {
  30. path: '/aj/**',
  31. component: () => import('@/views/report/aj'),
  32. hidden: true
  33. },
  34. {
  35. path: '/index',
  36. component: Layout,
  37. name: 'index',
  38. meta: {
  39. title: '首页',
  40. icon: 'iconhome2'
  41. },
  42. children: [
  43. {
  44. path: '',
  45. component: () => import('@/views/home/index'),
  46. meta: {
  47. title: '首页',
  48. icon: 'iconhome2',
  49. keepAlive: true,
  50. requireAuth: true
  51. }
  52. },
  53. ]
  54. },
  55. {
  56. path: '/access',
  57. name: 'access',
  58. component: Layout,
  59. meta: {
  60. title: '用户权限',
  61. icon: 'icondfzq-',
  62. requireAuth: true,
  63. permission: 'authorityManage|roleManage|userManage'
  64. },
  65. children: [
  66. {
  67. path: 'authority',
  68. name: 'authority',
  69. component: () => import('@/views/accessAuthority/index'),
  70. meta: {
  71. title: '权限管理',
  72. icon: 'iconquanxian',
  73. keepAlive: true,
  74. requireAuth: true,
  75. permission: 'authorityManage'
  76. }
  77. },
  78. {
  79. path: 'role',
  80. name: 'role',
  81. component: () => import('@/views/accessRole/index'),
  82. meta: {
  83. title: '角色管理',
  84. icon: 'iconjiaose1',
  85. keepAlive: true,
  86. requireAuth: true,
  87. permission: 'roleManage'
  88. }
  89. },
  90. {
  91. path: 'user',
  92. name: 'user',
  93. component: () => import('@/views/accessUser/index'),
  94. meta: {
  95. title: '用户管理',
  96. icon: 'iconyonghu',
  97. keepAlive: true,
  98. requireAuth: true,
  99. permission: 'userManage'
  100. }
  101. },
  102. ]
  103. },
  104. {
  105. path: '/report',
  106. name: 'report',
  107. component: Layout,
  108. meta: {
  109. title: '报表设计',
  110. icon: 'iconnavicon-ywcs',
  111. requireAuth: true,
  112. permission: 'datasourceManage|resultsetManage|reportManage|bigScreenManage'
  113. },
  114. children: [
  115. {
  116. path: 'datasource',
  117. name: 'datasource',
  118. component: () => import('@/views/report/datasource/index'),
  119. meta: {
  120. title: '数据源',
  121. icon: 'icondatabase',
  122. keepAlive: true,
  123. requireAuth: true,
  124. permission: 'datasourceManage'
  125. }
  126. },
  127. {
  128. path: 'resultset',
  129. name: 'resultset',
  130. component: () => import('@/views/report/resultset/index'),
  131. meta: {
  132. title: '数据集',
  133. icon: 'iconAPIwangguan',
  134. keepAlive: true,
  135. requireAuth: true,
  136. permission: 'resultsetManage'
  137. }
  138. },
  139. {
  140. path: 'report',
  141. name: 'reportIndex',
  142. component: () => import('@/views/report/report/index'),
  143. meta: {
  144. title: '报表管理',
  145. icon: 'iconnavicon-ywcs',
  146. keepAlive: true,
  147. requireAuth: true,
  148. permission: 'reportManage'
  149. }
  150. },
  151. {
  152. path: 'bigscreen',
  153. name: 'bigscreen',
  154. component: () => import('@/views/report/bigscreen/index'),
  155. meta: {
  156. title: '大屏报表',
  157. icon: 'iconchufaqipeizhi-hui',
  158. keepAlive: true,
  159. requireAuth: true,
  160. permission: 'bigScreenManage'
  161. },
  162. },
  163. {
  164. path: 'excelreport',
  165. name: 'excelreport',
  166. component: () => import('@/views/report/excelreport/index'),
  167. meta: {
  168. title: '表格报表',
  169. icon: 'iconliebiao',
  170. keepAlive: true,
  171. requireAuth: true,
  172. permission: 'excelManage'
  173. }
  174. },
  175. ]
  176. },
  177. {
  178. path: '/system',
  179. name: 'system',
  180. component: Layout,
  181. meta: {
  182. title: '系统设置',
  183. icon: 'iconshezhi',
  184. requireAuth: true,
  185. permission: 'fileManage|dictManage|dictItemManage'
  186. },
  187. children: [
  188. {
  189. path: 'file',
  190. name: 'file',
  191. component: () => import('@/views/file-management/index'),
  192. meta: {
  193. title: '文件管理',
  194. icon: 'iconfill_folder',
  195. keepAlive: true,
  196. requireAuth: true,
  197. permission: 'fileManage'
  198. }
  199. },
  200. {
  201. path: 'dict',
  202. name: 'dict',
  203. component: () => import('@/views/dict/index'),
  204. meta: {
  205. title: '数据字典',
  206. icon: 'iconzidian',
  207. keepAlive: true,
  208. requireAuth: true,
  209. permission: 'dictManage'
  210. }
  211. },
  212. {
  213. path: 'dictItem',
  214. name: 'dictItem',
  215. component: () => import('@/views/dict/dict-item'),
  216. hidden: true,
  217. meta: {
  218. title: '字典项',
  219. icon: 'iconzidianxiang',
  220. keepAlive: true,
  221. requireAuth: true,
  222. permission: 'dictItemManage'
  223. }
  224. },
  225. ]
  226. },
  227. {
  228. path: '/bigscreen/viewer',
  229. component: () => import('@/views/report/bigscreen/viewer'),
  230. hidden: true,
  231. meta: {
  232. requireAuth: true
  233. }
  234. },
  235. {
  236. path: '/bigscreen/designer',
  237. component: () => import('@/views/report/bigscreen/designer'),
  238. hidden: true,
  239. meta: {
  240. requireAuth: true
  241. }
  242. },
  243. {
  244. path: '/excelreport/viewer',
  245. component: () => import('@/views/report/excelreport/viewer'),
  246. hidden: true,
  247. meta: {
  248. requireAuth: true
  249. }
  250. },
  251. {
  252. path: '/excelreport/designer',
  253. component: () => import('@/views/report/excelreport/designer'),
  254. hidden: true,
  255. meta: {
  256. requireAuth: true
  257. }
  258. },
  259. {
  260. path: '/404',
  261. component: () => import('@/views/404'),
  262. hidden: true
  263. },
  264. {
  265. path: '*',
  266. redirect: '/login',
  267. hidden: true
  268. },
  269. ]
  270. export default new Router({
  271. scrollBehavior: () => ({ y: 0 }),
  272. routes: constantRouterMap
  273. })