import request from "./core/request";

/** 获取可以提交的申请项 */
export function queryProjectList() {
  return request<
    Resp<
      API.PropsWithPagination<{
        id: string;
        thingName: string;
        icon: string;
      }>
    >
  >("/hncy/matterInfo/listByUser", {
    method: "POST",
  });
}
/** @description 获取模版配置 */
export function getTemplateConfig(id: string) {
  return request("/hncy/matterInfo/getInfo", {
    method: "POST",
    params: {
      id,
    },
  });
}

/**
 * @description 获取当前节点配置
 */
export function getApplicationNodeConfig(data: any) {
  return request("/hncy/flow/apply-element-info", {
    method: "GET",
    params: { id: data },
  });
}

/** 保存申请项 */
export function saveApplyItem(data: any) {
  return request<Resp<any>>("/hncy/record/createApplicantRecord", {
    method: "POST",
    data: data,
  });
}
/** @description 完成审批 */
export function completeExamine(data: any) {
  return request<Resp<any>>("/hncy/flow/complete", {
    method: "POST",
    header: {
      "content-type": "application/x-www-form-urlencoded",
    },
    data,
  });
}
/** @description 提交审批 */
export function startExamine(data: any) {
  return request<Resp<any>>("/hncy/flow/start", {
    method: "POST",
    data,
    header: {
      "content-type": "application/x-www-form-urlencoded",
    },
  });
}
