Commit 0b992051 by 姜雷

修改活跃用户计算方式

parent a77d24bd
...@@ -220,17 +220,25 @@ const mutations = { ...@@ -220,17 +220,25 @@ const mutations = {
state.report.registePerDay = dayList; state.report.registePerDay = dayList;
state.report.registePerMonth = data.list; state.report.registePerMonth = data.list;
let activeList = new Array(12).fill({ count: 0, mark: 'total' }); let activeList = new Array(12)
activeList = activeList.map((v, idx) => ({ ...v, month: idx + 1 })); .fill({ count: 0, mark: 'total' })
.map((v, idx) => ({ ...v, month: idx + 1 }));
let activeAppList = new Array(12)
.fill({
count: 0,
mark: 'monthAppActive',
})
.map((v, idx) => ({ ...v, month: idx + 1 }));
data.listCount.map(val => { data.listCount.map(val => {
let idx = val.month - 1; let idx = val.month - 1;
if (val.mark === 'monthAppActive' || val.mark === 'monthHardActive') {
activeList[idx].count += val.count; activeList[idx].count += val.count;
}
}); });
let activeAppList = data.listCount.filter( data.listCount
val => val.mark === 'monthAppActive' .filter(val => val.mark === 'monthAppActive' || val.mark === 'allActive')
); .map(val => {
let idx = val.month - 1;
activeAppList[idx].count += val.count;
});
activeList.push.apply(activeList, activeAppList); activeList.push.apply(activeList, activeAppList);
state.report.activeUser = activeList; state.report.activeUser = activeList;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment