import Vue from 'vue' import Router from 'vue-router' /* Layout */ import Layout from '@/layout' Vue.use(Router) /** * Note: sub-menu only appear when route children.length >= 1 * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html * * hidden: true if set true, item will not show in the sidebar(default is false) * alwaysShow: true if set true, will always show the root menu * if not set alwaysShow, when item has more than one children route, * it will becomes nested mode, otherwise not show the root menu * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb * name:'router-name' the name is used by (must set!!!) * meta : { roles: ['admin','editor'] control the page roles (you can set multiple roles) title: 'title' the name show in sidebar and breadcrumb (recommend set) icon: 'svg-name'/'el-icon-x' the icon show in the sidebar breadcrumb: false if set false, the item will hidden in breadcrumb(default is true) activeMenu: '/example/list' if set path, the sidebar will highlight the path you set } */ /** * constantRoutes * a base page that does not have permission requirements * all roles can be accessed */ export const asyncRoutes = [ { path: '/equipment', component: Layout, name: 'Passenger', redirect: '/equipment/passenger', meta: { icon: 'el-icon-pie-chart', title: '设备管理', authorities: ['equipment.passenger.find'] }, children: [ { path: 'passenger', name: 'EquipmentPassenger', component: () => import('@/views/equipment/passenger'), meta: { title: '景区客流数据采集系统', authorities: ['equipment.passenger.find'] } }, { path: 'passenger/detail/:id', name: 'PassengerEquipmentDetail', hidden: true, component: () => import('@/views/equipment/passenger/Detail'), meta: { title: '景区客流数据采集系统' } } ] }, { path: '/category', component: Layout, name: 'CulturalTourism', meta: { title: '平台数据对接', icon: 'el-icon-goods', authorities: ['category.organization.find', 'category.occupation.find', 'category.material.find', 'complaint.find'] }, children: [ { path: 'organization', name: 'CulturalTourismOrganization', component: () => import('@/views/category/organization'), meta: { title: '机构目录管理', authorities: ['category.organization.find'] } }, { path: 'occupation', name: 'CulturalTourismOccupation', component: () => import('@/views/category/occupation'), meta: { title: '岗位目录管理', authorities: ['category.occupation.find'] } }, { path: 'material', name: 'CulturalTourismMaterial', component: () => import('@/views/category/material'), meta: { title: '物务资源目录管理', authorities: ['category.material.find'] } }, { path: 'complaint', name: 'StatisticsComplaint', component: () => import('@/views/statistics/complaint'), meta: { title: '文旅投诉', authorities: ['complaint.find'] } }, { path: 'solicitRewardsTravelReport', name: 'SolicitRewardsTravelReport', component: () => import('@/views/equipment/passenger/Detail'), meta: { title: '招徕奖励申报' } }, { path: 'solicitRewardsHotelReport', name: 'solicitRewardsHotelReport', component: () => import('@/views/statistics/complaint'), meta: { title: '酒店申报记录' } }, { path: 'solicitRewardsScenicReport', name: 'solicitRewardsScenicReport', component: () => import('@/views/statistics/complaint'), meta: { title: '景区申报记录' } } ] }, { path: '/place', component: Layout, name: 'place', meta: { title: '文旅资源管理', icon: 'el-icon-receiving', authorities: ['upload.file.find', 'bz.media', 'place.category.find', 'place.base.info.find'] }, redirect: '/place/baseInfo', children: [ { path: 'file', name: 'StatisticsFile', component: () => import('@/views/statistics/file'), meta: { title: '多媒体信息管理', authorities: ['upload.file.find'] } }, { path: 'media', name: 'BzMedia', component: () => import('@/views/bz/media'), meta: { title: '多媒体资源管理', authorities: ['bz.media'] } }, { path: 'baseInfo', name: 'PlaceBaseInfo', component: () => import('@/views/place/baseInfo'), meta: { title: '文旅资源管理', authorities: ['place.category.find'] } }, { path: 'category', name: 'PlaceCategory', component: () => import('@/views/place/category'), meta: { title: '文旅资源分类管理', authorities: ['place.base.info.find'] } } ] }, { path: '/sentiment/spider', component: Layout, name: 'SentimentSpider', meta: { title: '舆情监控', icon: 'el-icon-warning-outline', authorities: ['sentiment.spider.rule.find', 'sentiment.spider.event.find'] }, redirect: '/sentiment/spider/event', children: [ { path: 'event', name: 'SentimentSpiderRuleEvent', component: () => import('@/views/sentiment/event'), meta: { title: '舆情事件管理', authorities: ['sentiment.spider.event.find'] } }, { path: 'result', name: 'SentimentSpiderRuleResult', component: () => import('@/views/sentiment/result'), meta: { title: '采集结果管理', authorities: ['sentiment.spider.event.find'] } }, { path: 'rule', name: 'SentimentSpiderRule', component: () => import('@/views/sentiment/rule'), meta: { title: '采集站点规则管理', authorities: ['sentiment.spider.rule.find'] } } ] }, { path: '/bz', component: Layout, name: 'Bz', meta: { title: '业务数据展示系统', icon: 'el-icon-help', authorities: ['bz.monitor', 'bz.consume', 'bz.resourceAnalysis', 'bz.touristAnalysis'] }, redirect: '/bz/media', children: [ { path: 'monitor', name: 'BzMonitor', component: () => import('@/views/bz/monitor'), meta: { title: '实时数据监测', authorities: ['bz.monitor'] } }, { path: 'consume', name: 'BzConsume', component: () => import('@/views/bz/consume'), meta: { title: '文旅消费', authorities: ['bz.consume'] } }, { path: 'resourceAnalysis', name: 'BzResourceAnalysis', component: () => import('@/views/bz/resourceAnalysis'), meta: { title: '文旅资源', authorities: ['bz.resourceAnalysis'] } }, { path: 'touristAnalysis', name: 'BzTouristAnalysis', component: () => import('@/views/bz/touristAnalysis'), meta: { title: '游客分析', authorities: ['bz.touristAnalysis'] } } ] }, { path: '/statistics', component: Layout, name: 'Statistics', meta: { title: '数据统计分析', icon: 'el-icon-s-data', authorities: ['place.base.info.gis.map'] }, redirect: '/statistics/index', children: [ { path: 'gis', name: 'BzBaseGis', component: () => import('@/views/place/gis'), meta: { title: '数据统计分析系统', authorities: ['place.base.info.gis.map'] } } ] }, { path: '/appKey', component: Layout, name: 'AppKey', meta: { title: '业务数据开放管理', icon: 'el-icon-eleme', authorities: ['app.key.find', 'app.key.statistics', 'app.key.request.logs'] }, redirect: '/appKey/index', children: [ { path: 'index', name: 'AppKeyIndex', component: () => import('@/views/appKey/index'), meta: { title: '业务数据开放管理系统', authorities: ['app.key.find'] } }, { path: 'statistics', name: 'AppKeyStatistics', component: () => import('@/views/appKey/Statistics'), meta: { title: '统计分析', authorities: ['app.key.statistics'] } }, { path: 'requestLogs', name: 'AppKeyRequestLogs', component: () => import('@/views/appKey/requestLogs'), meta: { title: '调用日志', authorities: ['app.key.request.logs'] } }, { path: 'openWebsite', name: 'OpenWebsite', component: () => import('@/views/appKey/requestLogs'), meta: { title: '文旅数据开放网站', authorities: ['app.key.request.logs'] } } ] }, { path: '/user', component: Layout, name: 'User', meta: { title: '后台管理', icon: 'el-icon-user', authorities: ['oauth.user.find', 'oauth.role.find'] }, children: [ { path: 'info', name: 'UserInfo', component: () => import('@/views/user/info'), meta: { title: '用户管理', authorities: ['oauth.user.find'] } }, { path: 'role', name: 'UserRole', component: () => import('@/views/user/role'), meta: { title: '权限管理', authorities: ['oauth.role.find'] } } ] }, { path: '/setting', component: Layout, name: 'Setting', meta: { title: '系统管理', icon: 'el-icon-setting', authorities: ['system.config.find', 'oauth.user.find.operate.log', 'oauth.user.find.login.log'] }, children: [ { path: 'systemConfig', name: 'SettingSystemConfig', component: () => import('@/views/setting/systemConfig'), meta: { title: '系统设置', authorities: ['system.config.find'] } }, { path: 'operateLog', name: 'UserOperateLog', component: () => import('@/views/user/operateLog'), meta: { title: '操作日志', authorities: ['oauth.user.find.operate.log'] } }, { path: 'loginLog', name: 'UserLoginLog', component: () => import('@/views/user/loginLog'), meta: { title: '登录日志', authorities: ['oauth.user.find.login.log'] } } ] }, // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } ] export const constantRoutes = [ { path: '/login', component: () => import('@/views/login/index'), hidden: true }, { path: '/api/docs', component: () => import('@/views/apidocs/index'), hidden: true }, { path: '/404', component: () => import('@/views/404'), hidden: true }, { path: '/', component: Layout, redirect: '/dashboard', children: [ { path: 'dashboard', component: () => import('@/views/dashboard/index'), name: 'Dashboard', meta: { title: '控制面片', icon: 'dashboard', affix: true } } ] } ] const createRouter = () => new Router({ mode: 'hash', // require service support scrollBehavior: () => ({ y: 0 }), routes: constantRoutes }) const router = createRouter() // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 export function resetRouter() { const newRouter = createRouter() router.matcher = newRouter.matcher // reset router } export default router