fix: do not init meta data when switch tab

This commit is contained in:
jialin
2025-03-05 20:30:53 +08:00
parent caadc02fb4
commit 4de1a38c00
11 changed files with 133 additions and 108 deletions
@@ -1,4 +1,5 @@
import { DownOutlined, RightOutlined } from '@ant-design/icons';
import IconFont from '@/components/icon-font';
import { RightOutlined } from '@ant-design/icons';
import { Button, Checkbox } from 'antd';
import _ from 'lodash';
import React from 'react';
@@ -39,7 +40,17 @@ const HeaderPrefix: React.FC<HeaderPrefixProps> = (props) => {
<span style={{ marginRight: 5 }}>
{_.isBoolean(expandable) ? (
<Button type="text" size="small" onClick={handleToggleExpand}>
{expandAll ? <DownOutlined /> : <RightOutlined />}
{expandAll ? (
<IconFont
type="icon-collapse_all"
className="font-size-16"
></IconFont>
) : (
<IconFont
type="icon-uncollapse_all"
className="font-size-16"
></IconFont>
)}
</Button>
) : (
expandable
+3
View File
@@ -53,6 +53,9 @@ const SealTable: React.FC<SealTableProps & { pagination: PaginationProps }> = (
}, [columns, children]);
const expandAll = useMemo(() => {
if (expandedRowKeys?.length === 0) {
return false;
}
const allKeys = new Set(expandedRowKeys);
const currentDataKeys = props.dataSource.map((record) => record[rowKey]);
return currentDataKeys.every((key) => allKeys.has(key));