import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SubmissionTaskVO, SubmissionTaskQuery, SubmissionTaskSubmitForm } from './types';

/**
 * 查询文件递交任务列表
 * @param query 查询参数
 */
export const listSubmissionTasks = (query: SubmissionTaskQuery): AxiosPromise<{
  total: number;
  rows: SubmissionTaskVO[];
}> => {
  return request({
    url: '/home/taskCenter/submission/list',
    method: 'get',
    params: query
  });
};

/**
 * 递交文件
 * @param data 递交参数
 */
export const submitDocument = (data: SubmissionTaskSubmitForm) => {
  return request({
    url: '/home/taskCenter/submission/submit',
    method: 'put',
    data: data
  });
};

/**
 * 查询文档审核记录
 * @param query 查询参数
 */
export const listSubmissionAuditLog = (query: any): AxiosPromise<any> => {
  return request({
    url: '/home/taskCenter/logAudit',
    method: 'get',
    params: query
  });
};