diff --git a/src/utils/common/compUtils.ts b/src/utils/common/compUtils.ts index a3b2c0a..29bd915 100644 --- a/src/utils/common/compUtils.ts +++ b/src/utils/common/compUtils.ts @@ -143,7 +143,12 @@ export function mapTableTotalSummary(tableData: Recordable[], fieldKeys: string[ let totals: any = { _row: '合计', _index: '合计' }; fieldKeys.forEach((key) => { totals[key] = tableData.reduce((prev, next) => { - prev += next[key]; + // update-begin--author:liaozhiyang---date:20240118---for:【QQYUN-7891】PR 合计工具方法,转换为Nuber类型再计算 + const value = Number(next[key]); + if (!Number.isNaN(value)) { + prev += value; + } + // update-end--author:liaozhiyang---date:20240118---for:【QQYUN-7891】PR 合计工具方法,转换为Nuber类型再计算 return prev; }, 0); }); @@ -516,4 +521,4 @@ export function tenantSaasMessage(title){ cancelButtonProps: { style: { display: 'none' } }, }) } -} \ No newline at end of file +}