import request from '@/utils/request'

/**
 * 非平行度修正计算
 */
export function calculate(data) {
    return request({
        url: `/calculate/nonparallelismCorrection/calculate`,
        method: 'post',
        data: data
    })
}

/**
 * 导入Excel数据
 */
export function importExcel(data) {
    return request({
        url: `/calculate/nonparallelismCorrection/import`,
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}

/**
 * 导出计算结果
 */
export function exportExcel(data) {
    return request({
        url: `/calculate/nonparallelismCorrection/export`,
        method: 'post',
        data: data,
        responseType: 'blob'
    })
}

/**
 * 下载导入模板
 */
export function downloadTemplate() {
    return request({
        url: '/calculate/nonparallelismCorrection/template',
        method: 'get',
        responseType: 'blob'
    })
}

/**
 * 获取工作表名称
 */
export function getSheetNames(data) {
    return request({
        url: '/calculate/nonparallelismCorrection/sheetNames',
        method: 'post',
        data: data,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}