路由修改

This commit is contained in:
HuskyOo 2022-05-09 09:07:51 +08:00
parent 46baaf6c55
commit bbb96ffa94
1 changed files with 142 additions and 142 deletions

View File

@ -1,16 +1,16 @@
import Vue from "vue"; import Vue from 'vue'
import Router from "vue-router"; import Router from 'vue-router'
Vue.use(Router); Vue.use(Router)
/* Layout */ /* Layout */
import Layout from "@/layout"; import Layout from '@/layout'
/* Router Modules */ /* Router Modules */
import componentsRouter from "./modules/components"; import componentsRouter from './modules/components'
import chartsRouter from "./modules/charts"; import chartsRouter from './modules/charts'
import tableRouter from "./modules/table"; import tableRouter from './modules/table'
import nestedRouter from "./modules/nested"; import nestedRouter from './modules/nested'
/** /**
* Note: sub-menu only appear when route children.length >= 1 * Note: sub-menu only appear when route children.length >= 1
@ -40,208 +40,208 @@ import nestedRouter from "./modules/nested";
*/ */
export const constantRoutes = [ export const constantRoutes = [
{ {
path: "/redirect", path: '/redirect',
component: Layout, component: Layout,
hidden: true, hidden: true,
children: [ children: [
{ {
path: "/redirect/:path(.*)", path: '/redirect/:path(.*)',
component: () => import("@/views/redirect/index") component: () => import('@/views/redirect/index')
} }
] ]
}, },
{ {
path: "/login", path: '/login',
component: () => import("@/views/login/index"), component: () => import('@/views/login/index'),
hidden: true hidden: true
}, },
{ {
path: "/auth-redirect", path: '/auth-redirect',
component: () => import("@/views/login/auth-redirect"), component: () => import('@/views/login/auth-redirect'),
hidden: true hidden: true
}, },
{ {
path: "/404", path: '/404',
component: () => import("@/views/error-page/404"), component: () => import('@/views/error-page/404'),
hidden: true hidden: true
}, },
{ {
path: "/401", path: '/401',
component: () => import("@/views/error-page/401"), component: () => import('@/views/error-page/401'),
hidden: true hidden: true
}, },
{ {
path: "/", path: '/',
name: "Dashboard", name: 'Dashboard',
component: Layout, component: Layout,
redirect: "/dashboard", redirect: '/dashboard',
children: [ children: [
{ {
path: "dashboard", path: 'dashboard',
component: () => import("@/views/dashboard/index"), component: () => import('@/views/dashboard/index'),
name: "Dashboard", name: 'Dashboard',
meta: { title: "首页", icon: "statistical", affix: true } meta: { title: '首页', icon: 'statistical', affix: true }
} }
] ]
}, },
{ {
path: "/convenience", path: '/convenience',
component: Layout, component: Layout,
name: "Convenience", name: 'Convenience',
redirect: "/convenience/list", redirect: '/convenience/list',
meta: { meta: {
title: "工单管理", title: '工单管理',
icon: "convenience" icon: 'convenience'
// roles: ["admin", "editor"] // roles: ["admin", "editor"]
}, },
children: [ children: [
{ {
path: "list", path: 'list',
component: () => import("@/views/convenience/list"), component: () => import('@/views/convenience/list'),
name: "ConvenienceList", name: 'ConvenienceList',
meta: { meta: {
title: "工单列表", title: '工单列表',
icon: "convenience", icon: 'convenience',
affix: true, affix: true,
parentTitle: "工单管理" parentTitle: '工单管理'
} }
}, },
{ {
path: "add", path: 'add',
component: () => import("@/views/convenience/add"), component: () => import('@/views/convenience/add'),
name: "ConvenienceList", name: 'ConvenienceList',
meta: { title: "创建工单", icon: "convenience", affix: true }, meta: { title: '创建工单', icon: 'convenience', affix: true },
hidden: true hidden: true
}, },
{ {
path: "detail", path: 'detail',
component: () => import("@/views/convenience/detail"), component: () => import('@/views/convenience/detail'),
name: "ConvenienceDetail", name: 'ConvenienceDetail',
meta: { meta: {
title: "工单详情", title: '工单详情',
icon: "convenience", icon: 'convenience',
affix: true, affix: true,
activeMenu: "/convenience/list" activeMenu: '/convenience/list'
}, },
hidden: true hidden: true
}, },
{ {
path: "typeList", path: 'typeList',
component: () => import("@/views/convenience/typeList"), component: () => import('@/views/convenience/typeList'),
name: "ConvenienceTypeList", name: 'ConvenienceTypeList',
meta: { title: "工单类型列表", icon: "convenience", affix: true }, meta: { title: '工单类型列表', icon: 'convenience', affix: true },
hidden: true hidden: true
} }
] ]
}, },
{ {
path: "/workBook", path: '/workBook',
component: Layout, component: Layout,
name: "WorkBook", name: 'WorkBook',
redirect: "/workBook/list", redirect: '/workBook/list',
meta: { meta: {
title: "工作手册", title: '工作手册',
icon: "list" icon: 'list'
}, },
hidden: false, hidden: false,
children: [ children: [
{ {
path: "list", path: 'list',
component: () => import("@/views/workBook/list"), component: () => import('@/views/workBook/list'),
name: "workBookList", name: 'workBookList',
meta: { meta: {
title: "工作手册列表", title: '工作手册列表',
icon: "workBook", icon: 'workBook',
affix: true, affix: true,
parentTitle: "工作手册" parentTitle: '工作手册'
} }
}, },
{ {
path: "detail", path: 'detail',
component: () => import("@/views/workBook/detail"), component: () => import('@/views/workBook/detail'),
name: "workBookDetail", name: 'workBookDetail',
meta: { meta: {
title: "工作手册详情", title: '工作手册详情',
icon: "workBook", icon: 'workBook',
affix: true, affix: true,
parentTitle: "工作手册详情" parentTitle: '工作手册详情'
}, },
hidden: true hidden: true
} }
] ]
}, },
{ {
path: "/helpPrint", path: '/helpPrint',
component: Layout, component: Layout,
name: "HelpPrint", name: 'HelpPrint',
redirect: "/helpPrint/list", redirect: '/helpPrint/list',
meta: { meta: {
title: "代写代办管理", title: '代写代办管理',
icon: "list", icon: 'list',
roles: ["admin", "editor"] roles: ['admin', 'editor']
}, },
children: [ children: [
{ {
path: "list", path: 'list',
component: () => import("@/views/helpPrint/list"), component: () => import('@/views/helpPrint/list'),
name: "helpPrintList", name: 'helpPrintList',
meta: { meta: {
title: "代写代办列表", title: '代写代办列表',
icon: "dxdb", icon: 'dxdb',
affix: true, affix: true,
parentTitle: "代写代办管理" parentTitle: '代写代办管理'
} }
}, },
{ {
path: "detail", path: 'detail',
component: () => import("@/views/helpPrint/detail"), component: () => import('@/views/helpPrint/detail'),
name: "helpPrintDetail", name: 'helpPrintDetail',
meta: { meta: {
title: "代写代办详情", title: '代写代办详情',
icon: "dxdb", icon: 'dxdb',
affix: true, affix: true,
parentTitle: "代写代办详情" parentTitle: '代写代办详情'
}, },
hidden: true hidden: true
}, },
{ {
path: "read", path: 'read',
component: () => import("@/views/helpPrint/read"), component: () => import('@/views/helpPrint/read'),
name: "helpPrintDetailRead", name: 'helpPrintDetailRead',
meta: { meta: {
title: "代写代办详情", title: '代写代办详情',
icon: "dxdb", icon: 'dxdb',
affix: true, affix: true,
parentTitle: "代写代办详情" parentTitle: '代写代办详情'
}, },
hidden: true hidden: true
} }
] ]
}, },
{ {
path: "/townRanking", path: '/townRanking',
component: Layout, component: Layout,
name: "TownRanking", name: 'TownRanking',
redirect: "/townRanking/index", redirect: '/townRanking/index',
meta: { meta: {
title: "乡镇办件统计", title: '乡镇办件统计',
icon: "townRanking" icon: 'townRanking'
}, },
hidden: false, hidden: false,
children: [ children: [
{ {
path: "list", path: 'list',
component: () => import("@/views/townRanking/index"), component: () => import('@/views/townRanking/index'),
name: "TownRanking", name: 'TownRanking',
meta: { meta: {
title: "乡镇办件统计", title: '乡镇办件统计',
icon: "townRanking", icon: 'townRanking',
affix: true, affix: true,
parentTitle: "乡镇办件统计" parentTitle: '乡镇办件统计'
} }
} }
] ]
}, }
// { // {
// path: "/staff", // path: "/staff",
// component: Layout, // component: Layout,
@ -299,7 +299,7 @@ export const constantRoutes = [
// } // }
// ] // ]
// } // }
]; ]
/** /**
* asyncRoutes * asyncRoutes
@ -307,61 +307,61 @@ export const constantRoutes = [
*/ */
export const asyncRoutes = [ export const asyncRoutes = [
{ {
path: "/residentInformation", path: '/residentInformation',
component: Layout, component: Layout,
name: "ResidentInformation", name: 'ResidentInformation',
redirect: "/residentInformation/list", redirect: '/residentInformation/list',
meta: { meta: {
title: "居民信息管理", title: '居民信息管理',
icon: "jmInfo", icon: 'jmInfo',
roles: ["SSS"] roles: ['SSS']
}, },
children: [ children: [
{ {
path: "list", path: 'list',
component: () => import("@/views/residentInformation/list"), component: () => import('@/views/residentInformation/list'),
name: "residentInformationList", name: 'residentInformationList',
meta: { meta: {
title: "居民信息列表", title: '居民信息列表',
icon: "jmInfo", icon: 'jmInfo',
affix: true, affix: true,
parentTitle: "居民信息管理" parentTitle: '居民信息管理'
} }
} }
] ]
}, },
{ {
path: "/dept", path: '/dept',
component: Layout, component: Layout,
name: "Dept", name: 'Dept',
redirect: "/dept/list", redirect: '/dept/list',
meta: { meta: {
title: "县级部门管理", title: '县级部门管理',
icon: "townRanking", icon: 'townRanking',
roles: ["SSS"] roles: ['SSS']
}, },
hidden: false, hidden: false,
children: [ children: [
{ {
path: "list", path: 'list',
component: () => import("@/views/dept/list"), component: () => import('@/views/dept/list'),
name: "DeptList", name: 'DeptList',
meta: { meta: {
title: "部门列表", title: '部门列表',
icon: "townRanking", icon: 'townRanking',
affix: true, affix: true,
parentTitle: "县级部门管理" parentTitle: '县级部门管理'
} }
}, },
{ {
path: "staff", path: 'staff',
component: () => import("@/views/dept/staff"), component: () => import('@/views/dept/staff'),
name: "DeptStaff", name: 'DeptStaff',
meta: { meta: {
title: "人员列表", title: '人员列表',
icon: "townRanking", icon: 'townRanking',
affix: true, affix: true,
parentTitle: "县级部门管理" parentTitle: '县级部门管理'
}, },
hidden: true hidden: true
} }
@ -622,22 +622,22 @@ export const asyncRoutes = [
// }, // },
// 404 page must be placed at the end !!! // 404 page must be placed at the end !!!
{ path: "*", redirect: "/404", hidden: true } { path: '*', redirect: '/404', hidden: true }
]; ]
const createRouter = () => const createRouter = () =>
new Router({ new Router({
// mode: 'history', // require service support // mode: 'history', // require service support
scrollBehavior: () => ({ y: 0 }), scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes routes: constantRoutes
}); })
const router = createRouter(); const router = createRouter()
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() { export function resetRouter() {
const newRouter = createRouter(); const newRouter = createRouter()
router.matcher = newRouter.matcher; // reset router router.matcher = newRouter.matcher // reset router
} }
export default router; export default router