_device.ts 934 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import Rs from "@@/services/RequestService"
  2. class deviceApi {
  3. // 查询Device列表
  4. listDevice = (query: any) => {
  5. return Rs.get({
  6. url: "/iot-device",
  7. params: query
  8. })
  9. }
  10. // 查询Device详细
  11. getDevice = (id: any) => {
  12. return Rs.get({
  13. url: "/iot-device/" + id
  14. })
  15. }
  16. // 新增Device
  17. addDevice = (data: any) => {
  18. return Rs.post({
  19. url: "/iot-device",
  20. data: data
  21. })
  22. }
  23. // 修改Device
  24. updateDevice = (data: any) => {
  25. return Rs.put({
  26. url: "/iot-device/" + data.id,
  27. data: data
  28. })
  29. }
  30. // 删除Device
  31. delDevice = (ids: any) => {
  32. return Rs.del({
  33. url: "/iot-device",
  34. data: { ids }
  35. })
  36. }
  37. refresh = () => {
  38. return Rs.post({
  39. url: "/iot-device/refresh"
  40. })
  41. }
  42. getDeviceProtocols = () => {
  43. return Rs.get({
  44. url: "/iot-device/device-protocols"
  45. })
  46. }
  47. getReportProtocols = () => {
  48. return Rs.get({
  49. url: "/iot-device/report-protocols"
  50. })
  51. }
  52. }
  53. export default deviceApi