PR 合计工具方法,转换为Nuber类型再计算
This commit is contained in:
@@ -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);
|
||||||
});
|
});
|
||||||
@@ -516,4 +521,4 @@ export function tenantSaasMessage(title){
|
|||||||
cancelButtonProps: { style: { display: 'none' } },
|
cancelButtonProps: { style: { display: 'none' } },
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user