api.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import request, { tenantRequest } from '@/utils/request'
  2. import { addTenant } from '@/api/base'
  3. export function getTimelines (deviceIdList, options) {
  4. return request({
  5. url: '/content/deviceCalender',
  6. method: 'POST',
  7. ...options,
  8. data: { deviceIdList },
  9. custom: true
  10. }).then(({ data }) => data.map(i => { return { ...i, eventDetail: JSON.parse(i.eventDetail) } }) || [])
  11. }
  12. export function getDeviceExceptionRanking () {
  13. return tenantRequest({
  14. url: '/deviceException/ranking',
  15. method: 'GET',
  16. params: addTenant({}),
  17. custom: true
  18. })
  19. }
  20. export function getDeviceExceptionLevelStatistic () {
  21. return tenantRequest({
  22. url: '/deviceException/levelStatistic',
  23. method: 'GET',
  24. params: addTenant({}),
  25. custom: true
  26. })
  27. }
  28. export function getDeviceExceptionTypeStatistics (statisticDate) {
  29. return tenantRequest({
  30. url: '/deviceException/typeStatistics',
  31. method: 'GET',
  32. params: addTenant({ statisticDate }),
  33. custom: true
  34. })
  35. }
  36. export function deviceSort (data) {
  37. return request({
  38. url: '/device/sort',
  39. method: 'POST',
  40. data
  41. })
  42. }