componentSetting.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: 'current',
  11. // The number field name of each page displayed in the background
  12. sizeField: 'size',
  13. // Field name of the form data returned by the interface
  14. listField: 'records',
  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', '20', '50', '100'],
  20. // Default display quantity on one page
  21. defaultPageSize: 20,
  22. // Default Size
  23. defaultSize: 'small',
  24. // Custom general sort function
  25. defaultSortFn: (sortInfo: SorterResult) => {
  26. const { order, columnKey } = sortInfo;
  27. if (order && columnKey) {
  28. return {
  29. orderBy: columnKey + ' ' + order.replace('end', ''),
  30. };
  31. }
  32. },
  33. // Custom general filter function
  34. defaultFilterFn: (data: Partial<Recordable<string[]>>) => {
  35. return data;
  36. },
  37. },
  38. // scrollbar setting
  39. scrollbar: {
  40. // Whether to use native scroll bar
  41. // After opening, the menu, modal, drawer will change the pop-up scroll bar to native
  42. native: false,
  43. },
  44. };