import { WeaTools } from "ecCom";

export const getSearchCondition = (params = {}) =>
  WeaTools.callApi("/api/kq/report/getSearchCondition", "POST", {
    ...params,
    reportType: "month",
  });

export const getKQReport = (params = {}) =>
  WeaTools.callApi("/api/kq/report/getKQReport", "POST", {
    ...params,
    reportType: "month",
  });

export const formatData = (params = {}) =>
  WeaTools.callApi("/api/kq/report/format", "POST", params);

export const getTabs = (params = {}) =>
  WeaTools.callApi("/api/kq/report/detail/getTabs", "POST", params);

export const getKQReportDetial = (params = {}) =>
  WeaTools.callApi("/api/kq/report/detail/getKQReportDetail", "POST", {
    ...params,
    reportType: "month",
  });

export const getKQReportSignDetial = (params = {}) =>
  WeaTools.callApi("/api/kq/report/detail/getDailyDetialInfo", "POST", {
    ...params,
    reportType: "month",
  });

export const getRightMenu = (params = {}) =>
  WeaTools.callApi("/api/kq/report/getRightMenu", "GET", {
    ...params,
    reportType: "month",
  });

export const getReportMoudleTabs = params => WeaTools.callApi('/api/hrm/kq/reportFieldDefine/getReportMoudleTabs', 'POST', params)

export const getReportMoudleForm = params => WeaTools.callApi('/api/hrm/kq/reportFieldDefine/getReportMoudleForm', 'POST', params)

export const saveReportMoudle = params => WeaTools.callApi('/api/hrm/kq/reportFieldDefine/saveReportMoudle', 'POST', params)

export const deleteReportMoudle = params => WeaTools.callApi('/api/hrm/kq/reportFieldDefine/deleteReportMoudle', 'POST', params)

export const getFieldOrderDefine = params => WeaTools.callApi('/api/hrm/kq/reportFieldDefine/getFieldOrderDefine', 'POST', params)

export const saveFieldOrderDefine = params => WeaTools.callApi('/api/hrm/kq/reportFieldDefine/saveFieldOrderDefine', 'POST', params)

export const init = (params = {}) => Promise.all([getSearchCondition(), getRightMenu()]);

export const exportExcel = (params = {}) => WeaTools.callApi('/api/kq/report/exportExcel', 'POST', {...params, reportType: 'month'});
