Статистика фронт
This commit is contained in:
1 parent
b9afc985de
commit
21fc9d67c6
7 files changed
+279
-75
No files matched your search
@@ -0,0 +1,41 @@
|
|||||||
|
<template>
|
||||||
|
<v-row>
|
||||||
|
<v-col>
|
||||||
|
<v-card :title="name" class="text-center" >
|
||||||
|
<v-card-text >
|
||||||
|
<v-row >
|
||||||
|
<v-col
|
||||||
|
class="text-h2 text-center"
|
||||||
|
>
|
||||||
|
{{total}}
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
|
||||||
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
|
</v-card>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
|
||||||
|
total: {
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,24 +1,61 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<v-row >
|
||||||
<div>
|
<v-col>
|
||||||
<div v-for="(val, key) in average()" :key = key>
|
<card-total
|
||||||
|
name="Всего поставлено оценок"
|
||||||
{{key}}
|
:total="total"
|
||||||
{{val}}
|
/>
|
||||||
</div>
|
<v-divider/>
|
||||||
|
<v-card class="pa-3">
|
||||||
|
<star-like
|
||||||
|
:criteria=average()
|
||||||
|
:rating=average()
|
||||||
|
/>
|
||||||
|
</v-card>
|
||||||
|
<v-divider/>
|
||||||
|
<card-total
|
||||||
|
name="Всего оставлено комментариев"
|
||||||
|
:total="crit.total"
|
||||||
|
/>
|
||||||
|
<v-divider/>
|
||||||
|
<top-user
|
||||||
|
name= "Самый активный критик"
|
||||||
|
:users=crit
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</v-col>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{total}}
|
{{total}}
|
||||||
{{crit}}
|
{{crit}}
|
||||||
</div>
|
|
||||||
<div>{{average()}}</div>
|
</v-row>
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import {splitname} from '@/utils/universal_functions'
|
import {splitname} from '@/utils/universal_functions'
|
||||||
|
import starLike from '@/components/UI/feedback/star-like.vue'
|
||||||
|
import CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
||||||
|
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
components: {
|
||||||
|
starLike,
|
||||||
|
CardTotal,
|
||||||
|
TopUser
|
||||||
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
feedback: {
|
feedback: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@@ -26,9 +63,11 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setup(props, context) {
|
setup(props, context) {
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const crit = ref({max: 0, fio: 0, total: 0})
|
const crit = ref({count: 0, fio: 0, total: 0})
|
||||||
|
|
||||||
|
|
||||||
const average = () => {
|
const average = () => {
|
||||||
@@ -42,20 +81,26 @@ export default {
|
|||||||
.reduce((acc, item) => {
|
.reduce((acc, item) => {
|
||||||
|
|
||||||
if (!acc[item.namecrit]) {
|
if (!acc[item.namecrit]) {
|
||||||
acc[item.namecrit] = {rating: [], ico: ''}
|
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
|
||||||
|
acc[item.namecrit]['color'] = item.color
|
||||||
|
acc[item.namecrit]['name'] = item.namecrit
|
||||||
|
|
||||||
|
|
||||||
tot.add(item.usercom)
|
tot.add(item.usercom)
|
||||||
if (!us[splitname(item.author)]) {
|
|
||||||
us[splitname(item.author)] = {max: new Set(), login: 0}
|
if (!us[splitname(item.author)]) {
|
||||||
|
us[splitname(item.author)] = {count: new Set(), login: 0}
|
||||||
}
|
}
|
||||||
if (item.comment.length > 0) {
|
if (item.comment.length > 0) {
|
||||||
us[splitname(item.author)]['max'].add(item.usercom)
|
us[splitname(item.author)]['count'].add(item.usercom)
|
||||||
us[splitname(item.author)]['login'] = item.author.login
|
us[splitname(item.author)]['login'] = item.author.login
|
||||||
|
us[splitname(item.author)]['post'] = item.author.post
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return acc
|
return acc
|
||||||
@@ -76,10 +121,12 @@ export default {
|
|||||||
for (let [key,val] of Object.entries(us))
|
for (let [key,val] of Object.entries(us))
|
||||||
{
|
{
|
||||||
|
|
||||||
t += val.max.size
|
t += val.count.size
|
||||||
|
|
||||||
if (crit.value.max < val.max.size) {
|
|
||||||
crit.value = {fio:key,max:val.max.size, login: val.login}
|
|
||||||
|
if (crit.value.count < val.count.size) {
|
||||||
|
crit.value = {fio:key,count:val.count.size, login: val.login, post: val.post}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
<template>
|
||||||
|
<v-card
|
||||||
|
class="mx-auto"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<v-card-text class="text-h5 pb-2 pt-6">
|
||||||
|
{{name}}
|
||||||
|
</v-card-text>
|
||||||
|
<v-row>
|
||||||
|
<v-col lg=8> <v-card-actions>
|
||||||
|
<v-list-item>
|
||||||
|
<template v-slot:prepend>
|
||||||
|
<v-avatar
|
||||||
|
color="grey-darken-3"
|
||||||
|
:image="checkremote( `${spravURL}${users.login}.jpg`)"
|
||||||
|
></v-avatar>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<v-list-item-title>{{users.fio}}</v-list-item-title>
|
||||||
|
|
||||||
|
<v-list-item-subtitle>{{users.post}}</v-list-item-subtitle>
|
||||||
|
|
||||||
|
</v-list-item>
|
||||||
|
</v-card-actions></v-col>
|
||||||
|
<v-col class="align-self-center text-right">
|
||||||
|
<v-icon
|
||||||
|
color="teal-darken-3"
|
||||||
|
icon="mdi-comment-account-outline"
|
||||||
|
size="45"
|
||||||
|
></v-icon>
|
||||||
|
<span class="subheading text-h6 me-5 pl-3">{{users.count}}</span>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { spravURL } from '@/utils/axios-api'
|
||||||
|
import {checkremote} from '@/utils/universal_functions'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
|
users: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
setup() {
|
||||||
|
|
||||||
|
return {
|
||||||
|
checkremote,
|
||||||
|
spravURL,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<v-row
|
||||||
|
v-for="(x, key) in criteria"
|
||||||
|
:key = key
|
||||||
|
>
|
||||||
|
<v-col class="flex-grow-0 pb-0">
|
||||||
|
<v-icon
|
||||||
|
size="large"
|
||||||
|
:color="x.color"
|
||||||
|
:icon="x.ico"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
<v-col class="pb-0" lg=3>
|
||||||
|
|
||||||
|
{{x.name}}
|
||||||
|
</v-col>
|
||||||
|
<v-col class="py-0">
|
||||||
|
<v-rating
|
||||||
|
v-model="message[key].rating"
|
||||||
|
:hover="typeof(key) == 'number'"
|
||||||
|
half-increments
|
||||||
|
color="yellow"
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
<v-divider/>
|
||||||
|
</v-row >
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { computed } from 'vue'
|
||||||
|
export default {
|
||||||
|
|
||||||
|
props: {
|
||||||
|
criteria: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
},
|
||||||
|
|
||||||
|
rating: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props, { emit }) {
|
||||||
|
const message = computed({
|
||||||
|
get: () => props.rating,
|
||||||
|
set: (value) => emit('update:rating', value)
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
message,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -8,37 +8,18 @@
|
|||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="flex-grow-0 py-0 text-no-wrap align-self-center text-button">
|
<v-col class="flex-grow-0 py-0 text-no-wrap align-self-center text-button">
|
||||||
Оцените сайт
|
Оцените сайт
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-divider/>
|
<v-divider/>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row
|
<star-like
|
||||||
v-for="(x, key) in feedbackdata.basecrit"
|
:criteria=feedbackdata.basecrit
|
||||||
:key = key
|
:rating=feedbackdata.nowrating
|
||||||
>
|
@update:rating="feedbackdata.nowrating = $event"
|
||||||
<v-col class="flex-grow-0 pb-0">
|
/>
|
||||||
<v-icon
|
|
||||||
size="large"
|
|
||||||
:color="x.color"
|
|
||||||
:icon="x.ico"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
<v-col class="pb-0" lg=3>
|
|
||||||
{{x.name}}
|
|
||||||
</v-col>
|
|
||||||
<v-col class="py-0">
|
|
||||||
<v-rating
|
|
||||||
v-model="feedbackdata.nowrating[key].rating"
|
|
||||||
hover
|
|
||||||
half-increments
|
|
||||||
|
|
||||||
color="yellow"
|
|
||||||
/>
|
|
||||||
</v-col>
|
|
||||||
<v-divider/>
|
|
||||||
</v-row >
|
|
||||||
<v-row class="mt-6">
|
<v-row class="mt-6">
|
||||||
<v-col class="pa-0 px-3">
|
<v-col class="pa-0 px-3">
|
||||||
<v-textarea
|
<v-textarea
|
||||||
label="Ваши комментарии сделают портал лучше"
|
label="Ваши комментарии сделают портал лучше"
|
||||||
hide-details
|
hide-details
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
@@ -76,8 +57,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted, computed } from 'vue'
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
|
import starLike from '@/components/UI/feedback/star-like.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: { starLike },
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
LikeDialog: {
|
LikeDialog: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row>
|
<v-row class="ma-3">
|
||||||
<!-- <v-col
|
<!-- <v-col
|
||||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||||
>
|
>
|
||||||
@@ -10,10 +10,10 @@
|
|||||||
lg=4
|
lg=4
|
||||||
>
|
>
|
||||||
<v-row class="flex-grow-0">
|
<v-row class="flex-grow-0">
|
||||||
<v-col class="bg-orange">
|
<v-col>
|
||||||
|
|
||||||
<v-card
|
<v-card
|
||||||
class="d-flex flex-column my-2 ml-3 text-center"
|
class="d-flex flex-column text-center"
|
||||||
title="Количество посещений">
|
title="Количество посещений">
|
||||||
|
|
||||||
<v-list class="d-flex flex-column align-start text-subtitle-1">
|
<v-list class="d-flex flex-column align-start text-subtitle-1">
|
||||||
@@ -30,12 +30,13 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<feedmodul :feedback="feedback"/>
|
||||||
|
<!-- <v-row>
|
||||||
<v-col class="bg-red">
|
<v-col class="bg-red">
|
||||||
<feedmodul :feedback="feedback"/>
|
<feedmodul :feedback="feedback"/>
|
||||||
{{crit}}
|
{{crit}}
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row> -->
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="d-flex flex-column ">
|
<v-col class="d-flex flex-column ">
|
||||||
<v-row class="flex-grow-0">
|
<v-row class="flex-grow-0">
|
||||||
@@ -75,15 +76,15 @@
|
|||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="bg-black">
|
<v-col class="bg-black">
|
||||||
<div v-for="(val, key) in activuser()" :key = key>
|
|
||||||
{{key}} : {{ val.count }} {{ val.login }}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div v-for="(val, key) in activuser()" :key = key>
|
||||||
|
|
||||||
|
<top-user :users=val/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<v-card class="d-flex" title="Самые активные пользователи">
|
|
||||||
|
|
||||||
|
|
||||||
</v-card>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -116,13 +117,16 @@ import lineGraph from '@/components/graph/line-graph.vue'
|
|||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api'
|
||||||
import Feedmodul from '@/components/UI/aboutportal/feedmodul.vue'
|
import Feedmodul from '@/components/UI/aboutportal/feedmodul.vue'
|
||||||
import DateSelect from '@/components/UI/date-select.vue'
|
import DateSelect from '@/components/UI/date-select.vue'
|
||||||
|
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { lineGraph,
|
components: {
|
||||||
|
lineGraph,
|
||||||
Feedmodul,
|
Feedmodul,
|
||||||
DateSelect },
|
DateSelect,
|
||||||
|
TopUser
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
@@ -227,26 +231,13 @@ setup(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
const visition = () => {
|
const visition = () => {
|
||||||
|
|
||||||
// ${startdate.value}
|
|
||||||
|
|
||||||
axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}&end=${endate.value}`).then(result => {
|
axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}&end=${endate.value}`).then(result => {
|
||||||
visiting.value = result.data.result
|
visiting.value = result.data.result
|
||||||
feedback.value = result.data.feedback
|
feedback.value = result.data.feedback
|
||||||
|
|
||||||
})}
|
})}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
pagecounter()
|
pagecounter()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const countgrupp = () => {
|
const countgrupp = () => {
|
||||||
let us = {}
|
let us = {}
|
||||||
let countall = {now: 0, week: 0, year: 0}
|
let countall = {now: 0, week: 0, year: 0}
|
||||||
@@ -324,9 +315,12 @@ setup(){
|
|||||||
if (!acc[splitname(item.author)]) {
|
if (!acc[splitname(item.author)]) {
|
||||||
acc[splitname(item.author)] = {count: 0, login: ''}
|
acc[splitname(item.author)] = {count: 0, login: ''}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
acc[splitname(item.author)]['fio'] = splitname(item.author)
|
||||||
acc[splitname(item.author)]['count'] += item.count
|
acc[splitname(item.author)]['count'] += item.count
|
||||||
acc[splitname(item.author)]['login'] = item.author.login
|
acc[splitname(item.author)]['login'] = item.author.login
|
||||||
|
acc[splitname(item.author)]['post'] = item.author.post
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -118,4 +118,4 @@ class ShortUserSerializer(serializers.ModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
|
|
||||||
model = DictEmployee
|
model = DictEmployee
|
||||||
fields = ['familyname', 'name', 'parentname', 'id', 'login']
|
fields = ['familyname', 'name', 'parentname', 'id', 'login', 'post', 'department']
|
||||||
Reference in new issue
Block a user