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