Исправление ошибок 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]) { if (!acc[item.namecrit]) {
acc[item.namecrit] = {rating: [], ico: '', color: '', name: ''} acc[item.namecrit] = {rating: [], ico: '', color: '', name: ''}
} }
acc[item.namecrit]['rating'].push(item.rating) acc[item.namecrit]['rating'].push(item.rating)
acc[item.namecrit]['ico'] = item.ico acc[item.namecrit]['ico'] = item.ico
@@ -94,10 +94,11 @@ export default {
tot.add(item.usercom) tot.add(item.usercom)
if (!us[splitname(item.author)]) { 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) { 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)]['login'] = item.author.login
us[splitname(item.author)]['post'] = item.author.post us[splitname(item.author)]['post'] = item.author.post
@@ -126,7 +127,7 @@ export default {
if (crit.value.count < val.count.size) { 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"> <v-card-text class="text-h5 pa-2 pl-5 flex-wrap align-center d-flex justify-space-between">
{{name}} {{name}}
<!-- <my-helper :pretext="users.count"/> -->
<v-icon <v-icon
color="blue-grey-lighten-1" color="blue-grey-lighten-1"
:icon="ico" :icon="ico"
@@ -20,7 +21,17 @@
<span class="subheading text-h6"> <span class="subheading text-h6">
{{users.count.size}} {{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> </span>
</v-col> </v-col>
</v-row> </v-row>
</v-card-text> </v-card-text>
+18 -13
View File
@@ -117,7 +117,7 @@
Рейтинг посещаемости страниц портала Рейтинг посещаемости страниц портала
</v-col> </v-col>
</v-row> </v-row>
</v-card-title> </v-card-title>
<v-divider/> <v-divider/>
<v-row class=" overflow-auto h-0"> <v-row class=" overflow-auto h-0">
@@ -151,14 +151,17 @@
</v-col> </v-col>
</v-row> </v-row>
<v-row no-gutters class="ma-0 flex-grow-0 gap" > <v-row no-gutters class="ma-0 flex-grow-0 gap" >
<v-col class="" v-for="(val, key) in activuser()" :key = key> <template v-for="(val, key) in activuser()" >
{{val}}
<v-col v-if = "Object.keys(activuser()).indexOf(key)<3" :key = key>
<top-user <top-user
:users="val" :users="val"
:ico="icons[Object.keys(activuser()).indexOf(key)]" :ico="icons[Object.keys(activuser()).indexOf(key)]"
name="Активность" name="Активность"
/> />
</v-col> </v-col>
</template>
</v-row> </v-row>
</v-col> </v-col>
</v-row> </v-row>
@@ -208,7 +211,7 @@ setup(){
const arrlines = {} const arrlines = {}
const data = computed({ const data = computed({
get() { get() {
arrlines.value = { arrlines.value = {
@@ -342,13 +345,16 @@ setup(){
} }
const returnend = (dates) => { const returnend = (dates) => {
console.log(dates,'dates');
endate.value = dates endate.value = dates
periodname() periodname()
visition() visition()
} }
const 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 visiting.value = result.data.result
feedback.value = result.data.feedback feedback.value = result.data.feedback
})} })}
@@ -450,38 +456,37 @@ setup(){
const groupedData = const groupedData =
visiting.value.reduce((acc, item) => { visiting.value.reduce((acc, item) => {
if (Object.keys(acc).length <3) { // if (Object.keys(acc).length <3) {
if (!acc[splitname(item.author)]) { if (!acc[splitname(item.author)]) {
acc[splitname(item.author)] = {count: new Set(), login: '', fio: '', post: ''} 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)]['fio'] = splitname(item.author)
acc[splitname(item.author)]['count'].add(item.pages) acc[splitname(item.author)]['count'].add(item.pages)
acc[splitname(item.author)]['login'] = item.author.login acc[splitname(item.author)]['login'] = item.author.login
acc[splitname(item.author)]['post'] = item.author.post acc[splitname(item.author)]['post'] = item.author.post
} // }
return acc return acc
}, {}); }, {})
// .sort((a, b) => console.log(b.count- a.count) )
// const sorted = groupedData
const sorted = Object.entries(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]) => .reduce((r, [k, v]) =>
({ ...r, [k]: v } ), {} ({ ...r, [k]: v } ), {}
) )
return sorted return sorted