import { http } from "@/utils/http";
// 维度
type dimension = {
  code: number;
  msg: string;
  data: boolean;
};
type dimensionList = {
  code: number;
  msg: string;
  data: Array<any>;
};
// 新建
export const postAddDimension = data => {
  return http.request<dimensionList>("post", "/dimensionInfo/addDimension", {
    data
  });
};
// 详情
export const getDimensionInfo = (id: number) => {
  return http.request<dimensionList>("get", `/dimensionInfo/getInfo/id=${id}`);
};
// 删除
export const getDimensionRemove = (id: number) => {
  return http.request<dimension>("get", `/dimensionInfo/remove/${id}`);
};
// 更新编辑
export const postUpdateDept = data => {
  return http.request<dimension>("post", "/dimensionInfo/update", { data });
};
// 根据维度id获取指标信息
export const getQuotaByDimensionId = params => {
  return http.request<dimensionList>(
    "get",
    "/templateIndicatorRelation/getRelationBy",
    { params }
  );
};
//
export const postAddRelationList = data => {
  return http.request<dimensionList>(
    "post",
    "/templateIndicatorRelation/addRelation",
    { data }
  );
};
