import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) /* Layout */ import Layout from '@/layout' /** * 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 constantRoutes = [{ path: '/login', component: () => import ('@/views/login/index'), hidden: true }, { path: '/404', component: () => import ('@/views/404'), hidden: true }, // my start { path: '/', component: Layout, redirect: '/alarmManage', children: [{ path: 'alarmManage', name: 'alarmManage', component: () => import ('@/views/alarmManage/index'), //aa页面路径 meta: { title: '告警管理', icon: 'alarmManage' } //aa title 菜单标题&meta title }] }, { path: '/siteManage', component: Layout, redirect: '/siteManage/basicInfo', name: 'siteManage', meta: { title: '站点管理', icon: 'siteManage' }, children: [{ path: 'basicInfo', name: 'basicInfo', component: () => import ('@/views/siteManage/basicInfo/index'), meta: { title: '基本信息' } }, { path: 'watchDog', name: 'watchDog', component: () => import ('@/views/siteManage/watchDog/index'), meta: { title: '监控设备' } }, { path: 'variableList', name: 'variableList', component: () => import ('@/views/siteManage/variableList/index'), meta: { title: '变量列表' } }, { path: 'rateConfig', name: 'rateConfig', component: () => import ('@/views/siteManage/rateConfig/index'), meta: { title: '费率配置' } }, { path: 'camera', name: 'camera', component: () => import ('@/views/siteManage/camera/index'), meta: { title: '摄像头' } }, { path: 'powerScore', name: 'powerScore', component: () => import ('@/views/siteManage/powerScore/index'), meta: { title: '电能质量评分' } } ] }, { path: '/stationManage', component: Layout, children: [{ path: 'index', name: 'StationManage', component: () => import ('@/views/stationManage/index'), meta: { title: '台区管理', icon: 'stationManage' } }] }, { path: '/deviceManage', component: Layout, redirect: '/deviceManage/powerEquip', name: 'deviceManage', meta: { title: '设备管理', icon: 'deviceManage' }, children: [{ path: 'powerEquip', name: 'powerEquip', component: () => import ('@/views/deviceManage/powerEquip/index'), meta: { title: '电力监测设备' } }, { path: 'videoEquip', name: 'videoEquip', component: () => import ('@/views/deviceManage/videoEquip/index'), meta: { title: '视频监测设备' } }, { path: 'communicateEquip', name: 'communicateEquip', component: () => import ('@/views/deviceManage/communicateEquip/index'), meta: { title: '通信设备' } }, { path: 'channelList', name: 'channelList', component: () => import ('@/views/deviceManage/channelList/index'), meta: { title: '通道列表' } }, { path: 'attribTemplate', name: 'attribTemplate', component: () => import ('@/views/deviceManage/attribTemplate/index'), meta: { title: '属性模板' } } ] }, { path: '/dataManage', component: Layout, redirect: '/dataManage/sameAnalysis', name: 'dataManage', meta: { title: '数据管理', icon: 'dataManage' }, children: [{ path: 'sameAnalysis', name: 'sameAnalysis', component: () => import ('@/views/dataManage/sameAnalysis/index'), meta: { title: '同比分析报表' } }, { path: 'chainAnalysis', name: 'chainAnalysis', component: () => import ('@/views/dataManage/chainAnalysis/index'), meta: { title: '环比分析报表' } }, { path: 'handOpera', name: 'handOpera', component: () => import ('@/views/dataManage/handOpera/index'), meta: { title: '手动抄表' } }, { path: 'energyReport', name: 'energyReport', component: () => import ('@/views/dataManage/energyReport/index'), meta: { title: '用能月报' } }, { path: 'demandAnalysis', name: 'demandAnalysis', component: () => import ('@/views/dataManage/demandAnalysis/index'), meta: { title: '需量分析' } }, { path: 'consumConfig', name: 'consumConfig', component: () => import ('@/views/dataManage/consumConfig/index'), meta: { title: '能耗分析配置' } } ] }, { path: '/powerQuality', component: Layout, redirect: '/powerQuality/harmonicReport', name: 'powerQuality', meta: { title: '电能质量', icon: 'powerQuality' }, children: [{ path: 'harmonicReport', name: 'harmonicReport', component: () => import ('@/views/powerQuality/harmonicReport/index'), meta: { title: '谐波报表' } }, { path: 'realTimeMonitoring', name: 'realTimeMonitoring', component: () => import ('@/views/powerQuality/realTimeMonitoring/index'), meta: { title: '实时监测' } }, { path: 'asseReport', name: 'asseReport', component: () => import ('@/views/powerQuality/asseReport/index'), meta: { title: '评估报告' } }, { path: 'unbalanceAnalysis', name: 'unbalanceAnalysis', component: () => import ('@/views/powerQuality/unbalanceAnalysis/index'), meta: { title: '三相不平衡分析' } }, ] }, { path: '/monthReport', component: Layout, children: [{ path: 'index', name: 'monthReport', component: () => import ('@/views/monthReport/index'), meta: { title: '月度报告', icon: 'monthReport' } }] }, { path: '/planOutage', component: Layout, children: [{ path: 'index', name: 'planOutage', component: () => import ('@/views/planOutage/index'), meta: { title: '计划停电', icon: 'planOutage' } }] }, { path: '/patrolManage', component: Layout, redirect: '/patrolManage/patrolPlan', name: 'patrolManage', meta: { title: '巡检管理', icon: 'patrolManage' }, children: [{ path: 'patrolPlan', name: 'patrolPlan', component: () => import ('@/views/patrolManage/patrolPlan/index'), meta: { title: '巡检计划' } }, { path: 'patrolRecord', name: 'patrolRecord', component: () => import ('@/views/patrolManage/patrolRecord/index'), meta: { title: '巡检记录' } }, { path: 'patrolContent', name: 'patrolContent', component: () => import ('@/views/patrolManage/patrolContent/index'), meta: { title: '巡检内容' } }, { path: 'checkEntries', name: 'checkEntries', component: () => import ('@/views/patrolManage/checkEntries/index'), meta: { title: '检查条目' } }, ] }, { path: '/operManage', component: Layout, redirect: '/operManage/siteAchives', name: 'operManage', meta: { title: '运维管理', icon: 'operManage' }, children: [{ path: 'siteAchives', name: 'siteAchives', component: () => import ('@/views/operManage/siteAchives/index'), meta: { title: '现场档案' } }, { path: 'defectManage', name: 'defectManage', component: () => import ('@/views/operManage/defectManage/index'), meta: { title: '缺陷管理' } }, { path: 'workManage', name: 'workManage', component: () => import ('@/views/operManage/workManage/index'), meta: { title: '工单管理' } }, { path: 'operStatistics', name: 'operStatistics', component: () => import ('@/views/operManage/operStatistics/index'), meta: { title: '运维统计' } }, { path: 'workStatistics', name: 'workStatistics', component: () => import ('@/views/operManage/workStatistics/index'), meta: { title: '工作量统计 ' } }, ] }, { path: '/systemManage', component: Layout, redirect: '/systemManage/userManage', name: 'systemManage', meta: { title: '系统管理', icon: 'systemManage' }, children: [{ path: 'userManage', name: 'userManage', component: () => import ('@/views/systemManage/userManage/index'), meta: { title: '用户管理' } }, { path: 'rolePermission', name: 'rolePermission', component: () => import ('@/views/systemManage/rolePermission/index'), meta: { title: '角色权限' } }, ] }, //my end // { // path: '/', // component: Layout, // redirect: '/dashboard', // children: [{ // path: 'dashboard', // name: 'Dashboard', // component: () => // import ('@/views/dashboard/index'), // meta: { title: 'Dashboard', icon: 'dashboard' } // }] // }, { path: '/example', component: Layout, redirect: '/example/table', name: 'Example', meta: { title: 'Table', icon: 'el-icon-s-help' }, children: [{ path: 'table', name: 'Table', component: () => import ('@/views/table/index'), meta: { title: 'Table', icon: 'table' } }, { path: 'tree', name: 'Tree', component: () => import ('@/views/tree/index'), meta: { title: 'Tree', icon: 'tree' } } ] }, { path: '/form', component: Layout, children: [{ path: 'index', name: 'Form', component: () => import ('@/views/form/index'), meta: { title: 'Form', icon: 'form' } }] }, // { // path: '/nested', // component: Layout, // redirect: '/nested/menu1', // name: 'Nested', // meta: { // title: 'Nested', // icon: 'nested' // }, // children: [{ // path: 'menu1', // component: () => // import ('@/views/nested/menu1/index'), // Parent router-view // name: 'Menu1', // meta: { title: 'Menu1' }, // children: [{ // path: 'menu1-1', // component: () => // import ('@/views/nested/menu1/menu1-1'), // name: 'Menu1-1', // meta: { title: 'Menu1-1' } // }, // { // path: 'menu1-2', // component: () => // import ('@/views/nested/menu1/menu1-2'), // name: 'Menu1-2', // meta: { title: 'Menu1-2' }, // children: [{ // path: 'menu1-2-1', // component: () => // import ('@/views/nested/menu1/menu1-2/menu1-2-1'), // name: 'Menu1-2-1', // meta: { title: 'Menu1-2-1' } // }, // { // path: 'menu1-2-2', // component: () => // import ('@/views/nested/menu1/menu1-2/menu1-2-2'), // name: 'Menu1-2-2', // meta: { title: 'Menu1-2-2' } // } // ] // }, // { // path: 'menu1-3', // component: () => // import ('@/views/nested/menu1/menu1-3'), // name: 'Menu1-3', // meta: { title: 'Menu1-3' } // } // ] // }, // { // path: 'menu2', // component: () => // import ('@/views/nested/menu2/index'), // name: 'Menu2', // meta: { title: 'menu2' } // } // ] // }, // { // path: 'external-link', // component: Layout, // children: [{ // path: 'https://panjiachen.github.io/vue-element-admin-site/#/', // meta: { title: 'External Link', icon: 'link' } // }] // }, // 404 page must be placed at the end !!! { path: '*', redirect: '/404', hidden: true } ] const createRouter = () => new Router({ // mode: 'history', // 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