import request from '@/utils/request';
export function treeAreaDeviceSelect(query) {
  return request({
    url: '/basedata/prodevmnt/device/treeAreaDeviceSelect',
    method: 'get',
    // params: query
  })
}
export function devicetypeList(query) {
  return request({
    url: '/basedata/devicetype/list',
    method: 'get',
    params: {
      powerMainEquFlag: 'Yes'
    }
  })
}

export function deviceQuery(id) {
  return request({
    url: `/basedata/prodevmnt/device/${id}?id=${id}`,
    method: 'get',
    //   params: query
  })
}
export function insertMainDeviceAndCommByDeviceType(data) {
  return request({
    url: `/basedata/prodevmnt/device/insertMainDeviceAndCommByDeviceType`,
    method: 'post',
    data: data
  })
}

export function deviceRemove(id) {
  console.log(id)
  // return
  return request({
    url: `/basedata/prodevmnt/device/remove/${id}`,
    method: 'post',
  })
}
// 修改
export function deviceEdit(data) {
  return request({
    url: `/basedata/prodevmnt/device/edit`,
    method: 'post',
    data: data
  })
}