import { http } from "@/utils/http";
// 指标列表
type QuotaPage = {
  code: number;
  msg: string;
  data: boolean;
};
type QuotaPageList = {
  code: number;
  msg: string;
  data: recordsList;
};
type recordsList = {
  totalRow: number;
  records: Array<any>;
};

// 一次性
export const postAddDisposableQuota = data => {
  return http.request<QuotaPageList>("post", "/quota/addDisposableQuota", {
    data
  });
};
// 分页查询
export const getQuotaPageList = params => {
  return http.request<QuotaPageList>("get", "/quota/getQuotaPageList", {
    params
  });
};
// 添加
export const addQuota = data => {
  return http.request<QuotaPage>("post", "/quota/addQuota", { data });
};
// 删除
export const delQuota = id => {
  return http.request<QuotaPage>("get", `/quota/delQuota/${id}`);
};
// 修改
export const postUpdateDept = data => {
  return http.request<QuotaPage>("post", "/quota/updateQuota", { data });
};
// 来源
export const getQuotaSourceList = (data?: any) => {
  return http.request<QuotaPage>("get", "/quota/getQuotaSourceList", { data });
};

// // 下载
export const GetdownloadDataRosterTemplate = () => {
  return http.request<any>("get", "/quota/downloaQuotaTemplate");
};
// 批量导入
export const postImportQuotaTemplate = data => {
  return http.request<QuotaPage>("post", "/quota/importQuotaTemplate", data);
};
// 日志
export const getQuotaLogInfo = data => {
  return http.request<QuotaPageList>("get", `/quota/getQuotaLogInfo/${data}`);
};
