JavaScript 批量转账统计数据处理优化
let num = 0; let amount = 0; res.data.forEach(item => { num += item.num; amount += item.amount; const status = this.statusList.find(status => status.id === item.status); const title = status ? status.title : ''; switch (item.status) { case this.batchBatchRule.checkSuccess: this.transferStatisticsData[4] = { ...item, title }; break; case this.batchBatchRule.transFail: this.transferStatisticsData[3] = { ...item, title }; break; case this.batchBatchRule.transSuccess: this.transferStatisticsData[2] = { ...item, title }; break; case this.batchBatchRule.checkFail: this.transferStatisticsData[1] = { ...item, title }; break; default: break; } });
原文地址: https://www.cveoy.top/t/topic/oYJS 著作权归作者所有。请勿转载和采集!