componentSetting.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. vxeTable: {
  44. table: {
  45. border: true,
  46. stripe: true,
  47. columnConfig: {
  48. resizable: true,
  49. isCurrent: true,
  50. isHover: true,
  51. },
  52. rowConfig: {
  53. isCurrent: true,
  54. isHover: true,
  55. },
  56. emptyRender: {
  57. name: 'AEmpty',
  58. },
  59. printConfig: {},
  60. exportConfig: {},
  61. customConfig: {
  62. storage: true,
  63. },
  64. },
  65. grid: {
  66. toolbarConfig: {
  67. enabled: true,
  68. export: true,
  69. zoom: true,
  70. print: true,
  71. refresh: true,
  72. custom: true,
  73. },
  74. pagerConfig: {
  75. pageSizes: [20, 50, 100, 500],
  76. pageSize: 20,
  77. autoHidden: true,
  78. },
  79. proxyConfig: {
  80. form: true,
  81. props: {
  82. result: 'items',
  83. total: 'total',
  84. },
  85. },
  86. zoomConfig: {},
  87. },
  88. },
  89. // scrollbar setting
  90. scrollbar: {
  91. // Whether to use native scroll bar
  92. // After opening, the menu, modal, drawer will change the pop-up scroll bar to native
  93. native: false,
  94. },
  95. };