// @ts-ignore
/* eslint-disable */

// 该文件自动生成，请勿手动修改！

// --------------------------------------------------------------------------
// TQES报表服务
// --------------------------------------------------------------------------

import { request, RequestOptions } from '@umijs/max';
import contentDisposition from 'content-disposition';

/** 根据监测计划ID导出全区优势薄弱 POST /api/exam/reporting/tqes/export-total-adv-weak */
export async function exportTotalAdvWeak(
    params: {
        /**  */
        examplanid: number;
    },
    options?: { [key: string]: any },
) {
    const url = '/api/exam/reporting/tqes/export-total-adv-weak';
    const config = {
        method: 'POST',
        params,
        ...(options || {}),
        responseType: 'blob',
        getResponse: true,
    } as RequestOptions;
    const res = await request(url, config);
    const hcd = res.request.getResponseHeader('Content-Disposition');
    if (!hcd) {
        return null;
    }
    let fileName = '';
    const cd = contentDisposition.parse(hcd);
    if (cd?.parameters?.filename) {
        fileName = cd?.parameters?.filename;
    }
    return { fileName, data: res.data as Blob } as API.FileResponse;
}

export default {
    /** 根据监测计划ID导出全区优势薄弱 POST /api/exam/reporting/tqes/export-total-adv-weak */
    exportTotalAdvWeak,
};
