Commit 0b992051 by 姜雷

修改活跃用户计算方式

parent a77d24bd
......@@ -220,17 +220,25 @@ const mutations = {
state.report.registePerDay = dayList;
state.report.registePerMonth = data.list;
let activeList = new Array(12).fill({ count: 0, mark: 'total' });
activeList = activeList.map((v, idx) => ({ ...v, month: idx + 1 }));
let activeList = new Array(12)
.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 => {
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(
val => val.mark === 'monthAppActive'
);
data.listCount
.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);
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