Исправление ошибок 1

This commit is contained in:
iriska-gri committed 2024-01-24 11:26:56 +03:00
1 parent 4c3c05846d
commit f734f7c397
3 files changed
+34 -17

No files matched your search

@@ -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}
}
}
@@ -4,6 +4,7 @@
>
<v-card-text class="text-h5 pa-2 pl-5 flex-wrap align-center d-flex justify-space-between">
{{name}}
<!-- <my-helper :pretext="users.count"/> -->
<v-icon
color="blue-grey-lighten-1"
:icon="ico"
@@ -20,7 +21,17 @@
<span class="subheading text-h6">
{{users.count.size}}
<v-tooltip
v-if="name=='Активность'"
activator="parent"
location="top"
>
<div v-for="x in users.count" :key=x>
{{x}}
</div>
</v-tooltip>
</span>
</v-col>
</v-row>
</v-card-text>
+18 -13
View File
@@ -117,7 +117,7 @@
Рейтинг посещаемости страниц портала
</v-col>
</v-row>
</v-card-title>
<v-divider/>
<v-row class=" overflow-auto h-0">
@@ -151,14 +151,17 @@
</v-col>
</v-row>
<v-row no-gutters class="ma-0 flex-grow-0 gap" >
<v-col class="" v-for="(val, key) in activuser()" :key = key>
{{val}}
<template v-for="(val, key) in activuser()" >
<v-col v-if = "Object.keys(activuser()).indexOf(key)<3" :key = key>
<top-user
:users="val"
:ico="icons[Object.keys(activuser()).indexOf(key)]"
name="Активность"
/>
</v-col>
</template>
</v-row>
</v-col>
</v-row>
@@ -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