import { defHttp } from '/@/utils/http/axios';
import { setParams } from '/@/utils/index';

enum Api {
  archivesAccessReturnQueryPage = '/archives/accessReturn/query/page',
  archivesAccessReturnDetail = '/archives/accessReturn/access',
  archivesAccessReturnAdd = '/archives/accessReturn/addOrEdit',
  archivesAccessReturnRemove = '/archives/accessReturn/removeByIds',
}

/**
 *
 * @author lf
 * @date  2023/06/17 10:41
 * @description: 根据条件查询血透通路转归列表,权限 - archives:accessReturn:query
 * @method: POST
 * @param:
 * @return:
 *       {String}  vascularAccessId  血管通路id
 *       {Date}  returnTime  转归时间
 *       {String}  returnCause  转归原因
 *       {String}  creatorName  创建人名称
 *       {String}  updatorName  更新人名称
 */

export const archivesAccessReturnQueryPage = (params?: object) => {
  return defHttp.post({ url: Api.archivesAccessReturnQueryPage, params: setParams(params) });
};
/**
 *
 * @author fan
 * @date  2023/06/17 10:41
 * @description: 根据id查询血透通路转归详细信息,权限 - archives:accessReturn:query
 * @method: GET
 * @param:  id 血透通路转归主键id
 * @return:
 *       {String}  vascularAccessId  血管通路id
 *       {Date}  returnTime  转归时间
 *       {String}  returnCause  转归原因
 *       {String}  creatorName  创建人名称
 *       {String}  updatorName  更新人名称
 */
export const archivesAccessReturnDetail = (id: string) => {
  return defHttp.get({ url: Api.archivesAccessReturnDetail + '/' + id });
};

/**
 *
 * @author lf
 * @date  2023/06/17 10:41
 * @description: 添加血透通路转归,权限 - archives:accessReturn:add
 * @method: POST
 * @param:
 *       {String}  vascularAccessId  血管通路id
 *       {Date}  returnTime  转归时间
 *       {String}  returnCause  转归原因
 *       {String}  creatorName  创建人名称
 *       {String}  updatorName  更新人名称
 * @return:
 *       0 添加失败
 *       1 添加成功
 */
export const archivesAccessReturnAdd = (params?: object) => {
  return defHttp.post({ url: Api.archivesAccessReturnAdd, params: params });
};

/**
 * @description: 删除,权限 - archives:accessReturn:remove
 * @method: POST
 */
export const archivesAccessReturnRemove = (params: Array<string | number>) => {
  return defHttp.post({ url: Api.archivesAccessReturnRemove, params: params });
};
