Commit eec7f635 by 姜雷

Merge branch 'develop' into 'test'

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