1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

Split the router

This commit is contained in:
2023-05-16 21:07:34 +08:00
parent d7a3c0265d
commit 126202b8f7
6 changed files with 232 additions and 221 deletions

View File

@@ -1,6 +1,11 @@
import { createRouter, createWebHistory } from 'vue-router'
import { PRODUCTION_NAME } from '@/constants/Common.constants'
import { getLoginStatus } from '@/utils/auth'
import workRouter from '@/router/work'
import attendanceRouter from '@/router/attendance'
import affairRouter from '@/router/affair'
import noticeRouter from '@/router/notice'
import powerRouter from '@/router/power'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@@ -24,227 +29,11 @@ const router = createRouter({
requiresPadding: true
}
},
{
path: '/work',
name: 'work',
children: [
{
path: 'manage',
component: async () => await import('@/pages/work/Manage.vue'),
name: 'workManage',
meta: {
title: '工作管理',
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: 'task',
component: async () => await import('@/pages/work/Task.vue'),
name: 'task',
redirect: '/work/task/todo',
children: [
{
path: 'todo',
component: async () => await import('@/pages/work/Todo.vue'),
name: 'todo'
},
{
path: 'complete',
component: async () =>
await import('@/pages/work/Complete.vue'),
name: 'complete'
}
],
meta: {
title: '工作事项',
requiresScrollbar: false,
requiresPadding: true
}
}
],
meta: {
title: '工作事项',
icon: shallowRef(IconPinnacleWork),
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: '/attendance',
name: 'attendance',
children: [
{
path: 'manage',
component: async () =>
await import('@/pages/attendance/AttendanceHome.vue'),
name: 'attendanceManage',
meta: {
title: '考勤管理',
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: 'user',
component: async () =>
await import('@/pages/attendance/UserAttendance.vue'),
name: 'user',
meta: {
title: '员工考勤',
requiresScrollbar: false,
requiresPadding: true
}
}
],
meta: {
title: '考勤',
icon: shallowRef(IconPinnacleAttendance),
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: '/affair',
name: 'affair',
redirect: 'manage',
children: [
{
path: 'manage',
name: 'affairManage',
component: async () => await import('@/pages/affair/Affair.vue'),
meta: {
title: '事务管理',
requiresScrollbar: true,
requiresPadding: true
}
},
{
path: 'add',
component: async () => await import('@/pages/affair/AffairAdd.vue'),
name: 'affairAdd',
meta: {
title: '事务添加',
requiresScrollbar: true,
requiresPadding: true
}
},
{
path: 'approved',
component: async () =>
await import('@/pages/affair/AffairApproved.vue'),
name: 'affairApproved',
meta: {
title: '已审批事务',
requiresScrollbar: true,
requiresPadding: true
}
}
],
meta: {
title: '事务',
icon: shallowRef(IconPinnacleAffairs),
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: '/notice',
name: 'noticeHome',
meta: {
title: '公告管理',
icon: shallowRef(IconPinnacleNotice),
requiresScrollbar: false,
requiresPadding: true
},
children: [
{
path: 'noticeManage',
component: async () => await import('@/pages/notice/NoticeManage.vue'),
name: 'noticeManage',
meta: {
title: '公告管理',
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: 'noticeView',
component: async () => await import('@/pages/notice/NoticeView.vue'),
name: 'noticeView',
redirect: '/notice/noticeView/all',
meta: {
title: '公告查看',
requiresScrollbar: false,
requiresPadding: true
},
children: [
{
path: 'all',
component: async () =>
await import('@/pages/notice/AllReceiveNoticeView.vue'),
name: 'all'
},
{
path: 'alRead',
component: async () =>
await import('@/pages/notice/AlReadView.vue'),
name: 'alRead'
},
{
path: 'toRead',
component: async () =>
await import('@/pages/notice/ToReadView.vue'),
name: 'toRead'
}
]
},
{
path: 'noticeTypeManage',
component: async () =>
await import('@/pages/notice/NoticeTypeManage.vue'),
name: 'noticeTypeManage',
meta: {
title: '公告类型管理',
requiresScrollbar: false,
requiresPadding: true
}
}
]
},
{
path: '/power',
name: 'systemManagement',
children: [
{
path: 'role',
name: 'roleManagement',
component: async () => await import('@/pages/power/RoleManagement.vue'),
meta: {
title: '角色管理',
requiresScrollbar: false,
requiresPadding: true
}
},
{
path: 'group',
name: 'groupManagement',
component: async () =>
await import('@/pages/power/GroupManagement.vue'),
meta: {
title: '用户组管理',
requiresScrollbar: false,
requiresPadding: true
}
}
],
meta: {
title: '权限管理',
icon: shallowRef(IconPinnaclePower),
requiresScrollbar: false,
requiresPadding: true
}
}
workRouter,
attendanceRouter,
affairRouter,
noticeRouter,
powerRouter
]
},
{