import request from '../index'
const prefix = 'bus/config'

// 查询设备配置 分页
export function getDeviceConfigListPage(data: object) {
  return request({
    url: `${prefix}/list-page`,
    method: 'post',
    data,
  })
}
// 查询设备详情
export function detailDevice(data: object) {
  return request({
    url: `${prefix}/detail`,
    method: 'post',
    data,
  })
}

// 导出
export function exportDevice(data: object) {
  return request({
    url: `${prefix}/list-export`,
    responseType: 'blob',
    method: 'post',
    data,
  })
}

// 添加分组
export function addDevice(data: object) {
  return request({
    url: `${prefix}/add`,
    method: 'post',
    data,
  })
}
// 修改分组
export function updateDevice(data: object) {
  return request({
    url: `${prefix}/update`,
    method: 'post',
    data,
  })
}
// 删除设备
export function delDevice(id: string) {
  return request({
    url: `${prefix}/delete`,
    method: 'post',
    data: {
      ids: [id],
    },
  })
}

// 批量删除设备
export function delDeviceBatch(ids: string[]) {
  return request({
    url: `${prefix}/delete`,
    method: 'post',
    data: {
      ids,
    },
  })
}

