提交代码
This commit is contained in:
1 parent
d9f760fe1c
commit
01588bf87d
484 files changed
+7228
-104711
No files matched your search
@@ -0,0 +1,93 @@
|
||||
import { get, post, put, del, uploadFile, downloadFile } from '@/common/request.js'
|
||||
import type { LeaveForm, LeaveTypeConfig, StudentInfo } from '@/types/leave'
|
||||
import type { ApiResponse } from '@/common/request'
|
||||
|
||||
// 请假相关API
|
||||
export const leaveApi = {
|
||||
// 获取请假类型列表
|
||||
getLeaveTypeList: (params?: any) => {
|
||||
return get<LeaveTypeConfig[]>('/xgLeaveTypeConfig/xgLeaveTypeConfig/list', params)
|
||||
},
|
||||
|
||||
// 获取学生信息
|
||||
getStudentInfo: (studentId: string | number) => {
|
||||
return get<StudentInfo>(`/studentMsg/studentMsg/${studentId}`)
|
||||
},
|
||||
|
||||
// 获取当前用户学生信息
|
||||
getCurrentUserStudentInfo: () => {
|
||||
return get<StudentInfo>('/studentMsg/studentMsg/currentUserInfo')
|
||||
},
|
||||
|
||||
// 获取请假信息
|
||||
getLeaveInfo: (id: string | number) => {
|
||||
return get<LeaveForm>(`/workflow/studentLeave/studentLeave/${id}`)
|
||||
},
|
||||
|
||||
// 新增请假申请
|
||||
addLeave: (data: LeaveForm) => {
|
||||
return post<LeaveForm>('/workflow/studentLeave/studentLeave', data)
|
||||
},
|
||||
|
||||
// 更新请假申请
|
||||
updateLeave: (data: LeaveForm) => {
|
||||
return put<LeaveForm>('/workflow/studentLeave/studentLeave', data)
|
||||
},
|
||||
|
||||
// 删除请假申请
|
||||
deleteLeave: (id: string | number) => {
|
||||
return del(`/workflow/studentLeave/studentLeave/${id}`)
|
||||
},
|
||||
|
||||
// 获取班主任ID
|
||||
getClassTeacherId: (studentId: string | number) => {
|
||||
return get<number>(`/studentMsg/studentMsg/classTeacherId/${studentId}`)
|
||||
},
|
||||
|
||||
// 获取学院请假审批人
|
||||
getCollegeLeaveApprovers: (studentId: string | number) => {
|
||||
return get<number[]>(`/studentMsg/studentMsg/collegeLeaveApprovers/${studentId}`)
|
||||
},
|
||||
|
||||
// 启动工作流
|
||||
startWorkflow: (data: {
|
||||
businessId: string | number
|
||||
flowCode: string
|
||||
variables: Record<string, any>
|
||||
}) => {
|
||||
return post<{ taskId: string }>('/workflow/task/start', data)
|
||||
},
|
||||
|
||||
// 完成任务
|
||||
completeTask: (data: {
|
||||
taskId: string
|
||||
opinion: string
|
||||
result: 'approve' | 'reject'
|
||||
rejectReason?: string
|
||||
variables?: Record<string, any>
|
||||
}) => {
|
||||
return post('/workflow/task/complete', data)
|
||||
},
|
||||
|
||||
// 获取审批记录
|
||||
getApprovalRecords: (businessId: string | number) => {
|
||||
return get(`/workflow/task/approvalRecords/${businessId}`)
|
||||
},
|
||||
|
||||
// 获取附件信息
|
||||
getAttachmentInfo: (ossIds: string) => {
|
||||
return get(`/resource/oss/listByIds/${ossIds}`)
|
||||
},
|
||||
|
||||
// 上传文件
|
||||
uploadFile: (filePath: string, bizType: string = 'student_leave_attachment') => {
|
||||
return uploadFile('/resource/oss/upload', filePath, { bizType })
|
||||
},
|
||||
|
||||
// 下载文件
|
||||
downloadFile: (ossId: string) => {
|
||||
return downloadFile(`/resource/oss/download/${ossId}`)
|
||||
}
|
||||
}
|
||||
|
||||
export default leaveApi
|
||||
Reference in new issue
Block a user