Исправление crr
This commit is contained in:
1 parent
2415f1fd51
commit
f183ccae5e
5 files changed
+44
-17
No files matched your search
@@ -86,14 +86,12 @@ 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')
|
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()))
|
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()
|
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])
|
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])
|
d = feed.filter(time_create__range=[request.GET.get("start"), data_rating])
|
||||||
return Response({
|
return Response({
|
||||||
'beforperiod': res,
|
'beforperiod': res,
|
||||||
@@ -116,7 +114,6 @@ class DataForStatisticsAPIView(ListAPIView):
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
'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},
|
func: (val)=>{return val.count},
|
||||||
datakey: "count",
|
datakey: "count",
|
||||||
tooltips: false ,
|
tooltips: false ,
|
||||||
|
hidden: true,
|
||||||
yAxisID: 'y'
|
yAxisID: 'y'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -89,7 +90,7 @@ export default {
|
|||||||
data: [],
|
data: [],
|
||||||
func: (val)=>{return val.unic.length},
|
func: (val)=>{return val.unic.length},
|
||||||
datakey: "unic",
|
datakey: "unic",
|
||||||
|
hidden: true,
|
||||||
customlabel: [],
|
customlabel: [],
|
||||||
tooltips: true,
|
tooltips: true,
|
||||||
yAxisID: 'y'
|
yAxisID: 'y'
|
||||||
@@ -104,7 +105,7 @@ export default {
|
|||||||
data: [],
|
data: [],
|
||||||
func: (val, key)=>{ return parseFloat(crrfunc(key).toFixed(2))
|
func: (val, key)=>{ return parseFloat(crrfunc(key).toFixed(2))
|
||||||
},
|
},
|
||||||
hidden: true,
|
|
||||||
datakey: "crr",
|
datakey: "crr",
|
||||||
customlabel: [],
|
customlabel: [],
|
||||||
tooltips: true,
|
tooltips: true,
|
||||||
@@ -144,6 +145,7 @@ export default {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
const dataf=computed({get() {
|
const dataf=computed({get() {
|
||||||
|
|
||||||
fullpercreate()
|
fullpercreate()
|
||||||
let data1 = moment(filterStore.date_period.enddate)
|
let data1 = moment(filterStore.date_period.enddate)
|
||||||
let data2 = moment(filterStore.date_period.startdate)
|
let data2 = moment(filterStore.date_period.startdate)
|
||||||
@@ -153,9 +155,11 @@ export default {
|
|||||||
if (Object.keys(props.dataLineChart).length>0){
|
if (Object.keys(props.dataLineChart).length>0){
|
||||||
res = arrlines
|
res = arrlines
|
||||||
res.labels=[]
|
res.labels=[]
|
||||||
|
|
||||||
for(let [key,val] of Object.entries(props.dataLineChart))
|
for(let [key,val] of Object.entries(props.dataLineChart))
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
res.datasets.forEach((e) => {
|
res.datasets.forEach((e) => {
|
||||||
e.data.push(e.func(val,key))
|
e.data.push(e.func(val,key))
|
||||||
|
|
||||||
@@ -185,6 +189,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
fullper.value= [...props.period.before, ...arr]
|
fullper.value= [...props.period.before, ...arr]
|
||||||
|
console.log(fullper.value, 'fullper.valuefullper.valuefullper.valuefullper.value');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,14 +199,10 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
const crrfunc = (date)=>{
|
const crrfunc = (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 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 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)))
|
let bothuser = new Set([...baseunic].filter(element => crrunic.has(element)))
|
||||||
|
|
||||||
return baseunic.size ==0?0:bothuser.size*100/baseunic.size
|
return baseunic.size ==0?0:bothuser.size*100/baseunic.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export function pagecounter(){
|
|||||||
.then(result => {
|
.then(result => {
|
||||||
|
|
||||||
appStore.countvisitor = result.data
|
appStore.countvisitor = result.data
|
||||||
console.log(result.data, 'result.dataresult.dataresult.dataresult.dataresult.data');
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,41 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row>
|
<!-- <v-row>
|
||||||
<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"
|
||||||
>
|
>
|
||||||
Об инспекции
|
Об инспекции
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
<!-- <v-col>
|
|
||||||
<line-graph :data="data" :options="options"/>
|
</v-row> -->
|
||||||
</v-col> -->
|
<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>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="flex-column d-flex w100">
|
<v-col class="flex-column d-flex w100">
|
||||||
<v-row no-gutters class="flex-column gap" >
|
<v-row no-gutters class="flex-column gap" >
|
||||||
|
<my-helper :pretext= "alldata.beforperiod" />
|
||||||
<v-col v-for="x in cardtotal" :key=x>
|
<v-col v-for="x in cardtotal" :key=x>
|
||||||
<card-total :indicator=x />
|
<card-total :indicator=x />
|
||||||
</v-col>
|
</v-col>
|
||||||
@@ -213,6 +214,7 @@ setup(){
|
|||||||
|
|
||||||
let bothuser = new Set([...periodusers].filter(element => beforperiodusers.has(element)))
|
let bothuser = new Set([...periodusers].filter(element => beforperiodusers.has(element)))
|
||||||
cardtotal.value.crr.data = bothuser.size*100/beforperiodusers.size
|
cardtotal.value.crr.data = bothuser.size*100/beforperiodusers.size
|
||||||
|
console.log(bothuser, beforperiodusers ,'1111111111111')
|
||||||
sumtraffic(traffic)
|
sumtraffic(traffic)
|
||||||
dataLineChart.value = traffic
|
dataLineChart.value = traffic
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user