import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AuditTaskVO, AuditTaskQuery, AuditTaskAuditForm } from './types';

/**
 * 查询文件审批任务列表
 * @param query 查询参数
 */
export const listAuditTasks = (query: AuditTaskQuery): AxiosPromise<{
  total: number;
  rows: AuditTaskVO[];
}> => {
  return request({
    url: '/home/taskCenter/audit/list',
    method: 'get',
    params: query
  });
};

/**
 * 审批文件
 * @param data 审批参数
 */
export const auditDocument = (data: AuditTaskAuditForm) => {
  return request({
    url: '/home/taskCenter/audit/audit',
    method: 'put',
    data: data
  });
};