import request from '@/utils/request'

// 查询应急预案库列表
export function listEmergency(query) {
  return request({
    url: '/flood/emergency/list',
    method: 'get',
    params: query
  })
}

// 查询应急预案库详细
export function getEmergency(planId) {
  return request({
    url: '/flood/emergency/' + planId,
    method: 'get'
  })
}

// 新增应急预案库
export function addEmergency(data) {
  return request({
    url: '/flood/emergency',
    method: 'post',
    data: data
  })
}

// 修改应急预案库
export function updateEmergency(data) {
  return request({
    url: '/flood/emergency',
    method: 'put',
    data: data
  })
}

// 删除应急预案库
export function delEmergency(planId) {
  return request({
    url: '/flood/emergency/' + planId,
    method: 'delete'
  })
}

// 导入应急预案数据
export function importEmergency(data) {
  return request({
    url: '/flood/emergency/importData',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

// 导出应急预案库
export function exportEmergency(query) {
  return request({
    url: '/flood/emergency/export',
    method: 'post',
    params: query
  })
}
