import { download, get, post } from '@/api/request';

const env = import.meta.env;
const PREFIX = env.VITE_API_PREFIX_PROJECT;
/**
 *
 * @param params
 * memberList: type=0 仿真负责人 type=1 仿真执行人
 * @pMemberList 负责人
 * @eMemberList 执行人
 * @demandStatus 0未确认 1未开始 2进行中 3已完成 4暂停 5驳回
 * @returns
 */
export const addDemandApi = (params: any) => {
  return post(`${PREFIX}demand/addDemand`, params);
};
/**
 *
 * @param type 0 新增待办  1是我确认的
 * @param sortOrder 0-按创建时间正序，1-倒序
 * @returns
 */
export const demandListApi = (params: any) => {
  return get(`${PREFIX}demand/list`, params);
};
export const editDemandApi = (params: any) => {
  return post(`${PREFIX}demand/editDemand`, params);
};
export const deleteDemandApi = (params: any) => {
  return post(`${PREFIX}demand/deleteDemand`, params);
};

export const issuedTaskApi = (params: any) => {
  return post(`${PREFIX}demand/issueTask`, params);
};

export const exportDemandApi = (params: any, filename: string) => {
  return download(`${PREFIX}demand/exportDemand`, params, filename);
};

export const getDemandDetailApi = (params: any) => {
  return get(`${PREFIX}demand/detail`, params);
};

export const queryDemandFilesApi = (params: any) => {
  return post(`${PREFIX}demand/queryDemandFiles`, params);
};
