Сбор завершен
This commit is contained in:
1 parent
97e0eeb701
commit
74b360e5fe
4 files changed
+23
-19
No files matched your search
@@ -29,7 +29,7 @@
|
||||
lg=6
|
||||
>
|
||||
<v-rating
|
||||
v-model="message[key].rating"
|
||||
v-model="message[key].ratings"
|
||||
:hover="typeof(key) == 'number'"
|
||||
half-increments
|
||||
:readonly="how==''?true:false"
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
default: {}
|
||||
},
|
||||
|
||||
rating: {
|
||||
ratings: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
@@ -74,8 +74,8 @@ export default {
|
||||
|
||||
// console.log(useDebugValue(getCurrentComponent().proxy.$options.name) , 'route.path');
|
||||
const message = computed({
|
||||
get: () => props.rating,
|
||||
set: (value) => emit('update:rating', value)
|
||||
get: () => props.ratings,
|
||||
set: (value) => emit('update:ratings', value)
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -80,7 +80,7 @@ export default {
|
||||
feedbackdata.value = data.data
|
||||
if (feedbackdata.value.nowrating.length == 0) {
|
||||
for (let x of feedbackdata.value.basecrit) {
|
||||
feedbackdata.value.nowrating.push({rating: x.rating, crit: x.id, id: null})
|
||||
feedbackdata.value.nowrating.push({ratings: x.rating, crit: x.id, id: null})
|
||||
}
|
||||
}
|
||||
if (feedbackdata.value.nowcomment === null) {
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
<v-col class="w100 ">
|
||||
<v-row no-gutters class="h-100 gap">
|
||||
<v-col lg=2 class="bg-green">
|
||||
visiting- (все данные)
|
||||
|
||||
{{dataIndicators}}
|
||||
<my-helper :pretext="feedback"/>
|
||||
<!-- <my-helper :pretext="feedback"/> -->
|
||||
</v-col>
|
||||
<v-col lg=4 class="d-flex flex-column">
|
||||
<rating-page :pages_count=pages_count />
|
||||
@@ -31,7 +31,8 @@
|
||||
/>
|
||||
|
||||
</v-col>
|
||||
<v-col class="bg-red">4 </v-col>
|
||||
<v-col class="bg-red">
|
||||
{{feedback}} </v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
|
||||
+14
-11
@@ -7,7 +7,7 @@ from rest_framework.response import Response
|
||||
from django.views.generic import ListView
|
||||
from .serializers import *
|
||||
from datetime import date, datetime, timedelta
|
||||
from django.db.models import Sum, Q, Count
|
||||
from django.db.models import Sum, Q, Count, Avg, F
|
||||
from userauth.models import *
|
||||
from feedback.models import *
|
||||
from feedback.serializers import *
|
||||
@@ -46,24 +46,27 @@ class Counter(ListAPIView):
|
||||
ppv = perioddata.count()
|
||||
|
||||
# Обратная связь
|
||||
feed = RatingStatus.objects.all()
|
||||
k = feed.values_list('usercom__comment', flat=True).filter(Q(usercom__time_create__range=[request.GET.get("start"), request.GET.get("end")]) & ~Q(usercom__comment='')).distinct().count()
|
||||
print(k, '------------------------------------------------')
|
||||
feed = UserComment.objects.all()
|
||||
rating = RatingStatus.objects.values('crit__name', 'crit__ico', 'crit__color', 'rating').filter(usercom__time_create__range=[request.GET.get("start"), request.GET.get("end")])
|
||||
|
||||
# print(avgrating, '------------------------------------------------')
|
||||
|
||||
return Response({'result':CountSerializer(res, many=True).data,
|
||||
# 'today':CountSerializer(nowdate, many=True).data,
|
||||
# 'today':CountSerializer(nowdate, many=True).data, .aggregate(res=Avg('rating'))
|
||||
'feedback': {
|
||||
'criteria': {},
|
||||
'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': {
|
||||
'all': 0,
|
||||
'period': 0
|
||||
'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': {
|
||||
'all': 0,
|
||||
'period': 0
|
||||
'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()
|
||||
}
|
||||
}
|
||||
},
|
||||
'last_comment': feed.values('time_create').filter(~Q(comment='')).earliest('time_create'),
|
||||
# 'avg_score': round(avgrating['res'], 2)
|
||||
},
|
||||
'for_formulas': {
|
||||
'staff': DictEmployee.objects.filter(deleted=0).count(),
|
||||
|
||||
Reference in new issue
Block a user