| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- import { createWebHistory, createRouter } from 'vue-router'
- /* Layout */
- import Layout from '@/layout'
- // 公共路由
- export const constantRoutes = [
- {
- path: '/redirect',
- component: Layout,
- hidden: true,
- children: [
- {
- path: '/redirect/:path(.*)',
- component: () => import('@/views/redirect/index.vue')
- }
- ]
- },
- {
- path: '/login',
- component: () => import('@/views/login'),
- hidden: true
- },
- {
- path: '/register',
- component: () => import('@/views/register'),
- hidden: true
- },
- {
- path: '/401',
- component: () => import('@/views/error/401'),
- hidden: true
- },
- {
- path: '/index',
- component: Layout,
- children: [
- {
- path: '',
- component: () => import('@/views/index'),
- name: 'Index',
- meta: { title: '首页', icon: 'dashboard', affix: true }
- }
- ]
- },
- {
- path: '',
- redirect: '/index'
- },
- {
- path: '/lock',
- component: () => import('@/views/lock'),
- hidden: true,
- meta: { title: '锁定屏幕' }
- },
- {
- path: '/user',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [
- {
- path: 'profile/:activeTab?',
- component: () => import('@/views/system/user/profile/index'),
- name: 'Profile',
- meta: { title: '个人中心', icon: 'user' }
- }
- ]
- },
- {
- path: "/:pathMatch(.*)*",
- component: () => import('@/views/error/404'),
- hidden: true
- }
- ]
- // 业务模块路由(顶层菜单 + 侧边栏子菜单)
- export const businessRoutes = [
- {
- path: '/zggc',
- component: Layout,
- redirect: '/zggc/index',
- name: 'ZggcMenu',
- meta: { title: '直管工程' },
- children: [
- {
- path: 'index',
- component: () => import('@/views/portal/zggc'),
- name: 'Zggc',
- meta: { title: '直管工程' }
- },
- {
- path: 'detail/:folderId',
- component: () => import('@/views/portal/portalDetail'),
- name: 'ZggcDetail',
- hidden: true,
- meta: { title: '直管工程详情', activeMenu: '/zggc/index' }
- }
- ]
- },
- {
- path: '/zdgc',
- component: Layout,
- redirect: '/zdgc/index',
- name: 'ZdgcMenu',
- meta: { title: '重点工程' },
- children: [
- {
- path: 'index',
- component: () => import('@/views/portal/zdgc'),
- name: 'Zdgc',
- meta: { title: '重点工程' }
- },
- {
- path: 'detail/:folderId',
- component: () => import('@/views/portal/portalDetail'),
- name: 'ZdgcDetail',
- hidden: true,
- meta: { title: '重点工程详情', activeMenu: '/zdgc/index' }
- }
- ]
- },
- {
- path: '/ddjc',
- component: Layout,
- redirect: '/ddjc/index',
- name: 'DdjcMenu',
- meta: { title: '督导检查' },
- children: [
- {
- path: 'index',
- component: () => import('@/views/portal/ddjc'),
- name: 'Ddjc',
- meta: { title: '督导检查' }
- }
- ]
- },
- {
- path: '/gzzd',
- component: Layout,
- redirect: '/gzzd/index',
- name: 'GzzdMenu',
- meta: { title: '规章制度' },
- children: [
- {
- path: 'index',
- component: () => import('@/views/portal/gzzd'),
- name: 'Gzzd',
- meta: { title: '规章制度' }
- },
- {
- path: 'detail/:folderId',
- component: () => import('@/views/portal/portalDetail'),
- name: 'GzzdDetail',
- hidden: true,
- meta: { title: '规章制度详情', activeMenu: '/gzzd/index' }
- }
- ]
- },
- // 隐藏路由(通过代码导航访问,不在导航栏显示)
- {
- path: '/more',
- component: Layout,
- hidden: true,
- redirect: '/more/tpz',
- name: 'MoreHidden',
- meta: { title: '更多' },
- children: [
- {
- path: 'tpz',
- component: () => import('@/views/portal/tpz'),
- name: 'MoreTpz',
- meta: { title: '太浦闸(图片展)' }
- },
- {
- path: 'wyh',
- component: () => import('@/views/portal/wyh'),
- name: 'MoreWyh',
- meta: { title: '望亭闸' }
- }
- ]
- },
- {
- path: '/efinder',
- component: Layout,
- hidden: true,
- name: 'EfinderHidden',
- meta: { title: '文件管理' },
- children: [
- {
- path: 'viewer',
- component: () => import('@/views/efinder/viewer'),
- name: 'EfinderViewer',
- meta: { title: '文件预览' }
- }
- ]
- }
- ];
- // 动态路由(隐藏页面,基于权限加载)
- export const dynamicRoutes = [];
- const router = createRouter({
- history: createWebHistory(import.meta.env.VITE_APP_BASE_TITLE),
- routes: constantRoutes,
- scrollBehavior(to, from, savedPosition) {
- if (savedPosition) {
- return savedPosition
- }
- return { top: 0 }
- },
- })
- export default router
|