let num = 0; let amount = 0; res.data.forEach(item => { num += item.num; amount += item.amount;

const status = item.status; const title = this.statusList.find(statusItem => statusItem.id === status)?.title || '';

switch (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; } });

if (res.data.length > 1) { this.transferStatisticsData[0] = { num, amount, status: [0, 1, 2, 3], title: '' }; }


原文地址: https://www.cveoy.top/t/topic/oYKb 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录