|
@@ -105,12 +118,13 @@ export default {
title: '',
align: 'start',
sortable: false,
- key: 'user.fio',
+ key: 'user',
+ minWidth: '180'
},
- { title: 'Просмотры', align: 'start', key: 'info.count' },
- { title: 'Сессии', align: 'start', key: 'info.session' },
- { title: 'Страницы', align: 'start', key: 'info.pages' },
+ { title: 'Просмотры', align: 'start', key: 'info.count', maxWidth: '10' },
+ { title: 'Сессии', align: 'start', key: 'info.session', maxWidth: '10' },
+ { title: 'Страницы', align: 'start', key: 'info.pages',maxWidth: '10' },
]
diff --git a/src/front/src/components/UI/fiousercard/listUser.vue b/src/front/src/components/UI/fiousercard/listUser.vue
index 1d3205f0f..89510069e 100644
--- a/src/front/src/components/UI/fiousercard/listUser.vue
+++ b/src/front/src/components/UI/fiousercard/listUser.vue
@@ -1,6 +1,6 @@
-
+
+
+
+
+
+ {{author.fio}}
+
+
+
+
+
Date: Thu, 8 Feb 2024 11:25:15 +0300
Subject: [PATCH 18/19] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE?=
=?UTF-8?q?=D0=B9=D0=BA=D0=B0=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8?=
=?UTF-8?q?=D1=8F=20=D0=BA=D0=BE=D0=BB=D0=BE=D0=BD=D0=BE=D0=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/UI/aboutportal/top-user.vue | 36 ++++++++++++++++++-
1 file changed, 35 insertions(+), 1 deletion(-)
diff --git a/src/front/src/components/UI/aboutportal/top-user.vue b/src/front/src/components/UI/aboutportal/top-user.vue
index a2077ee1f..bb70dc952 100644
--- a/src/front/src/components/UI/aboutportal/top-user.vue
+++ b/src/front/src/components/UI/aboutportal/top-user.vue
@@ -26,6 +26,39 @@
density="compact"
>
+
+
+
+ |
+ toggleSort(column)"
+ color="grey-darken-4"
+ variant="text"
+ size="small"
+ label
+ >
+ toggleSort(column)"
+ >
+ {{ column.title }}
+
+
+
+
+
+
+ |
+
+
+
+
-
- Самые активные пользователи
-
-
+
+ Самые активные пользователи
+
-
-
-
- |
- toggleSort(column)"
- color="grey-darken-4"
- variant="text"
- size="small"
- label
- >
- toggleSort(column)"
- >
- {{ column.title }}
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
+ color="grey"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Сколько раз посетили в течение заданного периода (1 раз = 1 день)
+
+
@@ -142,6 +122,11 @@ export default {
default: {}
},
+ days: {
+ type: Number,
+ default: 0
+ }
+
},
setup() {
@@ -158,7 +143,7 @@ export default {
{ title: 'Просмотры', align: 'start', key: 'info.count', maxWidth: '10' },
{ title: 'Сессии', align: 'start', key: 'info.session', maxWidth: '10' },
- { title: 'Страницы', align: 'start', key: 'info.pages',maxWidth: '10' },
+ { title: 'Страницы', align: 'start', key: 'info.pages', maxWidth: '10' },
]
@@ -169,9 +154,14 @@ export default {
align: 'start',
sortable: false,
key: 'namepages',
+ width: '60%',
+ maxWidth: '60%',
+ minWidth: '60%',
},
- { title: 'Всего', align: 'start', key: 'count' },
- { title: 'Уникальных', align: 'start', key: 'unic' },
+ { title: 'Всего', align: 'start', key: 'count', width: '20%', maxWidth: '20%'
+ },
+ { title: 'Уникальных', align: 'start', key: 'unic', width: '20%', maxWidth: '20%'
+ },
]
diff --git a/src/front/src/store/AboutPortalFilter.js b/src/front/src/store/AboutPortalFilter.js
index c009779ab..ec5c975ed 100644
--- a/src/front/src/store/AboutPortalFilter.js
+++ b/src/front/src/store/AboutPortalFilter.js
@@ -5,8 +5,11 @@ import { ref } from 'vue'
export const usePortalFilterStore = defineStore('filter', () => {
const date_period = ref({ "startdate": new Date(new Date().getFullYear(), 0, 1),
- "enddate": new Date()
+ "enddate": new Date(),
})
+
+
return { date_period }
},
+
)
\ No newline at end of file
diff --git a/src/front/src/views/AboutPortalPage.vue b/src/front/src/views/AboutPortalPage.vue
index 6092de6c9..327990aee 100644
--- a/src/front/src/views/AboutPortalPage.vue
+++ b/src/front/src/views/AboutPortalPage.vue
@@ -5,6 +5,7 @@
{{format1(previous.start)}} - {{format1(previous.end)}}
+ {{days_between_startend}}
@@ -16,7 +17,7 @@
visiting- (все данные)
-
+
@@ -26,6 +27,7 @@
@@ -68,7 +70,7 @@ export default {
setup(){
const filterStore = usePortalFilterStore()
-
+ const days_between_startend = ref(0)
const visiting = ref([])
const feedback = ref([])
const staff = ref(0)
@@ -76,13 +78,14 @@ setup(){
const dataLineChart = ref({})
const dataActivusers = ref([])
const unicuser = ref([])
- const arrPage = ref([])
+
const previous = ref({start: new Date(), end: new Date()})
const selected_days = ref({today: 'сегодня', year: {start: new Date(), end: new Date()}})
const pages_count = ref({data: {}, title: {}})
const previous_period =() => {
+
let days_between = Math.floor((new Date(filterStore.date_period.enddate) - new Date(filterStore.date_period.startdate)) / (1000*60*60*24))
days_between += 1
if (filterStore.date_period.startdate == filterStore.date_period.enddate) {
@@ -90,13 +93,17 @@ setup(){
}
previous.value.start = new Date(new Date(filterStore.date_period.startdate).setDate(new Date(filterStore.date_period.startdate).getDate() - days_between))
previous.value.end = new Date(new Date(filterStore.date_period.startdate).setDate(new Date(filterStore.date_period.startdate).getDate() - 1))
+
+ days_between_startend.value = days_between
}
pagecounter()
const visition = () => {
- axiosApiInstance.get(`api/watcher/counter/`).then(result => {
+ previous_period()
+ console.log(format2(previous.value.start), format2(previous.value.end), '---------previous.value--------------');
+ axiosApiInstance.get(`api/watcher/counter/?start=${format2(previous.value.start)}&end=${format2(previous.value.end)}`).then(result => {
staff.value = result.data.staff
visiting.value = result.data.result
feedback.value = result.data.feedback
@@ -273,6 +280,7 @@ setup(){
watch(()=>filterStore.date_period,(newValue,oldValue)=>{
if(newValue){
+ visition()
visitionreduce()
title_period()
}
@@ -301,7 +309,8 @@ setup(){
previous,
format1,
selected_days,
- sortcount
+ sortcount,
+ days_between_startend
// countgrupp,
// activuser,
diff --git a/src/watcher/views.py b/src/watcher/views.py
index 0c485b0c4..1bc3e1204 100644
--- a/src/watcher/views.py
+++ b/src/watcher/views.py
@@ -19,10 +19,11 @@ class Counter(ListAPIView):
serializer_class = CountSerializer
def get(self, request):
+ print(request.GET.get("start"), request.GET.get("end"),'--------------------------------------------')
# Посещаемость портала
- # res = CountVisitor.objects.filter(visitdate__range=[request.GET.get("start"), request.GET.get("end")]).annotate(Sum('count'))
- res = CountVisitor.objects.all().annotate(Sum('count'))
+ res = CountVisitor.objects.filter(visitdate__range=[request.GET.get("start"), request.GET.get("end")]).annotate(Sum('count'))
+ # res = CountVisitor.objects.all().annotate(Sum('count'))
result = CountSerializer(res, many=True).data
# Обратная связь
| |