dashboard.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import axios from 'axios';
  2. import type { TableData } from '@arco-design/web-vue/es/table/interface';
  3. import instance from './interceptor';
  4. export interface RootObject {
  5. pageIndex: number;
  6. pageSize: number;
  7. name: string;
  8. address: string;
  9. status: number;
  10. startTime: string;
  11. endTime: string;
  12. entityType: number;
  13. }
  14. export interface Data {
  15. id: number;
  16. entityType: number;
  17. name: string;
  18. address: string;
  19. status: number;
  20. time: string;
  21. data: string;
  22. }
  23. export interface ExportUrl {
  24. success: boolean;
  25. message: string;
  26. code: string;
  27. data: string;
  28. }
  29. export interface DashboardList {
  30. success: boolean;
  31. message: string;
  32. code: string;
  33. data: Data[];
  34. totalCount: number;
  35. totalPage: number;
  36. }
  37. export interface DashboardParams {
  38. pageIndex: number;
  39. pageSize: number;
  40. name: string | null;
  41. address: string | null;
  42. status: number | null;
  43. time: [string, string];
  44. startTime: string | null;
  45. endTime: string | null;
  46. entityType: number | null;
  47. }
  48. export async function queryDashboardList(
  49. params: object
  50. ): Promise<DashboardList> {
  51. const res = await instance.post('/api/Author/GetDeviceList', params);
  52. return res.data;
  53. }
  54. export async function exportDashboardList(params: object): Promise<ExportUrl> {
  55. const res = await instance.post('/api/Author/Export', params);
  56. return res.data;
  57. }