import request from '@/utils/request'

// 查询标签列表
export function listTable(query) {
  return request({
    url: '/center-monitor/SetLabel/getSetLabelList',
    method: 'get',
    params: query
  })
}

// 新增标签
export function addLabel(data) {
  return request({
    url: '/center-monitor/SetLabel/addLabel',
    method: 'post',
    data: data
  })
}

// 修改标签
export function updateLabel(data) {
  return request({
    url: '/center-monitor/SetLabel/updateLabel',
    method: 'post',
    data: data
  })
}

// 删除标签
export function deleteLabel(id) {
  return request({
    url: '/center-monitor/SetLabel/deleteLabel/' + id,
    method: 'delete'
  })
}

// 查询标签修改页
export function getlabel(id) {
   return request({
     url: '/center-monitor/SetLabel/getLabels/' + id,
     method: 'get',
   })
}

// 设置标签页查询
export function Searchtags(name) {
  return request({
    url: '/center-monitor/SetLabel/Searchtags/' + name,
    method: 'get',
  })
}

// 查询摄像头设备列表
export function listdevice(query) {
  return request({
    url: '/center-monitor/SetLabel/getdevice',
    method: 'get',
    params: query
  })
}

// 添加摄像头
export function addCamera(data) {
  return request({
    url: '/center-monitor/SetLabel/addCamera',
    method: 'post',
    data: data
  })
}

// 根据标签id查询摄像头设备列表
export function getCameraByLabelId(query) {
  return request({
    url: '/center-monitor/SetLabel/getCameraByLabelId',
    method: 'get',
    params: query
  })
}

// 根据标签id和摄像头id删除
export function removeCameraByLabelId(data) {
  return request({
    url: '/center-monitor/SetLabel/removeCameraByLabelId',
    method: 'delete',
    params: data
  })
}

// 获取大华摄像头的预置点
export function getPresetPoints(channelId) {
  return request({
    url: '/center-monitor/DahuaController/getPresetPoints?channelId=' + channelId,
    method: 'get'
  })
}

// 选择预置点
export function updatePresetPoint(data) {
  return request({
    url: '/center-monitor/SetLabel/updatePresetPoint',
    method: 'post',
    data: data
  })
}

// 根据标签子表id和设备id查询预置点信息
export function getCameraByIdAndDeviceId(query) {
  return request({
    url: '/center-monitor/SetLabel/getCameraByIdAndDeviceId',
    method: 'get',
    params: query
  })
}

