Skip to content

Commit

Permalink
fix: 修复多层表头下总结栏显示异常的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CNFeffery committed Dec 26, 2024
1 parent acc4cad commit abb1b47
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/dataDisplay/AntdTree.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const AntdTree = (props) => {
// 定义递归PropTypes
const PropTreeNodeShape = {
/**
* 当前节点标题s
* 当前节点标题
*/
title: PropTypes.string.isRequired,
/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/dataEntry/AntdTreeSelect.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const PropTreeNodeShape = {
*/
selectable: PropTypes.bool,
/**
* 当前节点是否为末端节点
* 当前节点是否为叶节点(末端节点)
*/
isLeaf: PropTypes.bool
};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/fragments/AntdTable.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@ class AntdTable extends Component {
summary={summaryRowContents ? () => (
<Table.Summary fixed={summaryRowFixed}>
{
splitSummaryRowContents(summaryRowContents, tempColumns.length, summaryRowBlankColumns).map(
splitSummaryRowContents(summaryRowContents, columns.length, summaryRowBlankColumns).map(
(group, idx) => (
<Table.Summary.Row key={idx}>
{group.map((item, i) =>
Expand Down
85 changes: 85 additions & 0 deletions tests/dataDisplay/AntdTable/fix_summary_multi_level_header.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
if True:
import sys

sys.path.append('../../../')
import dash
from dash import html
import feffery_antd_components as fac

app = dash.Dash(__name__)

app.layout = html.Div(
[
fac.AntdTable(
columns=[
{
'title': '字段1',
'dataIndex': '字段1',
},
{
'title': '字段2',
'dataIndex': '字段2',
},
{
'title': '字段3',
'dataIndex': '字段3',
'group': '组1',
},
{
'title': '字段4',
'dataIndex': '字段4',
'group': '组1',
},
{
'title': '字段5',
'dataIndex': '字段5',
},
{
'title': '字段6',
'dataIndex': '字段6',
},
],
data=[
{
f'字段{i}': f'示例内容{i}'
for i in range(1, 7)
}
]
* 5,
bordered=True,
summaryRowContents=[
{'content': '第1列总结', 'align': 'center'},
{
'content': '第2到3列总结',
'colSpan': 2,
'align': 'center',
},
{'content': '第4列总结', 'align': 'center'},
{
'content': '第5到6列总结',
'colSpan': 2,
'align': 'center',
},
{'content': 'xxx', 'align': 'center'},
{
'content': 'xxx',
'colSpan': 2,
'align': 'center',
},
{'content': 'xxx', 'align': 'center'},
{
'content': 'xxx',
'colSpan': 2,
'align': 'center',
},
],
rowSelectionType='radio',
summaryRowBlankColumns=1,
),
],
style={'padding': 100},
)


if __name__ == '__main__':
app.run(debug=True)

0 comments on commit abb1b47

Please sign in to comment.