import request from '@/utils/request'

// 查询监控单元列表
export function listMonitorUnit(query) {
  return request({
    url: '/business/monitorUnit/list',
    method: 'get',
    params: query
  })
}

// 查询监控单元详细
export function getMonitorUnit(monitorUnitId) {
  return request({
    url: '/business/monitorUnit/' + monitorUnitId,
    method: 'get'
  })
}

// 新增监控单元
export function addMonitorUnit(data) {
  return request({
    url: '/business/monitorUnit',
    method: 'post',
    data: data
  })
}

// 修改监控单元
export function updateMonitorUnit(data) {
  return request({
    url: '/business/monitorUnit',
    method: 'put',
    data: data
  })
}

// 删除监控单元
export function delMonitorUnit(monitorUnitId) {
  return request({
    url: '/business/monitorUnit/' + monitorUnitId,
    method: 'delete'
  })
}
// 查询监控单元类型列表
export function listMonitorUnitType(query) {
  return request({
    url: '/business/monitorUnitType/list',
    method: 'get',
    params: query
  })
}
//查询区域id
export function selectAreaId(query){
  return request({
    url:'/basic/area/list',
    method: 'get',
    params:query

  })
}
//查询场景id与名称
export function getSceneName(){
  return request({
    url: '/business/scene/sceneIdAndName',
    method: 'get'
  })
}
//查询监控单元是否有关联
export function getMonitorIsRelevancy(monitorUnitId){
  return request({
    url: '/business/monitorUnit/getMonitorIsRelevancy?monitorUnitId=' + monitorUnitId,
    method: 'get'
  })
}
