Статистика

This commit is contained in:
iriska-gri committed 2024-01-12 10:15:14 +03:00
1 parent 8f701420a9
commit 59544a7b2c
5 files changed
+32 -12

No files matched your search

+26 -6
View File
@@ -33,6 +33,7 @@
<v-row>
<v-col class="bg-red">
<feedmodul :feedback="feedback"/>
{{countvising}}
</v-col>
</v-row>
</v-col>
@@ -63,7 +64,7 @@
<tbody>
<tr v-for="(val, key) in countgrupp()" :key = key>
<td class="text-left">{{key}}</td>
<td class="text-center">{{ val.now }}</td>
<td class="text-center">{{ val.now }} </td>
<td class="text-center">{{ val.week }}</td>
<td class="text-center">{{ val.year }}</td>
</tr>
@@ -76,6 +77,7 @@
<v-col class="bg-black">
<div v-for="(val, key) in activuser()" :key = key>
{{key}} : {{ val.count }} {{ val.login }}
</div>
<v-card class="d-flex" title="Самые активные пользователи">
@@ -106,6 +108,7 @@ export default {
setup(){
const visiting = ref([])
const feedback = ref([])
const countvising = ref({now: 0, week: 0, year: 0})
const arrlines = {}
const data = computed({
@@ -202,7 +205,7 @@ setup(){
pagecounter()
const countvis = () => {
let filteres = visiting.value.reduce((acc, item) => {
acc['year'] += item.count
@@ -213,6 +216,7 @@ setup(){
}
if (item.visitdate >= previousWeekStart.format('YYYY-MM-DD') && item.visitdate <= previousWeekEnd.format('YYYY-MM-DD')) {
acc['week'] += item.count
}
@@ -226,34 +230,49 @@ setup(){
const countgrupp = () => {
let us = {}
const groupedData =
visiting.value.reduce((acc, item) => {
console.log(countvising.value, 'countvising.value');
if (!acc[item.pages]) {
acc[item.pages] = {now: 0, week: 0, year: 0}
}
acc[item.pages]['year'] += item.count
if (item.visitdate == moment(maxDate.value).format('YYYY-MM-DD')) {
acc[item.pages]['now'] += item.count
}
if (item.visitdate >= previousWeekStart.format('YYYY-MM-DD') && item.visitdate <= previousWeekEnd.format('YYYY-MM-DD')) {
acc[item.pages]['week'] += item.count
}
// if (!us[item.author.id])
// {
// us[item.author.id] = new Set()
// }
return acc
}, {});
console.log(groupedData, '----------------------------');
return groupedData
}
// const countgruppsumm = () => {
// countgrupp()
// }
const activuser = () => {
const groupedData =
@@ -302,7 +321,8 @@ setup(){
activuser,
data,
options,
feedback
feedback,
countvising
}
}