index.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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/bigScreenDesigner/share/shareLink'),
  32. hidden: true
  33. },
  34. {
  35. path: '/el/**',
  36. component: () => import('@/views/excelreport/share/shareLink'),
  37. hidden: true
  38. },
  39. {
  40. path: '/index',
  41. component: Layout,
  42. name: 'index',
  43. meta: {
  44. title: '首页',
  45. icon: 'iconhome2'
  46. },
  47. children: [
  48. {
  49. path: '',
  50. component: () => import('@/views/home/index'),
  51. meta: {
  52. title: '首页',
  53. icon: 'iconhome2',
  54. keepAlive: true,
  55. requireAuth: true
  56. }
  57. },
  58. ]
  59. },
  60. {
  61. path: '/access',
  62. name: 'access',
  63. component: Layout,
  64. meta: {
  65. title: '用户权限',
  66. icon: 'icondfzq-',
  67. requireAuth: true,
  68. permission: 'authorityManage|roleManage|userManage'
  69. },
  70. children: [
  71. {
  72. path: 'authority',
  73. name: 'authority',
  74. component: () => import('@/views/accessAuthority/index'),
  75. meta: {
  76. title: '权限管理',
  77. icon: 'iconquanxian',
  78. keepAlive: true,
  79. requireAuth: true,
  80. permission: 'authorityManage'
  81. }
  82. },
  83. {
  84. path: 'role',
  85. name: 'role',
  86. component: () => import('@/views/accessRole/index'),
  87. meta: {
  88. title: '角色管理',
  89. icon: 'iconjiaose1',
  90. keepAlive: true,
  91. requireAuth: true,
  92. permission: 'roleManage'
  93. }
  94. },
  95. {
  96. path: 'user',
  97. name: 'user',
  98. component: () => import('@/views/accessUser/index'),
  99. meta: {
  100. title: '用户管理',
  101. icon: 'iconyonghu',
  102. keepAlive: true,
  103. requireAuth: true,
  104. permission: 'userManage'
  105. }
  106. },
  107. ]
  108. },
  109. {
  110. path: '/report',
  111. name: 'report',
  112. component: Layout,
  113. meta: {
  114. title: '报表设计',
  115. icon: 'iconnavicon-ywcs',
  116. requireAuth: true,
  117. permission: 'datasourceManage|resultsetManage|reportManage|bigScreenManage|excelManage'
  118. },
  119. children: [
  120. {
  121. path: 'datasource',
  122. name: 'datasource',
  123. component: () => import('@/views/datasource/index'),
  124. meta: {
  125. title: '数据源',
  126. icon: 'icondatabase',
  127. keepAlive: true,
  128. requireAuth: true,
  129. permission: 'datasourceManage'
  130. }
  131. },
  132. {
  133. path: 'resultset',
  134. name: 'resultset',
  135. component: () => import('@/views/resultset/index'),
  136. meta: {
  137. title: '数据集',
  138. icon: 'iconAPIwangguan',
  139. keepAlive: true,
  140. requireAuth: true,
  141. permission: 'resultsetManage'
  142. }
  143. },
  144. {
  145. path: 'report',
  146. name: 'reportIndex',
  147. component: () => import('@/views/reportManage/index'),
  148. meta: {
  149. title: '报表管理',
  150. icon: 'iconnavicon-ywcs',
  151. keepAlive: true,
  152. requireAuth: true,
  153. permission: 'reportManage'
  154. }
  155. },
  156. {
  157. path: 'bigscreen',
  158. name: 'bigscreen',
  159. component: () => import('@/views/bigScreenDesigner/index'),
  160. meta: {
  161. title: '大屏报表',
  162. icon: 'iconchufaqipeizhi-hui',
  163. keepAlive: true,
  164. requireAuth: true,
  165. permission: 'bigScreenManage'
  166. },
  167. },
  168. {
  169. path: 'excelreport',
  170. name: 'excelreport',
  171. component: () => import('@/views/excelreport/index'),
  172. meta: {
  173. title: '表格报表',
  174. icon: 'iconliebiao',
  175. keepAlive: true,
  176. requireAuth: true,
  177. permission: 'excelManage'
  178. }
  179. },
  180. {
  181. path: 'shareManage',
  182. name: 'shareManage',
  183. component: () => import('@/views/shareManage/index'),
  184. meta: {
  185. title: '报表分享',
  186. icon: 'iconfenxiang1',
  187. keepAlive: true,
  188. requireAuth: true,
  189. permission: 'reportShareManage'
  190. }
  191. },
  192. ]
  193. },
  194. {
  195. path: '/system',
  196. name: 'system',
  197. component: Layout,
  198. meta: {
  199. title: '系统设置',
  200. icon: 'iconshezhi',
  201. requireAuth: true,
  202. permission: 'fileManage|dictManage|dictItemManage'
  203. },
  204. children: [
  205. {
  206. path: 'file',
  207. name: 'file',
  208. component: () => import('@/views/fileManagement/index'),
  209. meta: {
  210. title: '文件管理',
  211. icon: 'iconfill_folder',
  212. keepAlive: true,
  213. requireAuth: true,
  214. permission: 'fileManage'
  215. }
  216. },
  217. {
  218. path: 'dict',
  219. name: 'dict',
  220. component: () => import('@/views/dict/index'),
  221. meta: {
  222. title: '数据字典',
  223. icon: 'iconzidian',
  224. keepAlive: true,
  225. requireAuth: true,
  226. permission: 'dictManage'
  227. }
  228. },
  229. {
  230. path: 'dictItem',
  231. name: 'dictItem',
  232. component: () => import('@/views/dict/dict-item'),
  233. hidden: true,
  234. meta: {
  235. title: '字典项',
  236. icon: 'iconzidianxiang',
  237. keepAlive: true,
  238. requireAuth: true,
  239. permission: 'dictItemManage'
  240. }
  241. },
  242. ]
  243. },
  244. {
  245. path: '/bigscreen/viewer',
  246. component: () => import('@/views/bigscreenDesigner/viewer'),
  247. hidden: true,
  248. meta: {
  249. requireAuth: true
  250. }
  251. },
  252. {
  253. path: '/bigscreen/designer',
  254. component: () => import('@/views/bigscreenDesigner/designer'),
  255. hidden: true,
  256. meta: {
  257. requireAuth: true
  258. }
  259. },
  260. {
  261. path: '/excelreport/viewer',
  262. component: () => import('@/views/excelreport/viewer'),
  263. hidden: true,
  264. meta: {
  265. requireAuth: true
  266. }
  267. },
  268. {
  269. path: '/excelreport/designer',
  270. component: () => import('@/views/excelreport/designer'),
  271. hidden: true,
  272. meta: {
  273. requireAuth: true
  274. }
  275. },
  276. // 重写大屏
  277. {
  278. path: '/screenDesigner',
  279. component: () => import('@/views/screenDesigner/index'),
  280. name: 'screenDesigner',
  281. },
  282. {
  283. path: '/screen/preview',
  284. component: () => import('@/views/screenDesigner/preview'),
  285. hidden: true,
  286. meta: {
  287. requireAuth: true
  288. }
  289. },
  290. {
  291. path: '/404',
  292. component: () => import('@/views/404'),
  293. hidden: true
  294. },
  295. {
  296. path: '*',
  297. redirect: '/login',
  298. hidden: true
  299. },
  300. ]
  301. export default new Router({
  302. scrollBehavior: () => ({ y: 0 }),
  303. routes: constantRouterMap
  304. })