device.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import type { TableData } from '@arco-design/web-vue/es/table/interface';
  2. import instance from './interceptor';
  3. export interface RootObject {
  4. pageIndex: number;
  5. pageSize: number;
  6. name: string;
  7. address: string;
  8. status: number;
  9. startTime: string;
  10. endTime: string;
  11. entityType: number;
  12. }
  13. export interface DataList {
  14. id?: number;
  15. entityType: number | null;
  16. deviceType: number | null;
  17. name: string;
  18. address: string;
  19. status?: number;
  20. time?: string;
  21. data?: string;
  22. routeInfoId?: number | null;
  23. }
  24. export interface ExportUrl {
  25. success: boolean;
  26. message: string;
  27. code: string;
  28. data: string;
  29. }
  30. export interface DeviceList {
  31. success: boolean;
  32. message: string;
  33. code: string;
  34. data: DataList[];
  35. totalCount: number;
  36. totalPage: number;
  37. }
  38. export interface DeviceParams {
  39. pageIndex: number;
  40. pageSize: number;
  41. name: string | null;
  42. address: string | null;
  43. status: number | null;
  44. time: [string, string];
  45. startTime: string | null;
  46. endTime: string | null;
  47. entityType: number | null;
  48. station?: string | null;
  49. }
  50. export interface LoginRes {
  51. success: boolean;
  52. data: DataList;
  53. message: string;
  54. code: string;
  55. }
  56. export async function queryDeviceList(params: object): Promise<DeviceList> {
  57. const res = await instance.post('/api/Author/GetDeviceList', params);
  58. return res.data;
  59. }
  60. export async function exportDeviceList(params: object): Promise<ExportUrl> {
  61. const res = await instance.post('/api/Author/Export', params);
  62. return res.data;
  63. }
  64. export async function getDeviceDetails(params: object): Promise<LoginRes> {
  65. const res = await instance.post('/api/Author/GetDevice', params);
  66. return res.data;
  67. }
  68. export async function saveDeviceDetails(params: object): Promise<LoginRes> {
  69. const res = await instance.post('/api/Author/SaveDevice', params);
  70. return res.data;
  71. }
  72. export async function deleteDeviceDetails(params: object): Promise<LoginRes> {
  73. const res = await instance.post('/api/Author/DeleteDevice', params);
  74. return res.data;
  75. }