PR 合计工具方法,转换为Nuber类型再计算
parent
258b5f9d6b
commit
1e2380610b
|
@ -143,7 +143,12 @@ export function mapTableTotalSummary(tableData: Recordable[], fieldKeys: string[
|
||||||
let totals: any = { _row: '合计', _index: '合计' };
|
let totals: any = { _row: '合计', _index: '合计' };
|
||||||
fieldKeys.forEach((key) => {
|
fieldKeys.forEach((key) => {
|
||||||
totals[key] = tableData.reduce((prev, next) => {
|
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;
|
return prev;
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue