Total amount of gold deposits in the table
getSummaries (param) {
const {
columns,
data
} = param;
const sums = [];
let values = []
columns.forEach ((column, index) = > {
if (index === 0) {
sums[index] = "";
return;
}
if (column.property === "Product.sum") {
values = data.map(item => Number(item.Product.Quantity * item.Product.Price))
} else if (column.property == "Product.Price") {
values = data.map(item => Number(item.Product.Price))
} else {
values = data.map(item => Number(item.Product.Quantity))
}
if (column.property = = "Product.sum" | | column.property = =" Product.Price") {
sums [index] = values.reduce ((prev, curr) = > {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums [index] + = "Yuan";
= + -
compute () {
this.num3 = + Number(this.num1) - Number(this.num2)
},
the total amount of the table below has been calculated, but I don"t know what field name to use and how to get it in the following calculation