|
@@ -245,9 +245,7 @@ export default {
|
|
|
// 整理出要计算的属性(只取出数字或者可以为数字的值)
|
|
|
const resetList = data.map((i) => {
|
|
|
const d = _.get(i, prop);
|
|
|
- const res = reg.test(d);
|
|
|
- if (res) return d * 1;
|
|
|
- else return 0;
|
|
|
+ return d*1
|
|
|
});
|
|
|
if (this.sumres === 'total') {
|
|
|
res = this.totalComputed(resetList);
|
|
@@ -265,7 +263,8 @@ export default {
|
|
|
},
|
|
|
// 合计计算
|
|
|
totalComputed(data) {
|
|
|
- const total = data.reduce((p, n) => p + n, 0);
|
|
|
+ console.log(data);
|
|
|
+ const total = data.reduce((p, n) => p + parseFloat(n), 0);
|
|
|
return total;
|
|
|
},
|
|
|
// 平均值计算
|