import { WeaTools } from "ecCom";
import { postFetch } from "../util/request";

// form基础数据
export const getBaseForm = (params) => {
  return WeaTools.callApi("/api/demo01/getFormDemo", "GET", params);
};

// form保存
export const doSaveBaseSet = (params) => {
  return WeaTools.callApi("/api/demo01/saveFormDemo", "POST", params);
};

// 获取高级搜索条件
export const getCondition = (params) => {
  return WeaTools.callApi("/api/demo03/weatableConditonDemo", "GET", params);
};

// 获取table数据
export const getTableDatas = (params) => {
  return WeaTools.callApi("/api/demo03/weatableDemo", "GET", params);
};
//获取日志列表
export const getLogs = params => {
  const payload = {
    ...params, module: "hrsa", dataset: "dataset", authParams: "{}", transMethod: "hrsa",
    showColums: "[{\"columName\":\"操作时间\",\"columIndex\":\"createdate\",\"width\":\"5%\"},{\"columName\":\"操作人\",\"columIndex\":\"operatorname\",\"width\":\"2%\"},{\"columName\":\"操作类型\",\"columIndex\":\"operatetypename\",\"width\":\"5%\"},{\"columName\":\"对象\",\"columIndex\":\"targetname\",\"width\":\"4%\"},{\"columName\":\"客户端IP\",\"columIndex\":\"clientip\",\"width\":\"5%\"},{\"columName\":\"修改详情\",\"columIndex\":\"operatedesc\",\"width\":\"2%\"}]"
  };
  return postFetch("/api/bs/hrmelog/elog/getLogs", payload);
};
//获取单条操作记录的更新明细
export const getDetailChanges = params => {
  const payload = {
    ...params, module: "hrsa", detailTransMethod: "elogDemoDetail"
  };
  return postFetch("/api/bs/hrmelog/elog/getDetailChanges", payload);
};
//获取薪资账套全列表
export const getSalarysobListAll = params => {
  return postFetch("/api/bs/hrmsalary/salarysob/listAllByAuth", params);
};
//补算
export const supplementAcctRecord = (params) => {
  return postFetch("/api/bs/hrmsalary/salaryacct/supplementAcctRecord", params);
};
