device.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import request from '@/utils/request'
  2. // 查询列表【请填写功能名称】
  3. export function listDevice(query) {
  4. return request({
  5. url: '/system/device/list',
  6. method: 'get',
  7. params: query
  8. })
  9. }
  10. export function listIdName(query) {
  11. return request({
  12. url: '/system/device/listidname',
  13. method: 'get',
  14. params: query
  15. })
  16. }
  17. // 查询详细【请填写功能名称】
  18. export function getDevice(id) {
  19. return request({
  20. url: '/system/device/' + id,
  21. method: 'get'
  22. })
  23. }
  24. // 查询主机
  25. export function getHostByOrgId(orgId) {
  26. return request({
  27. url: '/system/device/getHostByOrgId/' + orgId.id,
  28. method: 'get'
  29. })
  30. }
  31. export function downInCharge() {
  32. return request({
  33. url: '/system/device/downInChargeOfTemplate',
  34. method: 'get'
  35. })
  36. }
  37. // 新增【请填写功能名称】
  38. export function addDevice(data) {
  39. return request({
  40. url: '/system/device',
  41. method: 'post',
  42. data: data
  43. })
  44. }
  45. // 修改【请填写功能名称】
  46. export function updateDevice(data) {
  47. return request({
  48. url: '/system/device',
  49. method: 'put',
  50. data: data
  51. })
  52. }
  53. // 删除【请填写功能名称】
  54. export function delDevice(id) {
  55. return request({
  56. url: '/system/device/' + id,
  57. method: 'delete'
  58. })
  59. }
  60. // 查询资产字典
  61. export function getDictTree() {
  62. return request({
  63. url: '/system/dictionary/tree',
  64. method: 'get'
  65. })
  66. }
  67. // 查询资产字典
  68. export function getDictList() {
  69. return request({
  70. url: '/system/dictionary/list',
  71. method: 'get'
  72. })
  73. }
  74. // 查询资产字典
  75. export function getDictTreeByParentId(parentId) {
  76. return request({
  77. url: '/system/dictionary/getDictTreeByParentId',
  78. method: 'get',
  79. params: {parentId: parentId}
  80. })
  81. }
  82. // 检查是否存在已经有主机同步子系统上来
  83. export function checkExitSyncSubSystem(orgId, deviceType, deviceId) {
  84. return request({
  85. url: '/system/device/checkExitSyncSubSystem',
  86. method: 'get',
  87. params: {orgId: orgId, deviceType: deviceType, deviceId: deviceId}
  88. })
  89. }