diff --git a/ui/src/router/affair.ts b/ui/src/router/affair.ts new file mode 100644 index 0000000..a8b0041 --- /dev/null +++ b/ui/src/router/affair.ts @@ -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 diff --git a/ui/src/router/attendance.ts b/ui/src/router/attendance.ts new file mode 100644 index 0000000..0b310b0 --- /dev/null +++ b/ui/src/router/attendance.ts @@ -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 diff --git a/ui/src/router/index.ts b/ui/src/router/index.ts index 7d74de6..1ed2bef 100644 --- a/ui/src/router/index.ts +++ b/ui/src/router/index.ts @@ -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 ] }, { diff --git a/ui/src/router/notice.ts b/ui/src/router/notice.ts new file mode 100644 index 0000000..a1a12c7 --- /dev/null +++ b/ui/src/router/notice.ts @@ -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 diff --git a/ui/src/router/power.ts b/ui/src/router/power.ts new file mode 100644 index 0000000..3044b62 --- /dev/null +++ b/ui/src/router/power.ts @@ -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 diff --git a/ui/src/router/work.ts b/ui/src/router/work.ts new file mode 100644 index 0000000..815d622 --- /dev/null +++ b/ui/src/router/work.ts @@ -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