diff --git a/src/utils/common.js b/src/utils/common.js index 5096b1a..4b85ecc 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -71,6 +71,7 @@ export const exceptStr = (str) => { }; export const paginationFun = (tableListPageObj, sizeChange, onChange, i18n = {}) => { + const pageSizeOptions= tableListPageObj?.pageSizeOptions || ["10", "20", "50", "100"]; return { current: tableListPageObj.pageNum || tableListPageObj.current, pageSize: tableListPageObj.size || tableListPageObj.pageSize, @@ -78,7 +79,7 @@ export const paginationFun = (tableListPageObj, sizeChange, onChange, i18n = {}) showTotal: total => `${i18n["共"] ? i18n["共"] : "共"} ${total} ${i18n["条"] ? i18n["条"] : "条"}`, showQuickJumper: true, showSizeChanger: true, - pageSizeOptions: ["10", "20", "50", "100"], + pageSizeOptions, onShowSizeChange: (page, size) => { const { total } = tableListPageObj; sizeChange({ @@ -122,4 +123,4 @@ export const toDecimal_n = (num, decimalPlaces) => { const multiplier = Math.pow(10, decimalPlaces); const roundedNum = Math.round(num * multiplier) / multiplier; return roundedNum.toFixed(decimalPlaces); -}; +}; \ No newline at end of file