Функция
This commit is contained in:
1 parent
bf93e12780
commit
b391492d86
5 files changed
+70
-35
No files matched your search
@@ -1,11 +1,30 @@
|
||||
<template>
|
||||
<pattern-card-feed
|
||||
:title="'Оставлено комментариев'"
|
||||
>
|
||||
<template v-slot:filling_feedback>
|
||||
dsd
|
||||
</template>
|
||||
</pattern-card-feed>
|
||||
<!-- :title="'Оставлено комментариев'" -->
|
||||
<pattern-card-feed
|
||||
:title="title"
|
||||
>
|
||||
<template v-slot:filling_feedback>
|
||||
<v-row no-gutters class="flex-column gap">
|
||||
<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>
|
||||
|
||||
<script>
|
||||
@@ -13,7 +32,14 @@ import PatternCardFeed from '@/components/UI/aboutportal/pattern-card-feed.vue'
|
||||
export default {
|
||||
components: {
|
||||
PatternCardFeed,
|
||||
}
|
||||
},
|
||||
props: {
|
||||
|
||||
data: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,37 +1,44 @@
|
||||
<template>
|
||||
<pattern-card
|
||||
<div v-if="!feedback">hui</div>
|
||||
<pattern-card v-else
|
||||
:title="'Обратная связь'"
|
||||
:ico="'mdi-comment-multiple-outline'"
|
||||
>
|
||||
<template v-slot:filling>
|
||||
<v-row no-gutters class="flex-column gap">
|
||||
<v-col lg=3 class="w100">
|
||||
<star-like
|
||||
:criteria=feedback.criteria
|
||||
:ratings=feedback.criteria
|
||||
/>
|
||||
<star-like
|
||||
:criteria=feedback.criteria
|
||||
:ratings=feedback.criteria
|
||||
/>
|
||||
</v-col>
|
||||
<v-col lg=3 class="bg-blue w100">
|
||||
<card-feedback/>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
</pattern-card>
|
||||
<!-- <v-row no-gutters class="h-100">
|
||||
@@ -76,7 +83,8 @@
|
||||
|
||||
<script>
|
||||
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 CardTotal from '@/components/UI/aboutportal/card-total.vue'
|
||||
import TopUser from '@/components/UI/aboutportal/top-user.vue'
|
||||
@@ -104,7 +112,7 @@ export default {
|
||||
|
||||
|
||||
return {
|
||||
|
||||
format1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@
|
||||
<v-row no-gutters class="flex-column gap">
|
||||
<v-col lg=1 class=" bg-blue-grey-darken-1 w100">
|
||||
{{title}}
|
||||
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-col class="d-flex flex-column">
|
||||
<slot name="filling_feedback"></slot>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</v-row>
|
||||
<pattern-card-feed
|
||||
v-else
|
||||
:title="'Оставлено комментариев'"
|
||||
:title="'Средняя оценка'"
|
||||
>
|
||||
<template v-slot:filling_feedback>
|
||||
<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')),
|
||||
'data': {
|
||||
'score': {
|
||||
'title': 'Оставлено комментариев',
|
||||
'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()
|
||||
},
|
||||
'comment': {
|
||||
'title': 'Поставлено оценок',
|
||||
'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()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user