Русская локальность
This commit is contained in:
1 parent
34c5dd79ff
commit
c6ce03187e
6 files changed
+26
-14
No files matched your search
@@ -3,12 +3,10 @@
|
|||||||
class="text-center"
|
class="text-center"
|
||||||
height="200px"
|
height="200px"
|
||||||
>
|
>
|
||||||
<v-card-title class="pb-0 pt-2">
|
<v-card-title class="text-uppercase">
|
||||||
Количество Посетителей
|
Посещаемость портала
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-subtitle>
|
|
||||||
(уникальные/всего)
|
|
||||||
</v-card-subtitle>
|
|
||||||
<v-card-text class="pl-0">
|
<v-card-text class="pl-0">
|
||||||
<v-list density="compact" class="text-start text-subtitle-1 pt-0">
|
<v-list density="compact" class="text-start text-subtitle-1 pt-0">
|
||||||
<v-list-item >
|
<v-list-item >
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setup(props, {emit}) {
|
setup(props, {emit}) {
|
||||||
|
|
||||||
const menudate = ref(false)
|
const menudate = ref(false)
|
||||||
|
|||||||
@@ -35,3 +35,4 @@ registerPlugins(app)
|
|||||||
|
|
||||||
app.mount('#app')
|
app.mount('#app')
|
||||||
|
|
||||||
|
|
||||||
@@ -2,9 +2,14 @@
|
|||||||
import '@mdi/font/css/materialdesignicons.css'
|
import '@mdi/font/css/materialdesignicons.css'
|
||||||
import 'vuetify/styles'
|
import 'vuetify/styles'
|
||||||
|
|
||||||
|
|
||||||
import { createVuetify } from 'vuetify'
|
import { createVuetify } from 'vuetify'
|
||||||
|
import { ru } from 'vuetify/locale'
|
||||||
|
|
||||||
export default createVuetify({
|
export default createVuetify({
|
||||||
|
locale: {
|
||||||
|
messages: { ru },
|
||||||
|
},
|
||||||
theme: {
|
theme: {
|
||||||
defaultTheme: 'light'
|
defaultTheme: 'light'
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ export default {
|
|||||||
setup(){
|
setup(){
|
||||||
const visiting = ref([])
|
const visiting = ref([])
|
||||||
const feedback = ref([])
|
const feedback = ref([])
|
||||||
|
const staff = ref(0)
|
||||||
const countvising = ref({now: [new Set(), 0], year: [new Set(), 0]})
|
const countvising = ref({now: [new Set(), 0], year: [new Set(), 0]})
|
||||||
const crit = ref([])
|
const crit = ref([])
|
||||||
const startdate =ref(format2(new Date(new Date().getFullYear(), 0, 1)))
|
const startdate =ref(format2(new Date(new Date().getFullYear(), 0, 1)))
|
||||||
@@ -201,6 +202,7 @@ setup(){
|
|||||||
|
|
||||||
let end = format2(new Date(endate.value).setDate(new Date(endate.value).getDate() + 1))
|
let end = format2(new Date(endate.value).setDate(new Date(endate.value).getDate() + 1))
|
||||||
axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}&end=${end}`).then(result => {
|
axiosApiInstance.get(`api/watcher/counter/?start=${startdate.value}&end=${end}`).then(result => {
|
||||||
|
staff.value = result.data.staff
|
||||||
visiting.value = result.data.result
|
visiting.value = result.data.result
|
||||||
feedback.value = result.data.feedback
|
feedback.value = result.data.feedback
|
||||||
})}
|
})}
|
||||||
@@ -214,7 +216,7 @@ setup(){
|
|||||||
const countgrupp = () => {
|
const countgrupp = () => {
|
||||||
|
|
||||||
let us = {}
|
let us = {}
|
||||||
let countall = {now: [new Set(), 0], year: [new Set(), 0]}
|
// let countall = {now: [new Set(), 0], year: [new Set(), 0]}
|
||||||
|
|
||||||
|
|
||||||
const groupedData =
|
const groupedData =
|
||||||
@@ -227,16 +229,16 @@ setup(){
|
|||||||
|
|
||||||
acc[item.pages]['year'][0].add(item.author.id)
|
acc[item.pages]['year'][0].add(item.author.id)
|
||||||
acc[item.pages]['year'][1] += item.count
|
acc[item.pages]['year'][1] += item.count
|
||||||
countall['year'][0].add(item.author.id)
|
countvising.value['year'][0].add(item.author.id)
|
||||||
countall['year'][1] += item.count
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (item.visitdate == format2(endate.value)) {
|
if (item.visitdate == format2(endate.value)) {
|
||||||
acc[item.pages]['now'][0].add(item.author.id)
|
acc[item.pages]['now'][0].add(item.author.id)
|
||||||
acc[item.pages]['now'][1] += item.count
|
acc[item.pages]['now'][1] += item.count
|
||||||
countall['now'][0].add(item.author.id)
|
countvising.value['now'][0].add(item.author.id)
|
||||||
countall['now'][1] += item.count
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,16 +264,21 @@ setup(){
|
|||||||
})
|
})
|
||||||
|
|
||||||
crit.value = arrcount.slice(0, 3)
|
crit.value = arrcount.slice(0, 3)
|
||||||
countvising.value=countall
|
|
||||||
|
|
||||||
return acc
|
return acc
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
|
countvising.value['now'][1] = percentageStaff(countvising.value['now'][0])
|
||||||
|
countvising.value['year'][1] = percentageStaff(countvising.value['year'][0])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return groupedData
|
return groupedData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const percentageStaff = (customers) => {
|
||||||
|
return Math.round((customers.size*100)/staff.value)+'%'
|
||||||
|
}
|
||||||
|
|
||||||
const periodname = () => {
|
const periodname = () => {
|
||||||
let datas = weekstart(endate.value)
|
let datas = weekstart(endate.value)
|
||||||
|
|||||||
@@ -19,16 +19,15 @@ class Counter(ListAPIView):
|
|||||||
serializer_class = CountSerializer
|
serializer_class = CountSerializer
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
|
# Посещаемость портала
|
||||||
res = CountVisitor.objects.filter(visitdate__range=[request.GET.get("start"), request.GET.get("end")]).annotate(Sum('count'))
|
res = CountVisitor.objects.filter(visitdate__range=[request.GET.get("start"), request.GET.get("end")]).annotate(Sum('count'))
|
||||||
|
|
||||||
result = CountSerializer(res, many=True).data
|
result = CountSerializer(res, many=True).data
|
||||||
|
|
||||||
|
|
||||||
# Обратная связь
|
# Обратная связь
|
||||||
feed = RatingStatus.objects.filter(usercom__time_create__range=[request.GET.get("start"), request.GET.get("end")])
|
feed = RatingStatus.objects.filter(usercom__time_create__range=[request.GET.get("start"), request.GET.get("end")])
|
||||||
feedback = RatingStatusStatSerializer(feed, many=True).data
|
feedback = RatingStatusStatSerializer(feed, many=True).data
|
||||||
|
|
||||||
return Response({'result':result, 'feedback':feedback})
|
return Response({'result':result, 'feedback':feedback, 'staff':DictEmployee.objects.filter(deleted=0).count()})
|
||||||
|
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
|
|||||||
Reference in new issue
Block a user