import { WeaTools } from "ecCom";

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

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

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: "calendar",
  });

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

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

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

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