import Vue from 'vue' import Router from 'vue-router' /* Layout */ import Layout from '@/layout' Vue.use(Router) /* 所有角色可以访问/没有权限要求的基页 */ export const constantRoutes = [ { path: '/redirect', component: Layout, hidden: true, children: [{ path: '/redirect/:path(.*)', component: () => import('@/views/redirect/index.vue') }] }, { path: '/', redirect: 'login' }, { 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: '/region', component: Layout, redirect: '/region', children: [{ path: '/region', component: () => import('@/views/region/region.vue'), name: 'region', meta: { title: '区域管理' } }] }, { path: '/userManage', component: Layout, redirect: '/userManage', children: [{ path: '/userManage', component: () => import('@/views/userManage/userManage.vue'), name: 'userManage', meta: { title: '用户管理' } }] }, { path: '/RoleAdminister', component: Layout, redirect: '/RoleAdminister', children: [{ path: '/RoleAdminister', component: () => import('@/views/RoleAdminister/RoleAdminister.vue'), name: 'RoleAdminister', meta: { title: '角色管理' } }] }, { path: '/postManage', component: Layout, redirect: '/postManage', children: [{ path: '/postManage', component: () => import('@/views/postManage/postManage.vue'), name: 'postManage', meta: { title: '岗位管理' } }] }, { path: '/functional', component: Layout, redirect: '/functional', children: [{ path: '/functional', component: () => import('@/views/functional/functional.vue'), name: 'functional', meta: { title: '功能管理' } }] }, { path: '/sourceManage', component: Layout, redirect: '/sourceManage', children: [{ path: '/sourceManage', component: () => import('@/views/sourceManage/sourceManage.vue'), name: 'sourceManage', meta: { title: '资源管理' } }] }, { path: '/menuManage', component: Layout, redirect: '/menuManage', children: [{ path: '/menuManage', component: () => import('@/views/menuManage/menuManage.vue'), name: 'menuManage', meta: { title: '菜单管理' } }] }, { path: '/dictManage', component: Layout, redirect: '/dictManage', children: [{ path: '/dictManage', component: () => import('@/views/dictManage/dictManage.vue'), name: 'dictManage', meta: { title: '数据字典' } }] }, { path: '/logManage', component: Layout, redirect: '/logManage', children: [{ path: '/logManage', component: () => import('@/views/logManage/logManage.vue'), name: 'logManage', meta: { title: '日志管理' } }] }, { path: '/PwdModify', component: Layout, redirect: '/PwdModify', children: [{ path: '/PwdModify', component: () => import('@/views/PwdModify/PwdModify.vue'), name: 'PwdModify', meta: { title: '修改密码' } }] }, { path: '/organizationManage', component: Layout, redirect: '/organizationManage', children: [{ path: '/organizationManage', component: () => import('@/views/organizationManage/organizationManage.vue'), name: 'organizationManage', meta: { title: '组织管理' } }] }, // 工作流 { path: '/workflow', component: Layout, redirect: '/workflow', meta: { title: '工作流' }, children: [ { path: '/workflow/definition', component: () => import('@/views/workflow/definition/definition.vue'), name: 'definition', meta: { title: '流程定义' } }, { path: '/workflow/form', component: () => import('@/views/workflow/form/form.vue'), name: 'form', meta: { title: '表单配置' } }, ] }, // { // path: '/workflow', // component: Layout, // redirect: '/workflow/index', // children: [{ // path: '/workflow/index', // component: () => // import('@/views/workflow/index.vue'), // name: 'WorkflowIndex', // meta: { // title: '工作流' // } // }] // }, { path: '/todo', component: () => import('@/views/flow/todoList.vue') }, { path: '/done', component: () => import('@/views/flow/doneList.vue') }, // { // path: '/', // component: Layout, // redirect: 'dictCommon', // children: [{ // path: 'dictCommon', // component: () => // import('@/views/system-admin/dictCommon.vue'), // name: 'dictCommon', // meta: { // title: '数据字典值' // } // }] // }, { path: '/404', component: () => import('@/views/404'), hidden: true }, { path: '/flow/flowRecordForBusiness', component: ()=> import('@/views/flow/flowRecordForBusiness'), name: 'flowRecordForBusiness' }/*, { path: '/portal/flow/flowRecord', component: ()=> import('@/views/flow/flowRecord'), name: 'flowRecord' }*/ // 404 page must be placed at the end !!! // { path: '*', redirect: '/404', hidden: true } ] // import componentsRouter from '@/router/modules/components' 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