componentSetting.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. // Default Size
  23. defaultSize: 'middle',
  24. // Custom general sort function
  25. defaultSortFn: (sortInfo: SorterResult) => {
  26. const { field, order } = sortInfo;
  27. if (field && order) {
  28. return {
  29. // The sort field passed to the backend you
  30. field,
  31. // Sorting method passed to the background asc/desc
  32. order,
  33. };
  34. } else {
  35. return {};
  36. }
  37. },
  38. // Custom general filter function
  39. defaultFilterFn: (data: Partial<Recordable<string[]>>) => {
  40. return data;
  41. },
  42. },
  43. // scrollbar setting
  44. scrollbar: {
  45. // Whether to use native scroll bar
  46. // After opening, the menu, modal, drawer will change the pop-up scroll bar to native
  47. native: false,
  48. },
  49. };