import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) /* Layout */ import Layout from '@/layout' /* Home */ import Home from '@/views/home/index' /** * 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' 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 }, { path: '/', component: Home, hidden: true }, { path: '/home', component: Home, name: '首页', hidden: true }, // { // path: '/home', // component: Layout, // redirect: '/dashboard', // children: [{ // path: 'dashboard', // name: 'Dashboard', // component: () => import('@/views/dashboard/index'), // meta: { title: 'Dashboard', icon: 'dashboard' } // }] // }, { path: '/Platform', component: Layout, redirect: '/Platform/workbench', name: '流程管控', meta: { title: '流程管控', icon: 'env' }, children: [ { path: 'workbench', name: 'workbench', // hidden: true, component: () => import('@/views/Platform/workbench'), meta: { title: '我的工作台' } }, { path: '/Platform/projectManage', name: '项目管理', component: () => import('@/views/Platform/presentation/testa'), redirect: '/Platform/projectManage/projectList', meta: { title: '项目管理' }, children: [ { path: 'projectList', name: '项目列表', component: () => import('@/views/projectManage/projectList/projectListIndex'), meta: { title: '项目列表' } }, { path: 'projectCreate', hidden: true, name: '项目创建', component: () => import('@/views/projectManage/projectList/projectCreate'), meta: { title: '项目创建' } }, { path: 'projectPreview', hidden: true, name: '项目查看', component: () => import('@/views/projectManage/projectList/projectPreview'), meta: { title: '项目查看' } }, { path: 'taskList', name: '任务列表', component: () => import('@/views/projectManage/taskList/taskListIndex'), meta: { title: '任务列表' } }, { path: 'taskCreate', hidden: true, name: '任务创建', component: () => import('@/views/projectManage/taskList/taskCreate'), meta: { title: '任务创建' } }, { path: 'taskPreview', hidden: true, name: '任务查看', component: () => import('@/views/projectManage/taskList/taskPreview'), meta: { title: '任务查看' } }, { path: 'taskUpdate', hidden: true, name: '任务更新', component: () => import('@/views/projectManage/taskList/taskUpdateCreate'), meta: { title: '任务更新' } } ] }, { path: '/Platform/useCasePage', name: '用例管理', // hidden: true, component: () => import('@/views/Platform/useCasePage'), meta: { title: '用例管理', keepAlive: true }, children: [ { path: 'createUse', name: '用例新增', hidden: true, component: () => import('@/views/Platform/useCase/createUse'), meta: { title: '用例新增' } }, { path: 'queryUse', name: '用例查看', hidden: true, component: () => import('@/views/Platform/useCase/queryUse'), meta: { title: '用例查看' } }, { path: 'updateUse', name: '用例编辑', hidden: true, component: () => import('@/views/Platform/useCase/updateUse'), meta: { title: '用例编辑' } } ] }, { path: '/Platform/presentation', name: '测试管理', component: () => import('@/views/Platform/presentation/testa'), meta: { title: '测试管理' }, children: [ { path: 'testPageData', name: '测试计划管理', hidden: true, component: () => import('@/views/Platform/presentation/testPage.vue'), meta: { title: '测试计划管理' } }, { path: 'testPresentation', name: '日报报告', component: () => import('@/views/Platform/presentation/testPresentation'), meta: { title: '日报报告' } }, { path: 'ResultPage', name: '准出报告', component: () => import('@/views/Platform/presentation/ResultPage'), meta: { title: '准出报告' } }, { path: 'Assumptions', name: '提测报告', component: () => import('@/views/Platform/presentation/Assumptions'), meta: { title: '提测报告' } }, { path: 'DailyNewsAdded', name: '日报报告', hidden: true, component: () => import('@/views/Platform/presentation/DailyNewsAdded'), meta: { title: '新增日报报告' } }, { path: 'presentationReport', name: '提测报告', hidden: true, component: () => import('@/views/Platform/presentation/presentationReport'), meta: { title: '新增服务器提测报告' } }, { path: 'acceptTheReport', name: '提测预览', hidden: true, component: () => import('@/views/Platform/presentation/acceptTheReport'), meta: { title: '提测预览' } }, { path: 'testPresenyL', name: '日报预览', hidden: true, component: () => import('@/views/Platform/presentation/testPresenyL'), meta: { title: '日报预览' } }, { path: 'ResultPageyL', name: '准出预览', hidden: true, component: () => import('@/views/Platform/presentation/ResultPageyL'), meta: { title: '准出预览' } }, { path: 'Acceptance', name: '准出报告', hidden: true, component: () => import('@/views/Platform/presentation/Acceptance'), meta: { title: '准出报告,新增服务器端报告' } }, { path: 'ClientAcceptance', name: '准出报告', hidden: true, component: () => import('@/views/Platform/presentation/ClientAcceptance'), meta: { title: '准出报告,新增客户端报告' } }, { path: 'PresentReport', name: '提测报告,新增报告', hidden: true, component: () => import('@/views/Platform/presentation/PresentReport'), meta: { title: '新增客户端提测报告' } }, { path: 'projectQuery', name: '项目查看编辑', hidden: true, component: () => import('@/views/Platform/projectQuery/projectQuery.vue'), meta: { title: '项目查看编辑' } }, { path: 'taskQuery', name: '任务查看编辑', hidden: true, component: () => import('@/views/Platform/projectQuery/taskQuery.vue'), meta: { title: '任务查看编辑' } } ] }, { path: '/Platform/defectManagement', name: '缺陷管理', component: () => import('@/views/Platform/defectManagement'), meta: { title: '缺陷管理' } }, { path: '/Platform/defectManagement/bugCreate', name: '新建Bug', hidden: true, component: () => import('@/views/Platform/bugManage/bugCreate'), meta: { title: '新建Bug' } }, { path: '/Platform/defectManagement/bugQuery', name: '查看Bug', hidden: true, component: () => import('@/views/Platform/bugManage/bugQuery'), meta: { title: '查看Bug' } }, { path: '/Platform/defectManagement/bugUpdate', name: '更新Bug', hidden: true, component: () => import('@/views/Platform/bugManage/bugUpdate'), meta: { title: '更新Bug' } }, { path: '/Platform/setUp', // component: Layout, name: '设置', // meta: { title: '设置' }, component: () => import('@/views/Platform/setUp/testa'), meta: { title: '设置' }, children: [{ path: 'systemSetup', name: '系统设置', component: () => import('@/views/Platform/setUp/systemSetup/testa'), meta: { title: '系统设置' }, children: [{ path: 'bizPage', name: '业务线', // hidden: true, component: () => import('@/views/Platform/setUp/systemSetup/bizPage'), meta: { title: '业务线' } }, { path: 'platformPage', name: '平台类型', // hidden: true, component: () => import('@/views/Platform/setUp/systemSetup/platformPage'), meta: { title: '平台类型' } }, { path: 'modulePage', name: '业务模块', // hidden: true, component: () => import('@/views/Platform/setUp/systemSetup/modulePage'), meta: { title: '业务模块' } }, { path: 'projectPage', name: '工程模块', // hidden: true, component: () => import('@/views/Platform/setUp/systemSetup/projectPage'), meta: { title: '工程模块' } } ] }, { path: 'teamPage', name: '团队设置', component: () => import('@/views/Platform/setUp/teamPage'), meta: { title: '团队设置' } } ] } ] }, { path: '/env-platform', component: Layout, redirect: '/env-platform/env', name: '环境', meta: { title: '环境平台', icon: 'env_platform' }, children: [ { path: 'env', name: 'env', component: () => import('@/views/env/index.vue'), meta: { title: '环境管理' } }, { path: 'businessline', name: 'businessline', component: () => import('@/views/env/index.vue'), meta: { title: '业务线管理' } }, { path: 'whitelist', name: 'whitelist', component: () => import('@/views/env/index.vue'), meta: { title: '白名单管理' } }, { path: 'module', name: 'module', component: () => import('@/views/env/index.vue'), meta: { title: '模块管理' } }, { path: 'group', name: 'group', component: () => import('@/views/env/index.vue'), meta: { title: 'Group管理' } }, { path: 'topic', name: 'topic', component: () => import('@/views/env/index.vue'), meta: { title: 'Topic管理' } }, { path: 'mq', name: 'mq', component: () => import('@/views/env/index.vue'), meta: { title: 'MQ管理' } }, { path: 'data', name: 'data', component: () => import('@/views/env/index.vue'), meta: { title: '数据统计' } } ] }, { path: '/mock', component: Layout, redirect: '/mock/interface', name: 'Mock', meta: { title: 'Mock服务', icon: 'MQ' }, children: [ { path: 'interface', name: 'Interface', component: () => import('@/views/mock/interface'), meta: { title: 'dubbo mock' } }, { path: 'interface/:rule', name: 'Rule', hidden: true, component: () => import('@/views/mock/rule'), meta: { title: 'dubbo规则' } }, { path: 'httpmock', name: 'httpmock', component: () => import('@/views/mock/httpmock'), meta: { title: 'http mock' } }, { path: 'httpmock/:httprule', name: 'Httprule', hidden: true, component: () => import('@/views/mock/httprule'), meta: { title: 'httpmock规则' } } ] }, { path: '/data', component: Layout, redirect: '/data/upload-file', name: '数据中心', hidden: true, meta: { title: '数据中心', icon: 'examlpe' }, children: [ { path: 'upload-file', name: 'jar包管理', component: () => import('@/views/data/upload.vue'), meta: { title: 'jar包管理' } }, { path: 'item', name: '动态数据', component: () => import('@/views/data/index.vue'), meta: { title: '动态数据' } } ] }, { path: '/virtualDevices', component: Layout, redirect: '/virtualDevices/HTvehicle', name: '虚拟硬件', meta: { title: '虚拟硬件', icon: 'module' }, children: [ { path: 'HTvehicle', name: '单车', component: () => import('@/views/virtualDevices/HTvehicle'), meta: { title: '单车' } }, { path: 'HTvehicl1e', name: '电单车' // hidden: true, // component: () => import('@/views/virtualDevices/HTvehicle'), // meta: { title: '电单车' } } ] }, { path: '/online-quality', component: Layout, redirect: '/online-quality/check-list', name: '上线质检', meta: { title: '上线质检', icon: '上线质检' }, children: [ { path: 'check-list', name: '模板管理', component: () => import('@/views/online-quality/CheckConfig/index.vue'), meta: { title: '模板管理' } }, { path: 'history-task', name: '历史任务', component: () => import('@/views/online-quality/HistoryTask/index.vue'), meta: { title: '历史任务' } }, { path: 'history-task-details/:taskId', props: true, name: '历史任务详情', hidden: true, component: () => import('@/views/online-quality/HistoryTask/taskDetails.vue'), meta: { title: '历史任务详情' } }, { path: 'block-server', name: '阻断服务', component: () => import('@/views/online-quality/BlockServer/index.vue'), meta: { title: '阻断服务' } } ] }, { path: '*', redirect: '/404', hidden: true }, { path: '/quality', component: Layout, redirect: '/quality/qualityMarket', name: '质量度量', // hidden: true, meta: { title: '质量度量', icon: 'rule' }, children: [ { path: 'qualityMarket', name: '质量大盘', // hidden: true, component: () => import('@/views/quality/qualityMarket.vue'), meta: { title: '质量大盘' }, children: [ { path: 'qualityProcess', name: '上线过程', hidden: true, component: () => import('@/views/quality/qualityProcess.vue'), meta: { title: '上线过程' } }, { path: 'qualityDefectProcess', name: '缺陷过程', hidden: true, component: () => import('@/views/quality/qualityDefectProcess.vue'), meta: { title: '缺陷过程' } }, { path: 'qualityHotpatchProcess', name: '热修复过程', hidden: true, component: () => import('@/views/quality/qualityHotpatchProcess.vue'), meta: { title: '热修复过程' } } ] }, { path: 'problemList', name: '线上问题', // hidden: true, component: () => import('@/views/onlineProblem/problemList.vue'), meta: { title: '线上问题' } }, { path: '/Platform/defectManagement/problemCreate', name: '新建线上问题', hidden: true, component: () => import('@/views/onlineProblem/problemCreate'), meta: { title: '新建线上问题' } }, { path: '/Platform/defectManagement/problemQuery', name: '查看线上问题', hidden: true, component: () => import('@/views/onlineProblem/problemQuery'), meta: { title: '查看线上问题' } }, { path: '/Platform/defectManagement/problemUpdate', name: '更新线上问题', hidden: true, component: () => import('@/views/onlineProblem/problemUpdate'), meta: { title: '更新线上问题' } } ] } ] 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