From 878378e05f7da791ea7d5697cd2699ef053553be Mon Sep 17 00:00:00 2001 From: DsAco <2363140194@qq.com> Date: Tue, 17 Oct 2017 18:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=97=E6=BC=8F=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/actions/statsAction.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/scripts/actions/statsAction.js b/src/scripts/actions/statsAction.js index 07e1a65..d8a41de 100644 --- a/src/scripts/actions/statsAction.js +++ b/src/scripts/actions/statsAction.js @@ -5,17 +5,18 @@ export const HOME_RECEIVE_ACTIVITIES_C = 'HOME_RECEIVE_ACTIVITIES_C' export const HOME_RECEIVE_ACTIVITIES_O = 'HOME_RECEIVE_ACTIVITIES_O' function receiveStats(res) { - res.last.map((item,i) => { - item.x = item.d - item.y = item.n - }) - res.aggregate.map((item,i) => { - item.x = item.d - item.y = item.n + const { last,aggregate } = res + const data = last.map((item,i) => { + return{ + name:item.d + '日', + last:item.n, + aggregate:aggregate[i]['n'] + } }) return { type: HOME_RECEIVE_STATS, - res + res, + data } }