componentSetting.ts 1.6 KB

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