import request from '@/utils/request';

export function deviceTypeList() { // 设备类型
  return request({
    url: 'devices/devicetype',
    method: 'get',
  });
}

export function deviceList(page, limit, type) {
  return request({
    url: 'devices/devicelist?page=' + page + '&limit=' + limit + '&type=' + type,
    method: 'get',
  });
}

export function deviceDataInfo(id) {
  return request({
    url: '/devices/deviceDataInfo/' + id,
    method: 'get',
  });
}

export function deviceDataSearch(data) {
  return request({
    url: '/devices/deviceDataSearch',
    method: 'post',
    data,
  });
}

export function deviceBasket() {
  return request({
    url: '/devices/deviceBasket',
    method: 'get',
  });
}

export function deviceDelete(id, type) {
  return request({
    url: '/devices/deviceDelete?id=' + id + '&type=' + type,
    method: 'get',
  });
}

export function deviceBasketList() {
  return request({
    url: '/devices/deviceBasketList',
    method: 'get',
  });
}

export function UpPaperBasket(id) {
  return request({
    url: '/devices/UpPaperBasket/' + id,
    method: 'get',
  });
}

export function addClassify(data) {
  return request({
    url: '/devices/addClassify/' + data,
    method: 'get',
  });
}
// 更新设备分类
export function updateClassify(data) {
  return request({
    url: '/devices/updateClassify',
    method: 'post',
    data: data,
  });
}

export function delteClassify(id) {
  return request({
    url: '/devices/delteClassify/' + id,
    method: 'get',
  });
}

export function equipment() {
  return request({
    url: '/devices/equipment',
    method: 'get',
  });
}

export function detedevice(data) {
  return request({
    url: '/devices/detedevice',
    method: 'post',
    data,
  });
}

export function police(dete) {
  return request({
    url: '/devices/police',
    method: 'get',
  });
}

export function deviceLocation() {
  return request({
    url: '/devices/deviceLocation',
    method: 'get',
  });
}

export function addUserDevice() {
  return request({
    url: '/devices/addUserDevice',
    method: 'get',
  });
}

export function control(page, limit, type, formData) {
  return request({
    url: 'devices/control?page=' + page + '&limit=' + limit + '&type=' + type + '&search=' + JSON.stringify(formData),
    method: 'get',
  });
}

export function adddevice(data) {
  return request({
    url: '/devices/adddevice',
    method: 'post',
    data,
  });
}

export function addcontactsuser(data) {
  return request({
    url: '/user/addcontactsuser',
    method: 'post',
    data,
  });
}

export function userdeviceList(data) {
  return request({
    url: '/devices/userdevicelist',
    method: 'post',
    data,
  });
}

export function postupdatedevice(id) {
  return request({
    url: '/devices/updatedevice?deid=' + id,
    method: 'get',
  });
}

export function updedata(data) {
  return request({
    url: '/devices/updatedevice',
    method: 'post',
    data,
  });
}

export function devicepolice(devicenum) {
  return request({
    url: '/devices/devicepolice?devicenum=' + devicenum,
    method: 'get',
  });
}

export function devicepoliceinfo(devicenum) {
  return request({
    url: '/devices/devicepoliceinfo?devicenum=' + devicenum,
    method: 'get',
  });
}

export function history_device_type() {
  return request({
    url: '/devices/history_device_type',
    method: 'get',
  });
}

