Commit 3f07975a by 姜雷

修改活跃展示方式

parent 16fb9102
......@@ -15,7 +15,7 @@ export default {
serviceList: [
{ value: 'monthAppActive', name: 'APP活跃用户' },
{ value: 'monthHardActive', name: '硬件活跃用户' },
{ value: 'allActive', name: '两者兼具' },
{ value: 'allActive', name: '全部活跃' },
{ value: 'total', name: '全部活跃' },
],
};
......
......@@ -28,16 +28,10 @@ export default {
});
this.chart
.source(this.data, {
month: {
min: 1,
max: 12,
tickCount: 12,
},
count: {
alias: '人数',
},
})
.axis('count', false)
.axis('month', {
label: {
textStyle: {
......
......@@ -221,7 +221,7 @@ const mutations = {
let registerList = new Array(12)
.fill({ count: 0, mark: null })
.map((v, idx) => ({ ...v, month: idx + 1 }));
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
data.list.map(val => {
let idx = val.month - 1;
registerList[idx].count += val.count;
......@@ -229,25 +229,28 @@ const mutations = {
state.report.registePerMonth = registerList;
let activeList = new Array(12)
.fill({ count: 0, mark: 'total' })
.map((v, idx) => ({ ...v, month: idx + 1 }));
.fill({ count: 0, mark: 'allActive' })
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
let activeAppList = new Array(12)
.fill({
count: 0,
mark: 'monthAppActive',
})
.map((v, idx) => ({ ...v, month: idx + 1 }));
.fill({ count: 0, mark: 'monthAppActive' })
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
let activeDeviceList = new Array(12)
.fill({ count: 0, mark: 'monthHardActive' })
.map((v, idx) => ({ ...v, month: (idx + 1).toString() }));
data.listCount.map(val => {
let idx = val.month - 1;
activeList[idx].count += val.count;
});
data.listCount
.filter(val => val.mark === 'monthAppActive' || val.mark === 'allActive')
.map(val => {
let idx = val.month - 1;
if (val.mark === 'allActive') {
activeList[idx].count += val.count;
}
if (val.mark === 'monthAppActive') {
activeAppList[idx].count += val.count;
});
}
if (val.mark === 'monthHardActive') {
activeDeviceList[idx].count += val.count;
}
});
activeList.push.apply(activeList, activeAppList);
activeList.push.apply(activeList, activeDeviceList);
state.report.activeUser = activeList;
},
[GET_TITLE_DATA](state, data) {
......
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