import request from '@/utils/request'
import { download } from '@/utils/request'

// 查询报警配置列表
export function listAlarmLog(query) {
    return request({
        url: '/alarm_record/record/list',
        method: 'get',
        params: query
    })
}

// 查询报警配置详细信息
export function getAlarmLog(logId) {
    return request({
        url: '/alarm_record/record/' + logId,
        method: 'get'
    })
}

// 新增报警配置
export function addAlarmLog(data) {
    return request({
        url: '/alarm_record/record',
        method: 'post',
        data: data
    })
}

// 修改报警配置
export function updateAlarmLog(data) {
    return request({
        url: '/alarm_record/record',
        method: 'put',
        data: data
    })
}

// 删除报警配置
export function delAlarmLog(logId) {
    return request({
        url: '/alarm_record/record/' + logId,
        method: 'delete'
    })
}

// 导出报警配置列表
export function downloadAlarmLog(data) {
    download(
        '/alarm_record/record/export',
        data,
        `alarmLog_${new Date().getTime()}.xlsx`)
}
