import request from '/@/utils/request';

/**
 * 分页查询考核指标列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/assessmentpoint/page',
    method: 'get',
    params: query
  });
};

/**
 * 获取考核指标列表（不分页）
 * @param query
 */
export const getList = (query?: any) => {
  return request({
    url: '/stuwork/assessmentpoint/list',
    method: 'get',
    params: query
  });
};

/**
 * 根据考核项ID获取考核指标列表
 * @param categortyId
 */
export const getAssessmentPointListByacId = (categortyId: string) => {
  return request({
    url: '/stuwork/assessmentpoint/getAssessmentPointListByacId',
    method: 'get',
    params: { categortyId }
  });
};

/**
 * 新增考核指标
 * @param data
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/assessmentpoint',
    method: 'post',
    data
  });
};

/**
 * 获取详情
 * @param id
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/assessmentpoint/detail',
    method: 'get',
    params: { id }
  });
};

/**
 * 编辑考核指标
 * @param data
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/assessmentpoint/edit',
    method: 'post',
    data
  });
};

/**
 * 删除考核指标
 * @param ids
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/assessmentpoint/delete',
    method: 'post',
    data: ids
  });
};
