import { http } from "@/utils/http";

type addDeptList = {
  code: number;
  msg: string;
  data: Array<ChartsList>;
};
type ChartsList = {
  id: string;
  name: string;
  cycle: string;
  cycleValue: string;
  assessmentType: number;
  assessmentStatus: number;
  isDelete: number;
  assessmentObjectName: string;
  assessmentObjectId: string;
  dimensionList: Array<dimensionList>;
};
type dimensionList = {
  dimName: string;
  dimId: string;
  totalSore: number;
  quotaList: Array<quotaList>;
};
type quotaList = {
  quotaId: string;
  quotaName: string;
  quotaWeight: string;
  quotaScore: number;
  finalValue: number;
  startValue: number;
  challengeValue: number;
  ranking: number;
  assessmentName: string;
  assessmentId: string;
  assessmentModelName: string;
  assessmentModelId: string;
  assessmentObjectId: string;
  assessmentObjectName: string;
  dimId: string;
  dimensionName: string;
  code: number;
  msg: string;
};
// 指标
export const getAssessmentIndName = (params?: any) => {
  return http.request<addDeptList>(
    "get",
    "/specialPortrait/getAssessmentIndName",
    {
      params
    }
  );
};
// 所有考核
export const getAssessmentList = (params?: any) => {
  return http.request<addDeptList>(
    "get",
    "/specialPortrait/getAssessmentList",
    {
      params
    }
  );
};
// 排名专题画像
export const getChartsList = params => {
  return http.request<addDeptList>("get", "/specialPortrait/getChartsList", {
    params
  });
};
// 考核活动查询考核模板
export const getModelListByAssessmentId = params => {
  return http.request<addDeptList>(
    "get",
    "/specialPortrait/getModelListByAssessmentId",
    {
      params
    }
  );
};
// 员工维度专题画像
export const getPersonDimensionChartsList = params => {
  return http.request<addDeptList>(
    "get",
    "/specialPortrait/getPersonDimensionChartsList",
    {
      params
    }
  );
};
// 员工画像维度详情专题画像
export const getPersonDimensionChartsRanking = params => {
  return http.request<addDeptList>(
    "get",
    "/specialPortrait/getPersonDimensionChartsRanking",
    {
      params
    }
  );
};
// 根据考核模板查询所有被考核对象
export const getUserListObjectByModelId = params => {
  return http.request<quotaList>(
    "get",
    "/specialPortrait/getUserListObjectByModelId",
    {
      params
    }
  );
};
// 根据考核模板查询所有被考核对象
export const getDeptListByUserList = data => {
  return http.request<quotaList>(
    "post",
    "/specialPortrait/getDeptListByUserList",
    {
      data
    }
  );
};
