import { http } from "@/utils/http";
// 指标列表
type templateInfo = {
  code: number;
  msg: string;
  data: boolean;
};
type templateInfoList = {
  code: number;
  msg: string;
  data: {
    records: Array<recordsList>;
    pageNumber: number;
    pageSize: number;
    totalPage: number;
    totalRow: number;
  };
};
type recordsList = {
  name: string;
  id: string;
  cycle: string;
  cycleValue: string;
  assessmentType: string;
  assessmentStatus: string;
  isDelete: string;
  extendField: string;
};
// 分页查询
export const getAssessmentPageList = params => {
  return http.request<templateInfoList>(
    "get",
    "/assessment/getAssessmentPageList",
    {
      params
    }
  );
};
export const getPageScoreInfoByAssessment = data => {
  return http.request<templateInfo>(
    "post",
    `/assessment/pageScoreInfoByAssessment`,
    {
      data
    }
  );
};
// 删除考核信息
export const getDelAssessment = id => {
  return http.request<templateInfo>("get", `/assessment/delAssessment/${id}`);
};
// 复制考核信息
export const postCopyAssessment = data => {
  return http.request<templateInfo>("post", `/assessment/copyAssessment`, {
    data
  });
};
