Исправление crr
This commit is contained in:
1 parent
2415f1fd51
commit
f183ccae5e
5 files changed
+48
-21
No files matched your search
@@ -86,13 +86,11 @@ class DataForStatisticsAPIView(ListAPIView):
|
||||
|
||||
#
|
||||
res = CountVisitor.objects.filter(visitdate__lt = request.GET.get("start"), visitdate__gte=data_start - beetween*2).distinct().values('visitdate','user__user_id')
|
||||
# .annotate(total=Count('user', distinct=True)).order_by('visitdate')
|
||||
per = CountVisitor.objects.filter(Q(visitdate__lte = request.GET.get("end"), visitdate__gte =request.GET.get("start")) | Q(visitdate=date.today()))
|
||||
|
||||
|
||||
# Обратная связь
|
||||
feed = UserComment.objects.all()
|
||||
rating = RatingStatus.objects.values('crit__name', 'crit__ico', 'crit__color', 'rating').filter(usercom__time_create__range=[request.GET.get("start"), data_rating])
|
||||
|
||||
|
||||
d = feed.filter(time_create__range=[request.GET.get("start"), data_rating])
|
||||
return Response({
|
||||
@@ -115,8 +113,7 @@ class DataForStatisticsAPIView(ListAPIView):
|
||||
'period': feed.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='')).latest('time_create'),
|
||||
|
||||
'last_comment': feed.values('time_create').filter(~Q(comment='')).latest('time_create'),
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
@@ -78,6 +78,7 @@ export default {
|
||||
func: (val)=>{return val.count},
|
||||
datakey: "count",
|
||||
tooltips: false ,
|
||||
hidden: true,
|
||||
yAxisID: 'y'
|
||||
},
|
||||
{
|
||||
@@ -89,7 +90,7 @@ export default {
|
||||
data: [],
|
||||
func: (val)=>{return val.unic.length},
|
||||
datakey: "unic",
|
||||
|
||||
hidden: true,
|
||||
customlabel: [],
|
||||
tooltips: true,
|
||||
yAxisID: 'y'
|
||||
@@ -104,7 +105,7 @@ export default {
|
||||
data: [],
|
||||
func: (val, key)=>{ return parseFloat(crrfunc(key).toFixed(2))
|
||||
},
|
||||
hidden: true,
|
||||
|
||||
datakey: "crr",
|
||||
customlabel: [],
|
||||
tooltips: true,
|
||||
@@ -144,6 +145,7 @@ export default {
|
||||
]
|
||||
}
|
||||
const dataf=computed({get() {
|
||||
|
||||
fullpercreate()
|
||||
let data1 = moment(filterStore.date_period.enddate)
|
||||
let data2 = moment(filterStore.date_period.startdate)
|
||||
@@ -153,12 +155,14 @@ export default {
|
||||
if (Object.keys(props.dataLineChart).length>0){
|
||||
res = arrlines
|
||||
res.labels=[]
|
||||
|
||||
for(let [key,val] of Object.entries(props.dataLineChart))
|
||||
|
||||
|
||||
{
|
||||
|
||||
res.datasets.forEach((e) => {
|
||||
e.data.push(e.func(val,key))
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
@@ -185,6 +189,7 @@ export default {
|
||||
}
|
||||
})
|
||||
fullper.value= [...props.period.before, ...arr]
|
||||
console.log(fullper.value, 'fullper.valuefullper.valuefullper.valuefullper.value');
|
||||
|
||||
}
|
||||
|
||||
@@ -194,14 +199,10 @@ export default {
|
||||
|
||||
|
||||
const crrfunc = (date)=>{
|
||||
|
||||
let baseunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >=moment(new Date(date)).subtract(between.value*2, 'd') && new Date(e.visitdate) <= moment(new Date(date)).subtract(between.value, 'd')))
|
||||
let crrunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >=moment(new Date(date)).subtract(between.value, 'd') && new Date(e.visitdate) <= new Date(date)))
|
||||
|
||||
|
||||
|
||||
let crr
|
||||
let baseunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >moment(new Date(date)).subtract(between.value*2, 'd') && new Date(e.visitdate) <= moment(new Date(date)).subtract(between.value, 'd')))
|
||||
let crrunic = unicperson(fullper.value.filter(e => new Date(e.visitdate) >moment(new Date(date)).subtract(between.value, 'd') && new Date(e.visitdate) <= new Date(date)))
|
||||
let bothuser = new Set([...baseunic].filter(element => crrunic.has(element)))
|
||||
|
||||
return baseunic.size ==0?0:bothuser.size*100/baseunic.size
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ export function pagecounter(){
|
||||
.then(result => {
|
||||
|
||||
appStore.countvisitor = result.data
|
||||
console.log(result.data, 'result.dataresult.dataresult.dataresult.dataresult.data');
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +1,41 @@
|
||||
<template>
|
||||
<v-row>
|
||||
<!-- <v-row>
|
||||
<v-col
|
||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
Об инспекции
|
||||
</v-col>
|
||||
|
||||
<!-- <v-col>
|
||||
<line-graph :data="data" :options="options"/>
|
||||
</v-col> -->
|
||||
|
||||
</v-row> -->
|
||||
<v-row no-gutters class="gap flex-column">
|
||||
<v-col class='bg-red w100'>
|
||||
1
|
||||
</v-col>
|
||||
<v-col class="d-flex flex-column">
|
||||
<v-row no-gutters class="gap">
|
||||
<v-col lg=9 class="d-flex flex-column">
|
||||
<v-row no-gutters class="gap flex-column">
|
||||
<v-col class=" d-flex flex-column">
|
||||
<v-row no-gutters class="gap">
|
||||
<v-col class="bg-green">1</v-col>
|
||||
<v-col class="bg-orange">2</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class=" d-flex flex-column">
|
||||
<v-row no-gutters class="gap">
|
||||
<v-col class="bg-purple">1</v-col>
|
||||
<v-col class="bg-green">2</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col class="bg-yellow">2</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col lg=2 class="bg-grey w100">
|
||||
3
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
</v-col>
|
||||
<v-col class="flex-column d-flex w100">
|
||||
<v-row no-gutters class="flex-column gap" >
|
||||
<my-helper :pretext= "alldata.beforperiod" />
|
||||
<v-col v-for="x in cardtotal" :key=x>
|
||||
<card-total :indicator=x />
|
||||
</v-col>
|
||||
@@ -213,6 +214,7 @@ setup(){
|
||||
|
||||
let bothuser = new Set([...periodusers].filter(element => beforperiodusers.has(element)))
|
||||
cardtotal.value.crr.data = bothuser.size*100/beforperiodusers.size
|
||||
console.log(bothuser, beforperiodusers ,'1111111111111')
|
||||
sumtraffic(traffic)
|
||||
dataLineChart.value = traffic
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user