componentSetting.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Used to configure the general configuration of some components without modifying the components
  2. import type { SorterResult } from '../components/Table';
  3. export default {
  4. // basic-table setting
  5. table: {
  6. // Form interface request general configuration
  7. // support xxx.xxx.xxx
  8. fetchSetting: {
  9. // The field name of the current page passed to the background
  10. pageField: 'page',
  11. // The number field name of each page displayed in the background
  12. sizeField: 'pageSize',
  13. // Field name of the form data returned by the interface
  14. listField: 'items',
  15. // Total number of tables returned by the interface field name
  16. totalField: 'total',
  17. },
  18. // Number of pages that can be selected
  19. pageSizeOptions: ['10', '50', '80', '100'],
  20. // Default display quantity on one page
  21. defaultPageSize: 10,
  22. // Custom general sort function
  23. defaultSortFn: (sortInfo: SorterResult) => {
  24. const { field, order } = sortInfo;
  25. return {
  26. // The sort field passed to the backend you
  27. field,
  28. // Sorting method passed to the background asc/desc
  29. order,
  30. };
  31. },
  32. // Custom general filter function
  33. defaultFilterFn: (data: Partial<Recordable<string[]>>) => {
  34. return data;
  35. },
  36. },
  37. // scrollbar setting
  38. scrollbar: {
  39. // Whether to use native scroll bar
  40. // After opening, the menu, modal, drawer will change the pop-up scroll bar to native
  41. native: false,
  42. },
  43. };