diff --git a/src/lib/components/dataDisplay/AntdTree.react.js b/src/lib/components/dataDisplay/AntdTree.react.js index 37b1594a..3bc2b931 100644 --- a/src/lib/components/dataDisplay/AntdTree.react.js +++ b/src/lib/components/dataDisplay/AntdTree.react.js @@ -17,7 +17,7 @@ const AntdTree = (props) => { // 定义递归PropTypes const PropTreeNodeShape = { /** - * 当前节点标题s + * 当前节点标题 */ title: PropTypes.string.isRequired, /** diff --git a/src/lib/components/dataEntry/AntdTreeSelect.react.js b/src/lib/components/dataEntry/AntdTreeSelect.react.js index bed5beec..10d63ad7 100644 --- a/src/lib/components/dataEntry/AntdTreeSelect.react.js +++ b/src/lib/components/dataEntry/AntdTreeSelect.react.js @@ -48,7 +48,7 @@ const PropTreeNodeShape = { */ selectable: PropTypes.bool, /** - * 当前节点是否为末端节点 + * 当前节点是否为叶节点(末端节点) */ isLeaf: PropTypes.bool }; diff --git a/src/lib/fragments/AntdTable.react.js b/src/lib/fragments/AntdTable.react.js index b5979351..5c10af37 100644 --- a/src/lib/fragments/AntdTable.react.js +++ b/src/lib/fragments/AntdTable.react.js @@ -2124,7 +2124,7 @@ class AntdTable extends Component { summary={summaryRowContents ? () => ( { - splitSummaryRowContents(summaryRowContents, tempColumns.length, summaryRowBlankColumns).map( + splitSummaryRowContents(summaryRowContents, columns.length, summaryRowBlankColumns).map( (group, idx) => ( {group.map((item, i) => diff --git a/tests/dataDisplay/AntdTable/fix_summary_multi_level_header.py b/tests/dataDisplay/AntdTable/fix_summary_multi_level_header.py new file mode 100644 index 00000000..14a8c7e6 --- /dev/null +++ b/tests/dataDisplay/AntdTable/fix_summary_multi_level_header.py @@ -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)