import request from '@/utils/request'

// 查询密闭空间和人员密集场所列表
export function listSpace(query) {
  return request({
    url: '/system/space/list',
    method: 'get',
    params: query
  })
}

// 查询密闭空间和人员密集场所详细
export function getSpace(id) {
  return request({
    url: '/system/space/' + id,
    method: 'get'
  })
}

// 新增密闭空间和人员密集场所
export function addSpace(data) {
  return request({
    url: '/system/space',
    method: 'post',
    data: data
  })
}

// 修改密闭空间和人员密集场所
export function updateSpace(data) {
  return request({
    url: '/system/space',
    method: 'put',
    data: data
  })
}

// 删除密闭空间和人员密集场所
export function delSpace(id) {
  return request({
    url: '/system/space/' + id,
    method: 'delete'
  })
}

// 导出密闭空间和人员密集场所
export function exportSpace(query) {
  return request({
    url: '/system/space/export',
    method: 'get',
    params: query
  })
}

// 查询无绑定的关联设备信息
export function getDdeviceDetailInfo(data) {
  return request({
    url: '/device/device/selectDetailInfo',
    method: 'post',
    data: data
  })
}

// 新增关联设备信息
export function addDetailInfos(data) {
  return request({
    url: '/device/device/insertDetailInfo',
    method: 'post',
    data: data
  })
}

// 删除关联设备信息
export function deleteDetailInfo(deviceId) {
  return request({
    url: '/device/device/deleteDetailInfo',
    method: 'delete',
    data: deviceId
  })
}

// 解除空间与关联设备关系
export function deleteDeviceDetailInfo(deviceId) {
  return request({
    url: '/device/device/deleteDeviceDetailInfo',
    method: 'delete',
    data: deviceId
  })
}

// 删除关联设备信息（批量）
export function deleteeListDetailInfo(deviceId) {
  return request({
    url: '/device/device/deleteeListDetailInfo',
    method: 'delete',
    data: deviceId
  })
}

// 查询已经关联的关联设备信息
export function selectDetailInfoList(data) {
  return request({
    url: '/device/device/selectDetailInfoList',
    method: 'post',
    data: data
  })
}

// 修改关联设备绑定
export function updateDetailInfoLists(data) {
  return request({
    url: '/device/device/updateDetailInfoList',
    method: 'post',
    data: data
  })
}
