处理 js reduce 初始值问题

This commit is contained in:
sunjie
2025-08-01 14:14:54 +08:00
parent 5ef1eace9d
commit 5763ea58bd
@@ -127,7 +127,7 @@ patch(ListRenderer.prototype, {
}
if (["float", "int", "monetary"].includes(fieldInfo.type)) {
const fieldValues = values.map((v) => v[fieldInfo.name] || 0);
const aggregateValue = fieldValues.reduce((acc, val) => acc + val);
const aggregateValue = fieldValues.reduce((acc, val) => acc + val, 0);
if (!aggregateValue) {
console.log(column)
return false;