liu
2026-09-07 a7dc7b230fcc6abc6ee5a7bfadb90789b03d2ca8
src/api/hrm/leave/index.ts
@@ -1,24 +1,32 @@
import type { PageParam, PageResult } from '#/packages/effects/request/src';
import { requestClient } from '#/api/request';
import type { SystemStorageApi } from '#/api/system/storage';
export namespace HrmLeaveApi {
  /** 请假申请 */
  export interface Leave {
    id?: number;
    employeeId?: number;
    employeeName?: string;
    userId?: number;
    userName?: string;
    deptName?: string;
    leaveType?: number;
    startTime?: string;
    endTime?: string;
    duration?: number;
    reason?: string;
    fileUrl?: string;
    blobIds?: number[];
    attachmentList?: SystemStorageApi.StorageBlob[];
    status?: number;
    processInstanceId?: string;
    remark?: string;
    createTime?: string;
  }
  /** 审批流程 */
  export interface ApproveProcess {
    key: string;
    name: string;
  }
}
@@ -51,8 +59,10 @@
}
/** 提交请假申请(发起审批) */
export function submitLeave(id: number) {
  return requestClient.post(`/hrm/leave/submit?id=${id}`);
export function submitLeave(id: number, processDefinitionKey: string) {
  return requestClient.post('/hrm/leave/submit', null, {
    params: { id, processDefinitionKey },
  });
}
/** 撤销请假申请 */
@@ -62,5 +72,7 @@
/** 获取可用流程定义列表 */
export function getLeaveApproveProcessDefinitionList() {
  return requestClient.get<any[]>('/hrm/leave/approve-process-definition-list');
  return requestClient.get<HrmLeaveApi.ApproveProcess[]>(
    '/hrm/leave/approve-process-definition-list',
  );
}