:summary-method="getSummaries"
show-summary
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "总计";
} else if (index === 5 || index === 6||index===4||index===3||index===2||index===1) {
const values = data.map((item) => Number(item[column.property]));
if (!values.every((value) => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
} else {
sums[index] = "N/A";
}
} else {
sums[index] = "--";
}
});
return sums;
},