import request from "@/service/request";

//////////////////////////// 服务地址 ////////////////////////////

// 致拓宜搭服务地址
function _aliworkZitooUrl(url) {
  return `https://yida.100ali.com/api/yida${url}`;
}

/////////////////////  业务逻辑:thunk包装调用  /////////////////////

/**
 * @exports 查询单据数据
 * @param conditionList: 原关联表单的字段, 如 [{"fieldName":"selectField_k9tw8gaq","value":"天城水榭一期"}] - 只能查询当前formId下的表单字段
 **/
export function aliworkTheDynamicSubsidiary({
  userId,
  appType,
  formId,
  conditionList,
  pageIndex = 1,
  pageSize = 10
}) {
  const params = {
    pageIndex,
    pageSize,
    userId,
    appType,
    formId
  };
  if (conditionList) params.conditionList = conditionList;
  return request.postData(_aliworkZitooUrl("/form/select"), params);
}
