Функция
This commit is contained in:
1 parent
bf93e12780
commit
b391492d86
5 files changed
+69
-34
No files matched your search
@@ -1,11 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<pattern-card-feed
|
<!-- :title="'Оставлено комментариев'" -->
|
||||||
:title="'Оставлено комментариев'"
|
<pattern-card-feed
|
||||||
>
|
:title="title"
|
||||||
<template v-slot:filling_feedback>
|
>
|
||||||
dsd
|
<template v-slot:filling_feedback>
|
||||||
</template>
|
<v-row no-gutters class="flex-column gap">
|
||||||
</pattern-card-feed>
|
<v-col>
|
||||||
|
<v-table density="compact">
|
||||||
|
<thead>
|
||||||
|
<tr >
|
||||||
|
<th class="text-center">
|
||||||
|
всего
|
||||||
|
</th>
|
||||||
|
<th class="text-center">
|
||||||
|
за период
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</v-table>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
</template>
|
||||||
|
</pattern-card-feed>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -13,7 +32,14 @@ import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
|
|||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
PatternCardFeed,
|
PatternCardFeed,
|
||||||
}
|
},
|
||||||
|
props: {
|
||||||
|
|
||||||
|
data: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,36 +1,43 @@
|
|||||||
<template>
|
<template>
|
||||||
<pattern-card
|
<div v-if="!feedback">hui</div>
|
||||||
|
<pattern-card v-else
|
||||||
:title="'Обратная связь'"
|
:title="'Обратная связь'"
|
||||||
:ico="'mdi-comment-multiple-outline'"
|
:ico="'mdi-comment-multiple-outline'"
|
||||||
>
|
>
|
||||||
<template v-slot:filling>
|
<template v-slot:filling>
|
||||||
<v-row no-gutters class="flex-column gap">
|
<v-row no-gutters class="flex-column gap">
|
||||||
<v-col lg=3 class="w100">
|
<v-col lg=3 class="w100">
|
||||||
<star-like
|
<star-like
|
||||||
:criteria=feedback.criteria
|
:criteria=feedback.criteria
|
||||||
:ratings=feedback.criteria
|
:ratings=feedback.criteria
|
||||||
/>
|
/>
|
||||||
</v-col>
|
|
||||||
<v-col lg=3 class="bg-blue w100">
|
|
||||||
<card-feedback/>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
|
<v-col lg=2 class="w100">
|
||||||
|
<card-feedback
|
||||||
|
:title="'Оставлено комментариев'"
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- <card-feedback
|
||||||
|
:title="'Оставлено комментариев'"
|
||||||
|
>
|
||||||
|
<template v-slot:tbody_stat>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{feedback.data.score.all}}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{feedback.data.score.period}}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{{format1(feedback.last_comment.time_create)}}
|
||||||
|
</template>
|
||||||
|
</card-feedback> -->
|
||||||
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
<my-helper :pretext="feedback"/>
|
<my-helper :pretext="feedback"/>
|
||||||
<!-- <v-card class="pa-1 ">
|
|
||||||
|
|
||||||
<star-like
|
|
||||||
v-if="feedback.criteria.length>0"
|
|
||||||
:criteria=feedback.criteria
|
|
||||||
:ratings=feedback.criteria
|
|
||||||
/>
|
|
||||||
<v-row v-else class="h-100">
|
|
||||||
<v-col class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">
|
|
||||||
Оценок за выбранный период нет
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-card> -->
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</pattern-card>
|
</pattern-card>
|
||||||
@@ -76,7 +83,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import {splitname} from '@/utils/universal_functions'
|
import {format1} from '@/utils/universal_functions'
|
||||||
|
|
||||||
import starLike from '@/components/UI/feedback/star-like.vue'
|
import starLike from '@/components/UI/feedback/star-like.vue'
|
||||||
import CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
import CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
||||||
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
||||||
@@ -104,7 +112,7 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
format1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,8 @@
|
|||||||
<v-row no-gutters class="flex-column gap">
|
<v-row no-gutters class="flex-column gap">
|
||||||
<v-col lg=1 class=" bg-blue-grey-darken-1 w100">
|
<v-col lg=1 class=" bg-blue-grey-darken-1 w100">
|
||||||
{{title}}
|
{{title}}
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col class="d-flex flex-column">
|
||||||
<slot name="filling_feedback"></slot>
|
<slot name="filling_feedback"></slot>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
<pattern-card-feed
|
<pattern-card-feed
|
||||||
v-else
|
v-else
|
||||||
:title="'Оставлено комментариев'"
|
:title="'Средняя оценка'"
|
||||||
>
|
>
|
||||||
<template v-slot:filling_feedback>
|
<template v-slot:filling_feedback>
|
||||||
<v-row
|
<v-row
|
||||||
|
|||||||
@@ -66,10 +66,12 @@ class Counter(ListAPIView):
|
|||||||
'criteria': list(rating.values('crit__name').annotate(ratings=Avg('rating'), name=F('crit__name'), ico=F('crit__ico'), color=F('crit__color')).values('ratings', 'name', 'ico', 'color')),
|
'criteria': list(rating.values('crit__name').annotate(ratings=Avg('rating'), name=F('crit__name'), ico=F('crit__ico'), color=F('crit__color')).values('ratings', 'name', 'ico', 'color')),
|
||||||
'data': {
|
'data': {
|
||||||
'score': {
|
'score': {
|
||||||
|
'title': 'Оставлено комментариев',
|
||||||
'all': feed.values_list('comment', flat=True).count(),
|
'all': feed.values_list('comment', flat=True).count(),
|
||||||
'period': feed.values_list('comment', flat=True).filter(time_create__range=[request.GET.get("start"), request.GET.get("end")]).count()
|
'period': feed.values_list('comment', flat=True).filter(time_create__range=[request.GET.get("start"), request.GET.get("end")]).count()
|
||||||
},
|
},
|
||||||
'comment': {
|
'comment': {
|
||||||
|
'title': 'Поставлено оценок',
|
||||||
'all': feed.values_list('comment', flat=True).filter(~Q(comment='')).count(),
|
'all': feed.values_list('comment', flat=True).filter(~Q(comment='')).count(),
|
||||||
'period': feed.values_list('comment', flat=True).filter(Q(time_create__range=[request.GET.get("start"), request.GET.get("end")]) & ~Q(comment='')).count()
|
'period': feed.values_list('comment', flat=True).filter(Q(time_create__range=[request.GET.get("start"), request.GET.get("end")]) & ~Q(comment='')).count()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user