import { basic as request } from '@/api/request';

/**
 * @description 创建动态表单
 * @url /bpm/form/create
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmFormCreate<
  R = API.ResponseDataString,
  T = API.ResponseDataString,
>(
  body: API.BpmFormSaveReqVO,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>('/bpm/form/create', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}

/**
 * @description 删除动态表单
 * @url /bpm/form/delete
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmFormDelete<
  R = API.ResponseDataBoolean,
  T = API.ResponseDataBoolean,
>(
  params: API.postBpmFormDeleteParams,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>(
    '/bpm/form/delete',
    {},
    {
      params: {
        ...params,
      },
      ...(options || {}),
    },
  );
}

/**
 * @description 获得动态表单
 * @url /bpm/form/get
 * @method GET
 * @author @pubinfo/openapi
 */
export function getBpmFormGet<
  R = API.ResponseDataBpmFormRespVO,
  T = API.ResponseDataBpmFormRespVO,
>(
  params: API.getBpmFormGetParams,
  options?: Parameters<typeof request.Get<R, T>>[1],
) {
  return request.Get<R, T>('/bpm/form/get', {
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/**
 * @description 获得动态表单的精简列表 用于表单下拉框
 * @url /bpm/form/list-all-simple
 * @method GET
 * @author @pubinfo/openapi
 */
export function getBpmFormListAllSimple<
  R = API.ResponseDataListBpmFormRespVO,
  T = API.ResponseDataListBpmFormRespVO,
>(options?: Parameters<typeof request.Get<R, T>>[1]) {
  return request.Get<R, T>('/bpm/form/list-all-simple', {
    ...(options || {}),
  });
}

/**
 * @description 获得动态表单分页
 * @url /bpm/form/page
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmFormPage<
  R = API.ResponseDataPageDataBpmFormRespVO,
  T = API.ResponseDataPageDataBpmFormRespVO,
>(
  body: API.BpmFormPageReqVO,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>('/bpm/form/page', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}

/**
 * @description 获得动态表单的精简列表 用于表单下拉框
 * @url /bpm/form/simple-list
 * @method GET
 * @author @pubinfo/openapi
 */
export function getBpmFormSimpleList<
  R = API.ResponseDataListBpmFormRespVO,
  T = API.ResponseDataListBpmFormRespVO,
>(options?: Parameters<typeof request.Get<R, T>>[1]) {
  return request.Get<R, T>('/bpm/form/simple-list', {
    ...(options || {}),
  });
}

/**
 * @description 更新动态表单
 * @url /bpm/form/update
 * @method POST
 * @author @pubinfo/openapi
 */
export function postBpmFormUpdate<
  R = API.ResponseDataBoolean,
  T = API.ResponseDataBoolean,
>(
  body: API.BpmFormSaveReqVO,
  options?: Parameters<typeof request.Post<R, T>>[2],
) {
  return request.Post<R, T>('/bpm/form/update', body, {
    headers: {
      'Content-Type': 'application/json',
    },
    ...(options || {}),
  });
}
