Таблица активных пользователей
This commit is contained in:
1 parent
55eadc1500
commit
a6cbd30374
6 files changed
+180
-70
No files matched your search
@@ -35,14 +35,18 @@
|
|||||||
:key="key"
|
:key="key"
|
||||||
>
|
>
|
||||||
<td>{{key}}</td>
|
<td>{{key}}</td>
|
||||||
<td-tooltip
|
<td>
|
||||||
:number = modelrating?val.now.unique.length:val.now.countall
|
<tooltip-number
|
||||||
:tooltip = val.now.unique
|
:number = modelrating?val.now.unique.length:val.now.countall
|
||||||
/>
|
:tooltip = val.now.unique
|
||||||
<td-tooltip
|
/>
|
||||||
:number = modelrating?val.year.unique.length:val.year.countall
|
</td>
|
||||||
:tooltip = val.year.unique
|
<td>
|
||||||
/>
|
<tooltip-number
|
||||||
|
:number = modelrating?val.year.unique.length:val.year.countall
|
||||||
|
:tooltip = val.year.unique
|
||||||
|
/>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -55,11 +59,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import tdTooltip from '@/components/UI/td-tooltip.vue'
|
import tooltipNumber from '@/components/UI/tooltip-number.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: { tdTooltip },
|
components: { tooltipNumber },
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
pages_count: {
|
pages_count: {
|
||||||
|
|||||||
@@ -1,22 +1,65 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-card class="text-center h-100">
|
<v-table>
|
||||||
|
<thead>
|
||||||
|
<tr >
|
||||||
|
<!-- <my-helper :pretext="n"/> -->
|
||||||
|
|
||||||
|
<th>
|
||||||
|
|
||||||
|
</th>
|
||||||
|
<th v-for="(n, key) in th_text" :key="key">
|
||||||
|
|
||||||
|
<tooltip-text
|
||||||
|
:text="key"
|
||||||
|
:tooltip="n"
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
|
v-for="(user, key) in activusers" :key="key"
|
||||||
|
style="height:100px"
|
||||||
|
>
|
||||||
|
<td>
|
||||||
|
<list-user
|
||||||
|
:author=user.user
|
||||||
|
:from_which = "'top-user'"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="text-center subheading pa-0 text-subtitle-2 font-weight-medium" v-for="(x, key) in user.info" :key="key">
|
||||||
|
|
||||||
|
{{x}}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</v-table>
|
||||||
|
<!-- <v-card class="text-center h-100">
|
||||||
|
<my-helper :pretext="activusers"/>
|
||||||
|
<v-btn density="comfortable" icon="$vuetify" @click="$emit('sortcount')"></v-btn>
|
||||||
|
<v-btn density="comfortable" icon="$vuetify"></v-btn>
|
||||||
<div v-for="(user, key) in activusers" :key="key" >
|
<div v-for="(user, key) in activusers" :key="key" >
|
||||||
|
|
||||||
<v-card
|
<v-card
|
||||||
class="mx-auto"
|
class="mx-auto"
|
||||||
height="150px"
|
height="100px"
|
||||||
>
|
>
|
||||||
|
|
||||||
<!-- <my-helper :pretext="user"/> -->
|
|
||||||
|
|
||||||
<v-divider/>
|
<v-divider/>
|
||||||
<v-card-text class="pa-0 d-flex flex-column h-100">
|
<v-card-text class="pa-0 d-flex flex-column h-100">
|
||||||
<v-row no-gutters>
|
<v-row no-gutters>
|
||||||
<v-col lg=8 class="px-0">
|
<v-col lg=8 class="align-self-center">
|
||||||
<list-user :author=user />
|
<list-user :author=user.user />
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="pt-8 text-center">
|
<v-col class="pt-8 text-center">
|
||||||
<span class="subheading text-h6">
|
<span class="subheading text-h6" v-for="(x, key) in user.info" :key="key">
|
||||||
{{Object.keys(user.session).length}}
|
{{x}}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
@@ -26,17 +69,22 @@
|
|||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
</div>
|
</div>
|
||||||
</v-card>
|
</v-card> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { spravURL } from '@/utils/axios-api'
|
import { spravURL } from '@/utils/axios-api'
|
||||||
import {checkremote} from '@/utils/universal_functions'
|
import {checkremote} from '@/utils/universal_functions'
|
||||||
import listUser from '@/components/UI//fiousercard/listUser.vue'
|
import listUser from '@/components/UI//fiousercard/listUser.vue'
|
||||||
import { ref } from 'vue'
|
import TooltipNumber from '@/components/UI/tooltip-number.vue'
|
||||||
|
import TooltipText from '@/components/UI/tooltip-text.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { listUser },
|
components: {
|
||||||
|
listUser,
|
||||||
|
TooltipNumber,
|
||||||
|
TooltipText
|
||||||
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
|
||||||
@@ -50,11 +98,18 @@ export default {
|
|||||||
|
|
||||||
setup(props) {
|
setup(props) {
|
||||||
|
|
||||||
|
const th_text = {
|
||||||
|
"Просмотры": "Сколько было открыто страниц за период",
|
||||||
|
"Сессии": "Сколько дней за период был посещен Портал",
|
||||||
|
"Страницы": "Общее количество посещенных уникальных страниц за период",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
checkremote,
|
checkremote,
|
||||||
spravURL,
|
spravURL,
|
||||||
|
th_text
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="height:68%">
|
<div style="height:68%">
|
||||||
|
|
||||||
|
<v-list-item class="pl-4 h-100 pointer text-left" @click="open=true">
|
||||||
<v-list-item class="pl-4 h-100 pointer" @click="open=true">
|
|
||||||
<template v-slot:prepend>
|
<template v-slot:prepend>
|
||||||
<v-avatar
|
<v-avatar
|
||||||
color="grey-darken-3"
|
color="grey-darken-3"
|
||||||
@@ -10,10 +9,10 @@
|
|||||||
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<v-list-item-title class="text-body-1 font-weight-medium pt-2">
|
<v-list-item-title :class="style_item_title()">
|
||||||
{{author.fio}}
|
{{author.fio}}
|
||||||
</v-list-item-title>
|
</v-list-item-title>
|
||||||
<v-list-item-subtitle class="pb-2">
|
<v-list-item-subtitle :class="style_item_subtitle()">
|
||||||
{{author.post}}
|
{{author.post}}
|
||||||
|
|
||||||
</v-list-item-subtitle>
|
</v-list-item-subtitle>
|
||||||
@@ -38,14 +37,40 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: {}
|
default: {}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
from_which: {
|
||||||
|
type: Text,
|
||||||
|
default: "dialog-search"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
setup(){
|
setup(props){
|
||||||
|
|
||||||
const open = ref(false)
|
const open = ref(false)
|
||||||
|
|
||||||
|
const style_item_title = () => {
|
||||||
|
if (props.from_which=="top-user") {
|
||||||
|
return "text-caption font-weight-medium"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return "text-body-1 font-weight-medium pt-2"
|
||||||
|
}
|
||||||
|
|
||||||
|
const style_item_subtitle = () => {
|
||||||
|
if (props.from_which=="top-user") {
|
||||||
|
return "text-caption"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return "pb-2"
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
open,
|
open,
|
||||||
checkremote,
|
checkremote,
|
||||||
spravURL
|
spravURL,
|
||||||
|
style_item_title,
|
||||||
|
style_item_subtitle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<td>
|
|
||||||
<v-tooltip
|
<v-tooltip
|
||||||
location="bottom"
|
location="bottom"
|
||||||
v-if="number>0"
|
v-if="number>0"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<span v-else>
|
<span v-else>
|
||||||
0
|
0
|
||||||
</span>
|
</span>
|
||||||
</td>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
<template>
|
||||||
|
<v-tooltip
|
||||||
|
location="bottom"
|
||||||
|
>
|
||||||
|
<template v-slot:activator="{ props }">
|
||||||
|
<span v-bind="props">
|
||||||
|
{{text}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<v-row
|
||||||
|
no-gutters
|
||||||
|
>
|
||||||
|
<v-col>
|
||||||
|
{{tooltip}}
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</v-tooltip>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
props: {
|
||||||
|
|
||||||
|
tooltip: {
|
||||||
|
type: Text,
|
||||||
|
default:''
|
||||||
|
},
|
||||||
|
|
||||||
|
text: {
|
||||||
|
type: Text,
|
||||||
|
default:''
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -21,11 +21,12 @@
|
|||||||
<rating-page :pages_count=pages_count />
|
<rating-page :pages_count=pages_count />
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex flex-column bg-yellow">
|
<v-col lg=4 class="d-flex flex-column bg-yellow">
|
||||||
<v-row no-gutters class=" overflow-auto h-0">
|
<v-row no-gutters class=" overflow-auto h-0">
|
||||||
<v-col>
|
<v-col>
|
||||||
<top-user
|
<top-user
|
||||||
:activusers = dataActivusers
|
:activusers = dataTopUser
|
||||||
|
@sortcount=sortcount
|
||||||
/>
|
/>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -246,7 +247,7 @@ setup(){
|
|||||||
if (filterStore.date_period.startdate == filterStore.date_period.enddate) {
|
if (filterStore.date_period.startdate == filterStore.date_period.enddate) {
|
||||||
days_between = 1
|
days_between = 1
|
||||||
}
|
}
|
||||||
console.log(days_between, 'days_between');
|
// console.log(days_between, 'days_between');
|
||||||
previous.value.start = new Date(new Date(filterStore.date_period.startdate).setDate(new Date(filterStore.date_period.startdate).getDate() - days_between))
|
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))
|
previous.value.end = new Date(new Date(filterStore.date_period.startdate).setDate(new Date(filterStore.date_period.startdate).getDate() - 1))
|
||||||
}
|
}
|
||||||
@@ -359,11 +360,6 @@ setup(){
|
|||||||
acc[item.pages].now.countall += item.count
|
acc[item.pages].now.countall += item.count
|
||||||
}
|
}
|
||||||
|
|
||||||
// Данные для посещаемость портала
|
|
||||||
if (item.visitdate >= format2(previous.value.start) && item.visitdate <= format2(previous.value.end)){
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
dataLineChart.value = lineCharts
|
dataLineChart.value = lineCharts
|
||||||
dataActivusers.value = activusers
|
dataActivusers.value = activusers
|
||||||
dataTopUser.value = top_user
|
dataTopUser.value = top_user
|
||||||
@@ -385,67 +381,52 @@ setup(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tooltipinfo = () => {
|
const tooltipinfo = () => {
|
||||||
|
|
||||||
console.log(dataActivusers.value, '0------');
|
|
||||||
Object.entries(dataActivusers.value).reduce((acc, item) => {
|
Object.entries(dataActivusers.value).reduce((acc, item) => {
|
||||||
console.log(' новый пользователь--------------------------------------------------------------------------', item);
|
|
||||||
dataTopUser.value[item[0]].info.session = Object.keys(item[1].session).length
|
dataTopUser.value[item[0]].info.session = Object.keys(item[1].session).length
|
||||||
|
|
||||||
|
|
||||||
Object.entries(item[1].session).reduce((acc_data, data) => {
|
Object.entries(item[1].session).reduce((acc_data, data) => {
|
||||||
// console.log(data, '1------');
|
|
||||||
if(!acc_data[item[0]]) {
|
if(!acc_data[item[0]]) {
|
||||||
acc_data[item[0]] =0
|
acc_data[item[0]] =0
|
||||||
}
|
}
|
||||||
|
|
||||||
acc_data[item[0]] += Object.keys(data[1].pages).length
|
acc_data[item[0]] += Object.keys(data[1].pages).length
|
||||||
console.log(data[1].pages, '-', Object.values(data[1].pages), '-------------1');
|
|
||||||
Object.entries(data[1].pages).map(e => {
|
Object.entries(data[1].pages).map(e => {
|
||||||
if (!dataTopUser.value[item[0]].tooltip.namepages[e[0]])
|
if (!dataTopUser.value[item[0]].tooltip.namepages[e[0]])
|
||||||
{
|
{
|
||||||
dataTopUser.value[item[0]].tooltip.namepages[e[0]] = {count: 0, unic: 0 }
|
dataTopUser.value[item[0]].tooltip.namepages[e[0]] = {count: 0, unic: 0 }
|
||||||
}
|
}
|
||||||
|
|
||||||
dataTopUser.value[item[0]].tooltip.namepages[e[0]].count += data[1].pages[e[0]].count
|
dataTopUser.value[item[0]].tooltip.namepages[e[0]].count += data[1].pages[e[0]].count
|
||||||
// console.log(data[1].pages[e[0]], '-------------2.1')
|
dataTopUser.value[item[0]].tooltip.namepages[e[0]].unic +=1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
)
|
)
|
||||||
// Object.entries(data[1].pages).reduce((acc_count, count) => {
|
|
||||||
// console.log(acc_count, count, count[0], '-------------2.2');
|
|
||||||
|
|
||||||
// if (!dataTopUser.value[item[0]].tooltip.namepages[count[0]])
|
|
||||||
// {
|
|
||||||
// dataTopUser.value[item[0]].tooltip.namepages[count[0]] = {count: 0, unic: 0 }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// dataTopUser.value[item[0]].tooltip.namepages[count[0]].count += count[1].count
|
|
||||||
|
|
||||||
// })
|
|
||||||
|
|
||||||
// Object.entries(data[1].pages).map(e=> console.log(e[1]))
|
|
||||||
// Object.keys(data[1].pages).map(e=> checking_for_entry(dataTopUser.value[item[0]].tooltip.namepages, e))
|
|
||||||
// console.log(Object.keys(data[1].pages), '---wwwwwwwwwwwww');
|
|
||||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Переделать сбор уникальнных страниц
|
|
||||||
|
|
||||||
// console.log(dataTopUser.value[item[0]].tooltip, data[1].pages, '-----------------1111');
|
|
||||||
// console.log(Object.keys(data[1].pages).length , dataTopUser.value[item[0]], '------');
|
|
||||||
// dataTopUser.value[item[0]].info.pages += Object.keys(data[1].pages).length
|
|
||||||
// console.log(acc_data, data[1].pages, Object.keys(data[1].pages).length, '2------');
|
|
||||||
dataTopUser.value[item[0]].info.pages = acc_data[item[0]]
|
dataTopUser.value[item[0]].info.pages = acc_data[item[0]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// dataTopUser.value = sorted
|
||||||
return acc_data
|
return acc_data
|
||||||
}, {})
|
}, {})
|
||||||
|
|
||||||
|
// dataTopUser.value = sorted
|
||||||
return acc
|
return acc
|
||||||
}, {})
|
}, {})
|
||||||
|
// dataTopUser.value = Object.values(dataTopUser.value)
|
||||||
|
// .sort((a,b) => (b.info.count - a.info.count || b.info.session - a.info.session ))
|
||||||
|
// console.log(sorted, '111111111111111111111111111111')
|
||||||
console.log(dataTopUser.value)
|
console.log(dataTopUser.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sortcount = () => {
|
||||||
|
console.log('-------------');
|
||||||
|
dataTopUser.value = Object.values(dataTopUser.value)
|
||||||
|
.sort((a,b) => (b.info.count - a.info.count ))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const title_period = () => {
|
const title_period = () => {
|
||||||
@@ -466,7 +447,9 @@ setup(){
|
|||||||
dataActivusers,
|
dataActivusers,
|
||||||
previous,
|
previous,
|
||||||
format1,
|
format1,
|
||||||
selected_days
|
selected_days,
|
||||||
|
dataTopUser,
|
||||||
|
sortcount
|
||||||
// countgrupp,
|
// countgrupp,
|
||||||
// activuser,
|
// activuser,
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user