search.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * Copyright (c) 2013-Now https://jeesite.com All rights reserved.
  3. * No deletion without permission, or be held responsible to law.
  4. * @author ThinkGem
  5. */
  6. import { defHttp } from '@jeesite/core/utils/http/axios';
  7. import { useGlobSetting } from '@jeesite/core/hooks/setting';
  8. const { adminPath } = useGlobSetting();
  9. export interface GlobalSearchItem {
  10. id: string;
  11. tableName?: string;
  12. sheetId: string;
  13. fileId: string;
  14. dateTime: string;
  15. content: string;
  16. fileName?: string;
  17. sheetName?: string;
  18. }
  19. export interface GlobalSearchTableQuery {
  20. id?: ApiId | number;
  21. tableName?: ApiText;
  22. page?: ApiCount;
  23. limit?: ApiCount;
  24. }
  25. export interface GlobalSearchTablePayload {
  26. pages?: {
  27. records?: ApiList<Recordable>;
  28. total?: ApiCount;
  29. count?: ApiCount;
  30. };
  31. head?: any[];
  32. list?: ApiList<Recordable>;
  33. total?: ApiCount;
  34. count?: ApiCount;
  35. }
  36. export const globalSearchList = (params?: { keyword?: ApiText }) =>
  37. defHttp.get<GlobalSearchItem[]>({ url: adminPath + '/search/list', params });
  38. export const treeTablePage = (data: GlobalSearchTableQuery) =>
  39. defHttp.postJson<GlobalSearchTablePayload>({ url: adminPath + '/gt/treeTablePage', data });