api.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import { request } from '/@/utils/service';
  2. import { UserPageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';
  3. export const apiPrefix = '/api/system/dashboard/';
  4. export function GetList() {
  5. return request({
  6. url: apiPrefix,
  7. method: 'get',
  8. });
  9. }
  10. export function GetOverviewList() {
  11. return request({
  12. url: apiPrefix+'overview_stats/',
  13. method: 'get',
  14. });
  15. }
  16. export function GetDeviceRankList(params:object) {
  17. return request({
  18. url: apiPrefix+'device_rankings/',
  19. method: 'get',
  20. params:params
  21. });
  22. }
  23. export function GetBorrowRanking(params:object) {
  24. return request({
  25. url: apiPrefix+'device_rankings/',
  26. method: 'get',
  27. params:params
  28. });
  29. }
  30. export function GetUtilizationList() {
  31. return request({
  32. url: apiPrefix+'utilization_trend/',
  33. method: 'get',
  34. });
  35. }
  36. export function GetBorrowTrends() {
  37. return request({
  38. url: apiPrefix+'borrow_trends/?period=week',
  39. method: 'get',
  40. });
  41. }
  42. export function GetActiveUsers() {
  43. return request({
  44. url: apiPrefix+'active_users/',
  45. method: 'get',
  46. });
  47. }