diff --git a/src/front/src/components/UI/aboutportal/feedmodul.vue b/src/front/src/components/UI/aboutportal/feedmodul.vue index cd47a1b24..40d45ad80 100644 --- a/src/front/src/components/UI/aboutportal/feedmodul.vue +++ b/src/front/src/components/UI/aboutportal/feedmodul.vue @@ -83,7 +83,7 @@ export default { if (!acc[item.namecrit]) { acc[item.namecrit] = {rating: [], ico: '', color: '', name: ''} } - + acc[item.namecrit]['rating'].push(item.rating) acc[item.namecrit]['ico'] = item.ico @@ -94,10 +94,11 @@ export default { tot.add(item.usercom) if (!us[splitname(item.author)]) { - us[splitname(item.author)] = {count: new Set(), login: 0} + us[splitname(item.author)] = {count: new Set(), login: 0, post: ''} } if (item.comment.length > 0) { - us[splitname(item.author)]['count'].add(item.usercom) + // console.log(us, item.comment, 'item.comment'); + us[splitname(item.author)]['count'].add(item.comment) us[splitname(item.author)]['login'] = item.author.login us[splitname(item.author)]['post'] = item.author.post @@ -126,7 +127,7 @@ export default { if (crit.value.count < val.count.size) { - crit.value = {fio:key,count:val.count.size, login: val.login, post: val.post} + crit.value = {fio:key,count:val.count, login: val.login, post: val.post} } } diff --git a/src/front/src/components/UI/aboutportal/top-user.vue b/src/front/src/components/UI/aboutportal/top-user.vue index 1fe5364d3..d45dc612c 100644 --- a/src/front/src/components/UI/aboutportal/top-user.vue +++ b/src/front/src/components/UI/aboutportal/top-user.vue @@ -4,6 +4,7 @@ > {{name}} + {{users.count.size}} + +
+ {{x}} +
+
+
diff --git a/src/front/src/views/AboutPortalPage.vue b/src/front/src/views/AboutPortalPage.vue index 6ae4bc66a..35e07a993 100644 --- a/src/front/src/views/AboutPortalPage.vue +++ b/src/front/src/views/AboutPortalPage.vue @@ -117,7 +117,7 @@ Рейтинг посещаемости страниц портала - + - - {{val}} + @@ -208,7 +211,7 @@ setup(){ const arrlines = {} - + const data = computed({ get() { arrlines.value = { @@ -342,13 +345,16 @@ setup(){ } const returnend = (dates) => { + console.log(dates,'dates'); endate.value = dates periodname() visition() } const visition = () => { - axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}&end=${endate.value}`).then(result => { + + let end = format2(new Date(endate.value).setDate(new Date(endate.value).getDate() + 1)) + axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}&end=${end}`).then(result => { visiting.value = result.data.result feedback.value = result.data.feedback })} @@ -450,38 +456,37 @@ setup(){ const groupedData = visiting.value.reduce((acc, item) => { - if (Object.keys(acc).length <3) { + // if (Object.keys(acc).length <3) { if (!acc[splitname(item.author)]) { acc[splitname(item.author)] = {count: new Set(), login: '', fio: '', post: ''} } - console.log(acc,'-----------------------------------'); acc[splitname(item.author)]['fio'] = splitname(item.author) acc[splitname(item.author)]['count'].add(item.pages) acc[splitname(item.author)]['login'] = item.author.login acc[splitname(item.author)]['post'] = item.author.post - } + // } return acc - }, {}); - + }, {}) + // .sort((a, b) => console.log(b.count- a.count) ) + // const sorted = groupedData const sorted = Object.entries(groupedData) - .sort(([,a],[,b]) => b.count-a.count) + .sort(([,a],[,b]) => (b.count.size - a.count.size)) .reduce((r, [k, v]) => - ({ ...r, [k]: v } ), {} ) - + return sorted