import request from '@/utils/request'
// 查询电子围栏列表
export function listFence(data) {
  return request({
    url: '/enterprise/fence/fenceselectList',
    method: 'post',
    data
  })
}

// 查询电子围栏选择列表
export function fenceArray(data) {
  return request({
    url: '/enterprise/fence/fenceArray',
    method: 'post',
    data
  })
}

//添加
export function addfence(data) {
  return request({
    url: '/enterprise/fence/add',
    method: 'post',
    data
  })
}
//修改
export function updfence(data) {
  return request({
    url: `/enterprise/fence/upd/${data.id}`,
    method: 'post',
    data
  })
}

//删除
export function delElectronById(id) {
  return request({
    url: '/enterprise/fence/delElectronById/'+id,
    method: 'post',
  })
}

//根据id设置围栏
export function setFenceWay(data) {
  return request({
    url: '/enterprise/fence/setFenceWay',
    method: 'post',
    data
  })
}


//开启围栏
export function openFence(id) {
  return request({
    url: '/enterprise/fence/open/'+id,
    method: 'post',
    data
  })
}
//回显
export function findElectronicByid(id) {
  return request({
    url: '/enterprise/fence/findElectronicByid/'+id,
    method: 'post',
  })
}

//关闭围栏
export function closeFence(id) {
  return request({
    url: '/enterprise/fence/close/'+id,
    method: 'post',
    data
  })
}
