import request from '@/utils/request';
//查询tuya设备列表
export function getList(data) {
  let param =
    '?startIndex=' + (data.page - 1) * data.size + '&pageSize=' + data.size;
  // if (data.ldDeviceSerial != '' && data.ldDeviceSerial != undefined) {
  param += '&OrderString=date';
  param += '&orderType=desc';
  // }
  // if (data.tuyaDeviceId != '' && data.tuyaDeviceId != undefined) {
  //   param += '&tuyaDeviceId=' + data.tuyaDeviceId;
  // }
  return request({
    url: '/k3Cloud/salStock/list' + param,
    method: 'get',
    data,
  });
}
//注册设备
export function details(fid) {
  return request({
    url: '/k3Cloud/salStock/details?fid=' + fid,
    method: 'get',
  });
}
//删除设备
export function productAttribute(materialCode) {
  return request({
    url: '/k3Cloud/salStock/productAttribute?materialCode=' + materialCode,
    method: 'get',
  });
}

export function getNameplate(code) {
  return request({
    url: '/productCategory/getNameplate/' + code,
    method: 'get',
  });
}
