优化:完善分类规则与Excel配置维护并加速查询翻页

This commit is contained in:
2026-10-31 17:50:14 +08:00
parent 9dbe85c65c
commit aa7c320dc6
56 changed files with 1709 additions and 440 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ export function QualityTable<T extends object>({
}: QualityTableProps<T>) {
const compact = useContext(CompactManagementTables);
const pageConfig = typeof pagination === 'object' && pagination !== null ? pagination : undefined;
const [innerPage, setInnerPage] = useState(() => ({ current: pageConfig?.defaultCurrent ?? 1, pageSize: pageConfig?.defaultPageSize ?? 10 }));
const [innerPage, setInnerPage] = useState(() => ({ current: pageConfig?.defaultCurrent ?? 1, pageSize: pageConfig?.defaultPageSize ?? 15 }));
const pageSize = pageConfig?.pageSize ?? innerPage.pageSize;
const total = pageConfig?.total ?? dataSource?.length ?? 0;
const page = Math.min(pageConfig?.current ?? innerPage.current, Math.max(1, Math.ceil(total / pageSize)));
@@ -66,7 +66,7 @@ export function QualityTable<T extends object>({
tableLayout={props.tableLayout ?? (compact ? 'fixed' : undefined)}
columns={[indexColumn, ...(compact ? compactColumns(columns ?? []) : columns ?? [])]}
dataSource={dataSource}
pagination={pagination}
pagination={pagination === false ? false : { defaultPageSize: 15, pageSizeOptions: ['15', '30', '50', '100'], ...pageConfig }}
onChange={handleChange}
size={size}
bordered