Половина собрана
This commit is contained in:
1 parent
186e9f8776
commit
eb4096bfce
1 file changed
+22
-6
@@ -147,24 +147,40 @@ setup(){
|
||||
}
|
||||
|
||||
let user = visiting.value.filter(e => e.author.id == iduser)
|
||||
|
||||
|
||||
let yearpages = {}
|
||||
console.log(user, 'user');
|
||||
const groupUser = user.reduce((acc, item) => {
|
||||
|
||||
if (!yearpages[item.visitdate]) {
|
||||
yearpages[item.visitdate] = {
|
||||
}
|
||||
}
|
||||
if (!yearpages[item.visitdate][item.pages]) {
|
||||
yearpages[item.visitdate][item.pages] = 0
|
||||
}
|
||||
|
||||
yearpages[item.visitdate][item.pages] += item.count
|
||||
|
||||
acc['id'] = item.author.id
|
||||
acc['login'] = item.author.login
|
||||
acc['post'] = item.author.post
|
||||
acc['fio'] = splitname(item.author)
|
||||
acc['count'] += item.count
|
||||
acc['session'] = Object.keys(yearpages).length
|
||||
|
||||
// console.log(item.author.id, '----------1');
|
||||
|
||||
// console.log(item.count, '----------1');
|
||||
// activuser.user.id = item.author.id
|
||||
//
|
||||
return acc
|
||||
}, {})
|
||||
}, {count: 0})
|
||||
activuser.user.id = groupUser.id
|
||||
activuser.user.login = groupUser.login
|
||||
activuser.user.post = groupUser.post
|
||||
activuser.user.fio = groupUser.fio
|
||||
console.log(groupUser, '----------1');
|
||||
activuser.info.count = groupUser.count
|
||||
activuser.info.session = groupUser.session
|
||||
console.log(yearpages, '----------1');
|
||||
dataActivusers.value.push(activuser)
|
||||
console.log(dataActivusers.value, '----------2');
|
||||
})
|
||||
@@ -182,7 +198,7 @@ setup(){
|
||||
let lineCharts = {}
|
||||
|
||||
|
||||
let oneUser = {}
|
||||
|
||||
|
||||
console.log(visiting.value)
|
||||
|
||||
|
||||
Reference in new issue
Block a user