From 4b8da0ebbe4dbd642e4114ee0e03553d31435a66 Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Mon, 1 Jun 2026 16:16:39 +0800 Subject: [PATCH] 1.对于 slaveChild 表格,不使用 props.totalData(全部汇总),而是由 handleSumChildColumn 计算分组汇总 --- src/components/Common/CommonTable/index.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/Common/CommonTable/index.js b/src/components/Common/CommonTable/index.js index e6077d0..b8b6bab 100644 --- a/src/components/Common/CommonTable/index.js +++ b/src/components/Common/CommonTable/index.js @@ -6308,7 +6308,9 @@ class CommonTableRc extends React.Component { } /* 合计行数据 *//* 数据(数据格式:数组对象) */ - if (props.totalData !== undefined && JSON.stringify(totalData) !== JSON.stringify(props.totalData) && !this.props.enabled) { // 要用this. this.props.enabled + // 对于 slaveChild 表格,不使用 props.totalData(全部汇总),而是由 handleSumChildColumn 计算分组汇总 + const isSlaveChild = this.props.name?.includes('slaveChild'); + if (props.totalData !== undefined && JSON.stringify(totalData) !== JSON.stringify(props.totalData) && !this.props.enabled && !isSlaveChild) { // 要用this. this.props.enabled if (props.totalData.length > 0) { stateValue.totalData = [...props.totalData]; if (commonUtils.isEmptyArr(stateValue.totalData)) { @@ -6352,7 +6354,9 @@ class CommonTableRc extends React.Component { if (searchText !== props.searchText) { stateValue.searchText = props.searchText; } - if (props.enabled) { + if (this.props.name?.includes('slaveChild')) { + this.handleSumChildColumn(props.config, props.data); + } else if (props.enabled) { const { config, name, rootType } = this.props; if (commonUtils.isNotEmptyObject(config)) { const productionRoute = (commonUtils.isNotEmptyObject(props.app.currentPane) && commonUtils.isNotEmptyObject(props.app.currentPane.route) && props.app.currentPane.route.includes('productionSchedule')); @@ -6364,8 +6368,6 @@ class CommonTableRc extends React.Component { addState.totalData = props.totalData; this.setState({ ...addState }) } - } else if (name === 'slaveChild') { - this.handleSumChildColumn(props.config, props.data); } else { this.handleSelectColumn(props.config, props.data); this.handleSumAllColumn(props.config, props.data); -- libgit2 0.22.2