You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

259 lines
6.5 KiB

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)
/* Layout */
import Layout from '@/layout'
/* 所有角色可以访问/没有权限要求的基页 */
import codemenu from './modules/codemenu'
export const constantRoutes = [
{
path: '/redirect',
component: Layout,
hidden: true,
children: [{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index.vue')
}]
},
{
path: '/',
redirect: 'index'
}, {
path: '/login',
component: () => import('@/views/login/login.vue')
}, {
path: '/home',
component: () => import('@/views/Home/Home.vue'),
name: 'home'
}, {
path: '/index',
component: Layout,
redirect: '/index',
children: [{
path: '/index',
component: () =>
import('@/views/index.vue'),
name: 'index',
meta: {
title: '主页',
noCache: true,
affix: true
}
}]
}, {
path: '/alarmManagement',
component: Layout,
redirect: '/alarmManagement/realTime',
meta: {
title: '告警管理'
},
children: [
{
path: '/alarmManagement/historyAlarm',
component: () => import('@/views/yxtPrototypeUi/alarmManagement/historyAlarm/index.vue'),
name: 'index',
meta: {
title: '历史告警',
noCache: true
}
},
{
path: '/alarmManagement/realTime',
component: () => import('@/views/yxtPrototypeUi/alarmManagement/realTime/index.vue'),
name: 'index',
meta: {
title: '实时告警',
noCache: true
}
},
]
},
{
path: '/Template-task',
component: Layout,
redirect: '/Template-task/templateManagement',
meta: {
title: '模板任务项'
},
children: [
{
path: '/Template-task/TaskItemManagement',
component: () => import('@/views/yxtPrototypeUi/Template-task/TaskItemManagement/index.vue'),
name: 'index',
meta: {
title: '任务项管理',
noCache: true
}
},
{
path: '/Template-task/templateManagement',
component: () => import('@/views/yxtPrototypeUi/Template-task/templateManagement/index.vue'),
name: 'index',
meta: {
title: '模板管理',
noCache: true
}
},
]
},
{
path: '/WorkManagement',
component: Layout,
redirect: '/WorkManagement/WorkManagements',
meta: {
title: '工单管理'
},
children: [
{
path: '/WorkManagement/planManagement',
component: () => import('@/views/yxtPrototypeUi/WorkManagement/planManagement/index.vue'),
name: 'index',
meta: {
title: '计划管理',
noCache: true
}
},
{
path: '/WorkManagement/WorkManagements',
component: () => import('@/views/yxtPrototypeUi/WorkManagement/WorkManagements/index.vue'),
name: 'index',
meta: {
title: '工单管理',
noCache: true
}
},
]
},
{
path: '/dispatchpatrolplan',
component: Layout,
redirect: '/dispatchpatrolplan/index',
meta: {
title: '巡视计划'
},
children: [{
path: '/dispatchpatrolplan/index',
component: () => import('@/views/yxtdispatchcenter/dispatchpatrolplan/dispatchpatrolplan.vue'),
name: 'DispatchPatrolPlanIndex',
meta: { title: '巡视计划' }
}]
},
{
path: '/dispatchmodletemplate',
component: Layout,
redirect: '/dispatchmodletemplate/index',
meta: {
title: '模型模板对照'
},
children: [{
path: '/dispatchmodletemplate/index',
component: () => import('@/views/yxtdispatchcenter/dispatchmodletemplate/dispatchmodletemplate.vue'),
name: 'DispatchModleTemplateIndex',
meta: { title: '模型模板对照' }
}]
},
{
path: '/dispatchorderinfo',
component: Layout,
redirect: '/dispatchorderinfo/index',
meta: {
title: '汇总工单数据'
},
children: [{
path: '/dispatchorderinfo/index',
component: () => import('@/views/yxtdispatchcenter/dispatchorderinfo/dispatchorderinfo.vue'),
name: 'DispatchOrderinfoIndex',
meta: { title: '汇总工单数据' }
}]
},
{
path: '/dispatchpatrolmodle',
component: Layout,
redirect: '/dispatchpatrolmodle/index',
meta: {
title: '巡视任务模型,工单和模型'
},
children: [{
path: '/dispatchpatrolmodle/index',
component: () => import('@/views/yxtdispatchcenter/dispatchpatrolmodle/dispatchpatrolmodle.vue'),
name: 'DispatchPatrolModleIndex',
meta: { title: '巡视任务模型,工单和模型' }
}]
},
{
path: '/dispatchstandards',
component: Layout,
redirect: '/dispatchstandards/index',
meta: {
title: '(运维任务标准库)'
},
children: [{
path: '/dispatchstandards/index',
component: () => import('@/views/yxtdispatchcenter/dispatchstandards/dispatchstandards.vue'),
name: 'DispatchStandardsIndex',
meta: { title: '(运维任务标准库)' }
}]
},
{
path: '/dispatchtemplate',
component: Layout,
redirect: '/dispatchtemplate/index',
meta: {
title: '运维任务模板'
},
children: [{
path: '/dispatchtemplate/index',
component: () => import('@/views/yxtdispatchcenter/dispatchtemplate/dispatchtemplate.vue'),
name: 'DispatchTemplateIndex',
meta: { title: '运维任务模板' }
}]
},
{
path: '/dispatchworker',
component: Layout,
redirect: '/dispatchworker/index',
meta: {
title: '工单运维人员情况'
},
children: [{
path: '/dispatchworker/index',
component: () => import('@/views/yxtdispatchcenter/dispatchworker/dispatchworker.vue'),
name: 'DispatchWorkerIndex',
meta: { title: '工单运维人员情况' }
}]
},
{
path: '/404',
component: () =>
import('@/views/404'),
hidden: true
}
// 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