/**
 * 设备管理接口
 */
import request from '@/utils/request'
// 液位配置查询
export function getLiquidConfigList(params) {
  return request({
    url: 'liquidConfig/list',
    method: 'get',
    params
  })
}

// 修改液位配置
export function editLiquidConfig(params) {
  return request({
    url: 'liquidConfig/config',
    method: 'post',
    params
  })
}

// 根据设备编号，设备类型，设备配置状态获取设备列表
export function getDeviceSimpleList(deviceType, configStatus) {
  return request({
    url: 'device/listByConfig',
    method: 'get',
    params: {
      deviceType: deviceType,
      configStatus: configStatus
    }
  })
}

// 批量导入
export function batchImportLiquidConfig(fileobj) {
  const param = new FormData()
  param.append('file', fileobj)
  return request({
    url: 'liquidConfig/batchImport',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: param
  })
}
// 批量导出
export function batchExportLiquidConfig(params) {
  return request({
    url: 'liquidConfig/batchExport',
    method: 'get',
    params,
    responseType: 'blob' // 这一步也很关键，一定要加上 responseType 值为 blob
  })
}
