import request from '@/utils/request';
// 初始化list
export function getList(query) {
  return request({
    url: '/basedata/patrolpointmnt/patrolpoint/list',
    method: 'get',
    params: query
  })
}
// 删除
export function postRemove(query) {
  return request({
    url: `/basedata/patrolpointmnt/patrolpoint/remove/${query}`,
    method: 'post',
    // params: query
  })
}

// 新增
export function postAdd(query) {
  return request({
    url: '/basedata/patrolpointmnt/patrolpoint',
    method: 'post',
    data: query
  })
}

// 编辑查询
export function getItem(query) {
  return request({
    url: `/basedata/patrolpointmnt/patrolpoint/${query}`,
    method: 'get',
  })
}
// 编辑
export function edit(query) {
  return request({
    url: `/basedata/patrolpointmnt/patrolpoint/edit`,
    method: 'post',
    data: query
  })
}
// 智能识别类型父级
export function algList(query) {
  return request({
    url: `/basedata/alg/list`,
    method: 'get',
    // params: query
  })
}
// 智能识别类型子级
export function subtypeList(query) {
  return request({
    url: `/basedata/subtype/list`,
    method: 'get',
    // params: query
  })
}

// ************

// 查询巡检点位列表
export function listPatrolpoint(query) {
  return request({
    url: '/basedata/patrolpointmnt/patrolpoint/list',
    method: 'get',
    params: query
  })
}

// 查询巡检点位详细
export function getPatrolpoint(patrolpointId) {
  return request({
    url: '/basedata/patrolpointmnt/patrolpoint/' + patrolpointId,
    method: 'get'
  })
}

// 新增巡检点位
export function addPatrolpoint(data) {
  return request({
    url: '/basedata/patrolpointmnt/patrolpoint',
    method: 'post',
    data: data
  })
}

// 修改巡检点位
export function updatePatrolpoint(data) {
  return request({
    url: '/basedata/patrolpointmnt/patrolpoint/edit',
    method: 'post',
    data: data
  })
}

// 删除巡检点位
export function delPatrolpoint(patrolpointId) {
  return request({
    url: '/basedata/patrolpointmnt/patrolpoint/remove/' + patrolpointId,
    method: 'post'
  })
}

// 批量保存标准点位
export function addBatchList(data) {
  return request({
    url: '/basedata/patrolpointmnt/stdpatrolpoint/addBatchList',
    method: 'post',
    data: data
  })
}


// 获取区域设备树
export function getAreaDeviceTree() {
  return request({
    url: '/basedata/prodevmnt/device/treeAreaDeviceSelect',
    method: 'get'
  })
}

//获取监控点位绑定的预置点列表
export function getPatroPointDevicePoints(patrolpointId) {
  return request({
    url: '/patrol/preset',
    method: 'get',
    params: {
      patrolpointId
    }
  })
}
//解绑预置点
export function unbindPoint(presetPosIds) {
  return request({
    url: '/patrol/preset/remove/' + presetPosIds,
    method: 'get'
  })

}


//解绑预置点
export function getBdconfigMainsystem() {
  return request({
    url: '/basedata/bdconfig/mainsystem/getBdconfigMainsystem',
    method: 'post'
  })

}


