index.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. import Vue from 'vue'
  2. import Router from 'vue-router'
  3. /* Layout */
  4. import Layout from '@/layout'
  5. Vue.use(Router)
  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 asyncRoutes = [
  30. {
  31. path: '/equipment',
  32. component: Layout,
  33. name: 'Passenger',
  34. redirect: '/equipment/passenger',
  35. meta: { icon: 'el-icon-pie-chart', title: '设备管理', authorities: ['equipment.passenger.find'] },
  36. children: [
  37. {
  38. path: 'passenger',
  39. name: 'EquipmentPassenger',
  40. component: () => import('@/views/equipment/passenger'),
  41. meta: { title: '景区客流数据采集系统', authorities: ['equipment.passenger.find'] }
  42. },
  43. {
  44. path: 'passenger/detail/:id',
  45. name: 'PassengerEquipmentDetail',
  46. hidden: true,
  47. component: () => import('@/views/equipment/passenger/Detail'),
  48. meta: { title: '景区客流数据采集系统' }
  49. }
  50. ]
  51. },
  52. {
  53. path: '/category',
  54. component: Layout,
  55. name: 'CulturalTourism',
  56. meta: {
  57. title: '平台数据对接',
  58. icon: 'el-icon-goods',
  59. authorities: ['category.organization.find', 'category.occupation.find', 'category.material.find', 'complaint.find']
  60. },
  61. children: [
  62. {
  63. path: 'organization',
  64. name: 'CulturalTourismOrganization',
  65. component: () => import('@/views/category/organization'),
  66. meta: { title: '机构目录管理', authorities: ['category.organization.find'] }
  67. },
  68. {
  69. path: 'occupation',
  70. name: 'CulturalTourismOccupation',
  71. component: () => import('@/views/category/occupation'),
  72. meta: { title: '岗位目录管理', authorities: ['category.occupation.find'] }
  73. },
  74. {
  75. path: 'material',
  76. name: 'CulturalTourismMaterial',
  77. component: () => import('@/views/category/material'),
  78. meta: { title: '物务资源目录管理', authorities: ['category.material.find'] }
  79. },
  80. {
  81. path: 'complaint',
  82. name: 'StatisticsComplaint',
  83. component: () => import('@/views/statistics/complaint'),
  84. meta: { title: '文旅投诉', authorities: ['complaint.find'] }
  85. },
  86. {
  87. path: 'solicitRewardsTravelReport',
  88. name: 'SolicitRewardsTravelReport',
  89. component: () => import('@/views/equipment/passenger/Detail'),
  90. meta: { title: '招徕奖励申报' }
  91. },
  92. {
  93. path: 'solicitRewardsHotelReport',
  94. name: 'solicitRewardsHotelReport',
  95. component: () => import('@/views/statistics/complaint'),
  96. meta: { title: '酒店申报记录' }
  97. },
  98. {
  99. path: 'solicitRewardsScenicReport',
  100. name: 'solicitRewardsScenicReport',
  101. component: () => import('@/views/statistics/complaint'),
  102. meta: { title: '景区申报记录' }
  103. }
  104. ]
  105. },
  106. {
  107. path: '/place',
  108. component: Layout,
  109. name: 'place',
  110. meta: {
  111. title: '文旅资源管理',
  112. icon: 'el-icon-receiving',
  113. authorities: ['upload.file.find', 'bz.media', 'place.category.find', 'place.base.info.find']
  114. },
  115. redirect: '/place/baseInfo',
  116. children: [
  117. {
  118. path: 'file',
  119. name: 'StatisticsFile',
  120. component: () => import('@/views/statistics/file'),
  121. meta: { title: '多媒体信息管理', authorities: ['upload.file.find'] }
  122. },
  123. {
  124. path: 'media',
  125. name: 'BzMedia',
  126. component: () => import('@/views/bz/media'),
  127. meta: { title: '多媒体资源管理', authorities: ['bz.media'] }
  128. },
  129. {
  130. path: 'baseInfo',
  131. name: 'PlaceBaseInfo',
  132. component: () => import('@/views/place/baseInfo'),
  133. meta: { title: '文旅资源管理', authorities: ['place.category.find'] }
  134. },
  135. {
  136. path: 'category',
  137. name: 'PlaceCategory',
  138. component: () => import('@/views/place/category'),
  139. meta: { title: '文旅资源分类管理', authorities: ['place.base.info.find'] }
  140. }
  141. ]
  142. },
  143. {
  144. path: '/sentiment/spider',
  145. component: Layout,
  146. name: 'SentimentSpider',
  147. meta: {
  148. title: '舆情监控',
  149. icon: 'el-icon-warning-outline',
  150. authorities: ['sentiment.spider.rule.find', 'sentiment.spider.event.find']
  151. },
  152. redirect: '/sentiment/spider/event',
  153. children: [
  154. {
  155. path: 'event',
  156. name: 'SentimentSpiderRuleEvent',
  157. component: () => import('@/views/sentiment/event'),
  158. meta: {
  159. title: '舆情事件管理',
  160. authorities: ['sentiment.spider.event.find']
  161. }
  162. },
  163. {
  164. path: 'result',
  165. name: 'SentimentSpiderRuleResult',
  166. component: () => import('@/views/sentiment/result'),
  167. meta: {
  168. title: '采集结果管理',
  169. authorities: ['sentiment.spider.event.find']
  170. }
  171. },
  172. {
  173. path: 'rule',
  174. name: 'SentimentSpiderRule',
  175. component: () => import('@/views/sentiment/rule'),
  176. meta: {
  177. title: '采集站点规则管理',
  178. authorities: ['sentiment.spider.rule.find']
  179. }
  180. }
  181. ]
  182. },
  183. {
  184. path: '/bz',
  185. component: Layout,
  186. name: 'Bz',
  187. meta: { title: '业务数据展示系统', icon: 'el-icon-help', authorities: ['bz.monitor', 'bz.consume', 'bz.resourceAnalysis', 'bz.touristAnalysis'] },
  188. redirect: '/bz/media',
  189. children: [
  190. {
  191. path: 'monitor',
  192. name: 'BzMonitor',
  193. component: () => import('@/views/bz/monitor'),
  194. meta: { title: '实时数据监测', authorities: ['bz.monitor'] }
  195. },
  196. {
  197. path: 'consume',
  198. name: 'BzConsume',
  199. component: () => import('@/views/bz/consume'),
  200. meta: { title: '文旅消费', authorities: ['bz.consume'] }
  201. },
  202. {
  203. path: 'resourceAnalysis',
  204. name: 'BzResourceAnalysis',
  205. component: () => import('@/views/bz/resourceAnalysis'),
  206. meta: { title: '文旅资源', authorities: ['bz.resourceAnalysis'] }
  207. },
  208. {
  209. path: 'touristAnalysis',
  210. name: 'BzTouristAnalysis',
  211. component: () => import('@/views/bz/touristAnalysis'),
  212. meta: { title: '游客分析', authorities: ['bz.touristAnalysis'] }
  213. }
  214. ]
  215. },
  216. {
  217. path: '/statistics',
  218. component: Layout,
  219. name: 'Statistics',
  220. meta: { title: '数据统计分析', icon: 'el-icon-s-data', authorities: ['place.base.info.gis.map'] },
  221. redirect: '/statistics/index',
  222. children: [
  223. {
  224. path: 'gis',
  225. name: 'BzBaseGis',
  226. component: () => import('@/views/place/gis'),
  227. meta: { title: '数据统计分析系统', authorities: ['place.base.info.gis.map'] }
  228. }
  229. ]
  230. },
  231. {
  232. path: '/appKey',
  233. component: Layout,
  234. name: 'AppKey',
  235. meta: { title: '业务数据开放管理', icon: 'el-icon-eleme', authorities: ['app.key.find', 'app.key.statistics', 'app.key.request.logs'] },
  236. redirect: '/appKey/index',
  237. children: [
  238. {
  239. path: 'index',
  240. name: 'AppKeyIndex',
  241. component: () => import('@/views/appKey/index'),
  242. meta: { title: '业务数据开放管理系统', authorities: ['app.key.find'] }
  243. },
  244. {
  245. path: 'statistics',
  246. name: 'AppKeyStatistics',
  247. component: () => import('@/views/appKey/Statistics'),
  248. meta: { title: '统计分析', authorities: ['app.key.statistics'] }
  249. },
  250. {
  251. path: 'requestLogs',
  252. name: 'AppKeyRequestLogs',
  253. component: () => import('@/views/appKey/requestLogs'),
  254. meta: { title: '调用日志', authorities: ['app.key.request.logs'] }
  255. },
  256. {
  257. path: 'openWebsite',
  258. name: 'OpenWebsite',
  259. component: () => import('@/views/appKey/requestLogs'),
  260. meta: { title: '文旅数据开放网站', authorities: ['app.key.request.logs'] }
  261. }
  262. ]
  263. },
  264. {
  265. path: '/user',
  266. component: Layout,
  267. name: 'User',
  268. meta: {
  269. title: '后台管理',
  270. icon: 'el-icon-user',
  271. authorities: ['oauth.user.find', 'oauth.role.find']
  272. },
  273. children: [
  274. {
  275. path: 'info',
  276. name: 'UserInfo',
  277. component: () => import('@/views/user/info'),
  278. meta: { title: '用户管理', authorities: ['oauth.user.find'] }
  279. },
  280. {
  281. path: 'role',
  282. name: 'UserRole',
  283. component: () => import('@/views/user/role'),
  284. meta: { title: '权限管理', authorities: ['oauth.role.find'] }
  285. }
  286. ]
  287. },
  288. {
  289. path: '/setting',
  290. component: Layout,
  291. name: 'Setting',
  292. meta: {
  293. title: '系统管理',
  294. icon: 'el-icon-setting',
  295. authorities: ['system.config.find', 'oauth.user.find.operate.log', 'oauth.user.find.login.log']
  296. },
  297. children: [
  298. {
  299. path: 'systemConfig',
  300. name: 'SettingSystemConfig',
  301. component: () => import('@/views/setting/systemConfig'),
  302. meta: { title: '系统设置', authorities: ['system.config.find'] }
  303. },
  304. {
  305. path: 'operateLog',
  306. name: 'UserOperateLog',
  307. component: () => import('@/views/user/operateLog'),
  308. meta: { title: '操作日志', authorities: ['oauth.user.find.operate.log'] }
  309. },
  310. {
  311. path: 'loginLog',
  312. name: 'UserLoginLog',
  313. component: () => import('@/views/user/loginLog'),
  314. meta: { title: '登录日志', authorities: ['oauth.user.find.login.log'] }
  315. }
  316. ]
  317. },
  318. // 404 page must be placed at the end !!!
  319. { path: '*', redirect: '/404', hidden: true }
  320. ]
  321. export const constantRoutes = [
  322. {
  323. path: '/login',
  324. component: () => import('@/views/login/index'),
  325. hidden: true
  326. },
  327. {
  328. path: '/api/docs',
  329. component: () => import('@/views/apidocs/index'),
  330. hidden: true
  331. },
  332. {
  333. path: '/404',
  334. component: () => import('@/views/404'),
  335. hidden: true
  336. },
  337. {
  338. path: '/',
  339. component: Layout,
  340. redirect: '/dashboard',
  341. children: [
  342. {
  343. path: 'dashboard',
  344. component: () => import('@/views/dashboard/index'),
  345. name: 'Dashboard',
  346. meta: { title: '控制面片', icon: 'dashboard', affix: true }
  347. }
  348. ]
  349. }
  350. ]
  351. const createRouter = () => new Router({
  352. mode: 'hash', // require service support
  353. scrollBehavior: () => ({ y: 0 }),
  354. routes: constantRoutes
  355. })
  356. const router = createRouter()
  357. // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
  358. export function resetRouter() {
  359. const newRouter = createRouter()
  360. router.matcher = newRouter.matcher // reset router
  361. }
  362. export default router