diff --git a/packages/core/client/src/modules/blocks/data-blocks/list/listBlockSettings.ts b/packages/core/client/src/modules/blocks/data-blocks/list/listBlockSettings.ts index 9a572040c3..8c0f8d5e63 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/list/listBlockSettings.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/list/listBlockSettings.ts @@ -187,11 +187,12 @@ export const listBlockSettings = new SchemaSettings({ title: t('Records per page'), value: field.decoratorProps?.params?.pageSize || 20, options: [ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, - { label: '80', value: 80 }, { label: '100', value: 100 }, + { label: '200', value: 200 }, ], onChange: (pageSize) => { _.set(fieldSchema, 'x-decorator-props.params.pageSize', pageSize); diff --git a/packages/core/client/src/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.ts b/packages/core/client/src/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.ts index 1cf878c705..6be42ae99b 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.ts +++ b/packages/core/client/src/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.ts @@ -251,6 +251,7 @@ export const tableSelectorBlockSettings = new SchemaSettings({ title: t('Records per page'), value: field.decoratorProps?.params?.pageSize || 20, options: [ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, diff --git a/packages/core/client/src/modules/blocks/data-blocks/table/tableBlockSettings.tsx b/packages/core/client/src/modules/blocks/data-blocks/table/tableBlockSettings.tsx index f7d70ff2b1..ec735aa1ad 100644 --- a/packages/core/client/src/modules/blocks/data-blocks/table/tableBlockSettings.tsx +++ b/packages/core/client/src/modules/blocks/data-blocks/table/tableBlockSettings.tsx @@ -164,6 +164,7 @@ export const tableBlockSettings = new SchemaSettings({ title: t('Records per page'), value: field.decoratorProps?.params?.pageSize || 20, options: [ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, diff --git a/packages/core/client/src/schema-component/antd/grid-card/GridCard.tsx b/packages/core/client/src/schema-component/antd/grid-card/GridCard.tsx index 01d5dd4aee..05777e75e7 100644 --- a/packages/core/client/src/schema-component/antd/grid-card/GridCard.tsx +++ b/packages/core/client/src/schema-component/antd/grid-card/GridCard.tsx @@ -89,6 +89,7 @@ const usePaginationProps = () => { pageSize: pageSize || 10, current: page || 1, pageSizeOptions, + showSizeChanger: true, }; } else { return { diff --git a/packages/core/client/src/schema-component/antd/list/List.Designer.tsx b/packages/core/client/src/schema-component/antd/list/List.Designer.tsx index 8042c7a1af..6933bd1c89 100644 --- a/packages/core/client/src/schema-component/antd/list/List.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/list/List.Designer.tsx @@ -170,11 +170,12 @@ export const ListDesigner = () => { title={t('Records per page')} value={field.decoratorProps?.params?.pageSize || 20} options={[ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, - { label: '80', value: 80 }, { label: '100', value: 100 }, + { label: '200', value: 200 }, ]} onChange={(pageSize) => { _.set(fieldSchema, 'x-decorator-props.params.pageSize', pageSize); diff --git a/packages/core/client/src/schema-component/antd/list/List.tsx b/packages/core/client/src/schema-component/antd/list/List.tsx index 4d74afcc22..53355e9d2c 100644 --- a/packages/core/client/src/schema-component/antd/list/List.tsx +++ b/packages/core/client/src/schema-component/antd/list/List.tsx @@ -51,6 +51,8 @@ const InternalList = (props) => { [fieldSchema.properties, schemaMap], ); + const pageSizeOptions = [5, 10, 20, 50, 100, 200]; + const onPaginationChange: PaginationProps['onChange'] = useCallback( (page, pageSize) => { run({ @@ -97,6 +99,8 @@ const InternalList = (props) => { total: meta?.count || 0, pageSize: meta?.pageSize || 10, current: meta?.page || 1, + showSizeChanger: true, + pageSizeOptions, } } loading={service?.loading} diff --git a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx index 569c3001b6..95c2a3216c 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/Table.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/Table.tsx @@ -261,6 +261,8 @@ const TableIndex = (props) => { ); }; +const pageSizeOptions = [5, 10, 20, 50, 100, 200]; + const usePaginationProps = (pagination1, pagination2) => { const { t } = useTranslation(); const field: any = useField(); @@ -279,12 +281,14 @@ const usePaginationProps = (pagination1, pagination2) => { const result = useMemo(() => { if (totalCount) { return { + pageSizeOptions, showTotal, showSizeChanger: true, ...pagination, }; } else { return { + pageSizeOptions, showTotal: false, simple: true, showTitle: false, diff --git a/packages/core/client/src/schema-component/antd/table-v2/TableBlockDesigner.tsx b/packages/core/client/src/schema-component/antd/table-v2/TableBlockDesigner.tsx index 83a75537e8..9d04b52971 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/TableBlockDesigner.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/TableBlockDesigner.tsx @@ -282,6 +282,7 @@ export const TableBlockDesigner = () => { title={t('Records per page')} value={field.decoratorProps?.params?.pageSize || 20} options={[ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, diff --git a/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx b/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx index cb8562f354..951e3d92ed 100644 --- a/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx +++ b/packages/core/client/src/schema-component/antd/table-v2/TableSelectorDesigner.tsx @@ -237,6 +237,7 @@ export const TableSelectorDesigner = () => { title={t('Records per page')} value={field.decoratorProps?.params?.pageSize || 20} options={[ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, diff --git a/packages/core/client/src/schema-component/antd/table/Table.Void.Designer.tsx b/packages/core/client/src/schema-component/antd/table/Table.Void.Designer.tsx index 22adb1b741..45d32c3597 100644 --- a/packages/core/client/src/schema-component/antd/table/Table.Void.Designer.tsx +++ b/packages/core/client/src/schema-component/antd/table/Table.Void.Designer.tsx @@ -194,6 +194,7 @@ export const TableVoidDesigner = () => { title={'每页显示'} value={field.decoratorProps.request.params?.pageSize || 20} options={[ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 }, diff --git a/packages/core/client/src/schema-component/antd/table/Table.Void.tsx b/packages/core/client/src/schema-component/antd/table/Table.Void.tsx index b61d56f17e..cd4fa12c4c 100644 --- a/packages/core/client/src/schema-component/antd/table/Table.Void.tsx +++ b/packages/core/client/src/schema-component/antd/table/Table.Void.tsx @@ -26,6 +26,8 @@ type TableVoidProps = TableProps & { ) => Result & { state?: any; setState?: any }; }; +const pageSizeOptions = [5, 10, 20, 50, 100, 200]; + const usePaginationProps = (props: TableProps & { request?: any }, service): TablePaginationConfig | false => { if (props.pagination === false) { return false; @@ -41,6 +43,7 @@ const usePaginationProps = (props: TableProps & { request?: any }, service) pagination.pageSize = pageSize; } return { + pageSizeOptions, showSizeChanger: true, ...pagination, onChange(page, pageSize) { diff --git a/packages/plugins/@nocobase/plugin-audit-logs/src/client/deplicated/AuditLogsDesigner.tsx b/packages/plugins/@nocobase/plugin-audit-logs/src/client/deplicated/AuditLogsDesigner.tsx index 5d1e4a0162..6f87350ae8 100644 --- a/packages/plugins/@nocobase/plugin-audit-logs/src/client/deplicated/AuditLogsDesigner.tsx +++ b/packages/plugins/@nocobase/plugin-audit-logs/src/client/deplicated/AuditLogsDesigner.tsx @@ -54,6 +54,7 @@ export const AuditLogsDesigner = () => { title={t('Records per page')} value={field.decoratorProps?.params?.pageSize || 20} options={[ + { label: '5', value: 5 }, { label: '10', value: 10 }, { label: '20', value: 20 }, { label: '50', value: 50 },