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

/**
 * 分页查询素质报告单列表
 * @param query
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/ems/emsqualityreport/page',
    method: 'get',
    params: query
  });
};

/**
 * 编辑评语
 * @param data
 */
export const updatePY = (data: any) => {
  return request({
    url: '/ems/emsqualityreport/updatePY',
    method: 'post',
    data
  });
};

/**
 * 评语导入
 * @param file
 */
export const importComment = (file: File) => {
  const formData = new FormData();
  formData.append('file', file);
  return request({
    url: '/ems/emsqualityreport/importComment',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
};

/**
 * 设置班级开学时间
 * @param data
 */
export const setClassStartTime = (data: any) => {
  return request({
    url: '/ems/emsqualityreport/setClassStartTime',
    method: 'post',
    data
  });
};

/**
 * 名单导出
 * @param query
 */
export const exportExcel = (query?: any) => {
  return request({
    url: '/ems/emsqualityreport/exportExcel',
    method: 'get',
    params: query,
    responseType: 'blob' // Important for file downloads
  });
};

