/**
 * 桥梁管理接口
 */
import request from '@/utils/request'

// 获取桥梁详情
export function getDetail(id) {
  return request({
    url: 'bridge/bridge/detail',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function updateBridge(params) {
  return request({
    url: 'bridge/bridge/update',
    method: 'post',
    params
  })
}
// 批量导出
export function exportRecords(params) {
  return request({
    url: 'device/batchExport',
    method: 'get',
    timeout: 120000,
    params,
    responseType: 'blob' // 这一步也很关键，一定要加上 responseType 值为 blob
  })
}

export function getContentList(params) {
  return request({
    url: 'maintain/contentByType',
    method: 'get',
    params: {
      type: params
    }
  })
}
// 批量导出报警
export function batchExportAlarm(params) {
  return request({
    url: 'person/batchExport',
    method: 'get',
    timeout: 120000,
    params,
    responseType: 'blob' // 这一步也很关键，一定要加上 responseType 值为 blob
  })
}

// 编辑
export function editRecord(params) {
  return request({
    url: 'maintain/update',
    method: 'post',
    params
  })
}
// 新增
export function addRecord(params) {
  return request({
    url: 'maintain/add',
    method: 'post',
    params
  })
}
// 删除
export function delRecord(id) {
  return request({
    url: 'maintain/delete',
    method: 'post',
    params: {
      id: id
    }
  })
}
