import request from 'src/utils/request'
import sysRequest from "@/utils/sysRequest";

// 查询控制部件管理列表
export function listControlunit(query) {
  return request({
    url: '/qrcode/device/controlunit/list',
    method: 'get',
    params: query
  })
}

// 查询控制部件管理详细
export function getControlunit(unitId) {
  return request({
    url: '/qrcode/device/controlunit/' + unitId,
    method: 'get'
  })
}

// 新增控制部件管理
export function addControlunit(data) {
  return request({
    url: '/qrcode/device/controlunit',
    method: 'post',
    data: data
  })
}

// 修改控制部件管理
export function updateControlunit(data) {
  return request({
    url: '/qrcode/device/controlunit',
    method: 'put',
    data: data
  })
}

// 删除控制部件管理
export function delControlunit(unitId) {
  return request({
    url: '/qrcode/device/controlunit/' + unitId,
    method: 'delete'
  })
}

export function unboundControlunit(unitId) {
  return request({
    url: '/qrcode/device/controlunit/unbound/' + unitId,
    method: 'post'
  })


}

export function uploadControlunit(data) {
  return sysRequest({
    url: '/qrcode/device/controlunit/pda/upload',
    method: 'post',
    data: data
  })
}
