import createAxios from '@/utils/request'
import {ADVANCE_BOOT} from '@/utils/constantRequest'


/**
 * 导出暂降模板
 */
export const downloadTemplate = () => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgEvent/downloadTemplate',
        method: 'GET',
        responseType: 'blob'
    })
}

/**
 * 导出暂降数据
 */
export const exportEventData = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgEvent/exportEventData',
        method: 'POST',
        data: data,
        responseType: 'blob'
    })
}


/**
 * 导入暂降数据
 */
export const importEventData = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgEvent/importEventData',
        method: 'POST',
        data: data
    })
}

/**
 * 新增业务用户
 */
export const calcEventLoss = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgEvent/calcLoss?id=' + data,
        method: 'GET'
    })
}


/**
 * 查询生产线下所有暂降事件
 */
export const getEventDataByProductLineId = (data: any) => {
    return createAxios({
        url: ADVANCE_BOOT + '/sgEvent/getEventDataByProductLineId',
        method: 'POST',
        data: data
    })
}


/**
 * 删除业务用户
 */
export const deleteSgEvent = (data: any) => {
    let ids = [data]
    return createAxios({
        url: ADVANCE_BOOT + '/sgEvent/delete',
        method: 'POST',
        data: ids
    })
}

