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:
45
ui/src/router/affair.ts
Normal file
45
ui/src/router/affair.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
const affairRouter = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default affairRouter
|
||||||
34
ui/src/router/attendance.ts
Normal file
34
ui/src/router/attendance.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
const attendanceRouter = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default attendanceRouter
|
||||||
@@ -1,6 +1,11 @@
|
|||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHistory } from 'vue-router'
|
||||||
import { PRODUCTION_NAME } from '@/constants/Common.constants'
|
import { PRODUCTION_NAME } from '@/constants/Common.constants'
|
||||||
import { getLoginStatus } from '@/utils/auth'
|
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({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
@@ -24,227 +29,11 @@ const router = createRouter({
|
|||||||
requiresPadding: true
|
requiresPadding: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
workRouter,
|
||||||
path: '/work',
|
attendanceRouter,
|
||||||
name: 'work',
|
affairRouter,
|
||||||
children: [
|
noticeRouter,
|
||||||
{
|
powerRouter
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
62
ui/src/router/notice.ts
Normal file
62
ui/src/router/notice.ts
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
const noticeRouter = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
export default noticeRouter
|
||||||
34
ui/src/router/power.ts
Normal file
34
ui/src/router/power.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
const powerRouter = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default powerRouter
|
||||||
47
ui/src/router/work.ts
Normal file
47
ui/src/router/work.ts
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
const workRouter = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default workRouter
|
||||||
Reference in New Issue
Block a user