awd
This commit is contained in:
1 parent
7f7b30fa8c
commit
83246b9cbb
4 files changed
+38
-37
No files matched your search
@@ -85,7 +85,7 @@ class GetNotVoteBst(APIView):
|
||||
class GetVoteInfo(APIView):
|
||||
def get(self, request):
|
||||
print(request.user)
|
||||
allcod = DictEmplyeeR.objects.filter(id_dict_employee__deleted=0)
|
||||
allcod = DictEmplyeeR.objects.filter( ~Q(id_dict_department=1),id_dict_employee__deleted=0)
|
||||
|
||||
# try:
|
||||
realdep = allcod.get(id_dict_employee__login=request.user)
|
||||
|
||||
@@ -1,31 +1,33 @@
|
||||
<template>
|
||||
<v-row justify="center" align="center">
|
||||
<v-col justify="center" align="center" class="ma-3">
|
||||
<v-card width="700" height="820" class="elevation-12">
|
||||
<v-row class="pa-2">
|
||||
<v-col cols="6" class=''>
|
||||
|
||||
<v-col>
|
||||
|
||||
<v-card class="mb-2" color="teal-darken-1" elevation="0">
|
||||
<v-card-title>Голосование</v-card-title>
|
||||
<!-- <v-card-title>Голосование</v-card-title> -->
|
||||
<v-card-title color="teal-darken-1">«Мой коллега самый лучший»</v-card-title>
|
||||
</v-card>
|
||||
<v-card color="teal-darken-1" class="ma-2">
|
||||
<v-card-title>Процент проголосовавших</v-card-title>
|
||||
</v-card>
|
||||
<v-card elevation="0">
|
||||
<v-card-text class="perc-voted">
|
||||
|
||||
<v-card class="px-2">
|
||||
<v-card-title class="bg-teal-darken-1">Процент проголосовавших</v-card-title>
|
||||
<v-card-text class="text-h6 pa-1">
|
||||
{{ perc_best }}%
|
||||
</v-card-text>
|
||||
|
||||
</v-card>
|
||||
<v-card color="teal-darken-1" class="mb-2">
|
||||
<v-card-title>Лидер номинации</v-card-title>
|
||||
|
||||
<v-card class="mb-2">
|
||||
<v-card-title class="bg-teal-darken-1">Лидер номинации</v-card-title>
|
||||
</v-card>
|
||||
<v-card class="scroll-leaders" elevation="0">
|
||||
<v-card v-for="(employees, department) in max_bst" :key="department" elevation="0">
|
||||
<v-card-title>{{ department }}</v-card-title>
|
||||
<div v-for="employee in employees" :key="employee.name">
|
||||
<div v-for="employee in employees.slice(0,3)" :key="employee.name">
|
||||
{{ employee.cand_name }} - {{ employee.total }}
|
||||
</div>
|
||||
</v-card>
|
||||
</v-card>
|
||||
</v-col>
|
||||
<v-card color="teal-darken-1" class="ma-2">
|
||||
<v-card-title>ФИО не участвовавших в голосовании</v-card-title>
|
||||
</v-card>
|
||||
@@ -40,27 +42,26 @@
|
||||
</v-card>
|
||||
</v-card>
|
||||
|
||||
</v-card>
|
||||
|
||||
</v-col>
|
||||
<v-col justify="center" align="center">
|
||||
<v-card width="700" height="820" class="elevation-12">
|
||||
<v-card class="mb-2" color="teal-darken-1" elevation="0">
|
||||
<v-card-title>Голосование</v-card-title>
|
||||
<!-- <v-card-title>Голосование</v-card-title> -->
|
||||
<v-card-title>«Хочу сказать Спасибо!»</v-card-title>
|
||||
</v-card>
|
||||
<v-card color="teal-darken-1" class="ma-2">
|
||||
<v-card-title>Процент проголосовавших</v-card-title>
|
||||
</v-card>
|
||||
<v-card elevation="0">
|
||||
<v-card-text class="perc-voted">
|
||||
<v-card class="px-2">
|
||||
<v-card-title class="bg-teal-darken-1">Процент проголосовавших</v-card-title>
|
||||
<v-card-text class="text-h6 pa-1">
|
||||
{{ perc_thanks }}%
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<v-card color="teal-darken-1" class="mb-2">
|
||||
|
||||
<v-card color="teal-darken-1" >
|
||||
<v-card-title>Лидер номинации</v-card-title>
|
||||
</v-card>
|
||||
<v-card class="scroll-leaders pt-4" elevation="0">
|
||||
<div v-for="leader in max_thn">
|
||||
<div v-for="leader in max_thn.slice(0,3)">
|
||||
{{ leader.cand_name }} - {{ leader.total }}
|
||||
</div>
|
||||
</v-card>
|
||||
@@ -156,7 +157,7 @@ export default {
|
||||
|
||||
})
|
||||
|
||||
return nob.sort((a,b)=>{return a.total-b.total})
|
||||
return nob.sort((a,b)=>{return b.total-a.total})
|
||||
|
||||
}
|
||||
})
|
||||
@@ -175,7 +176,7 @@ export default {
|
||||
nob[key].push(n)
|
||||
}
|
||||
})
|
||||
nob[key]=nob[key].sort((a,b)=>{return a.total-b.total})
|
||||
nob[key]=nob[key].sort((a,b)=>{return b.total-a.total})
|
||||
|
||||
}
|
||||
|
||||
@@ -233,7 +234,7 @@ export default {
|
||||
nob[key].push(n)
|
||||
|
||||
})
|
||||
nob[key]=nob[key].sort((a,b)=>{return a.total-b.total})
|
||||
nob[key]=nob[key].sort((a,b)=>{return b.total-a.total})
|
||||
|
||||
}
|
||||
return nob
|
||||
@@ -324,7 +325,5 @@ export default {
|
||||
height: 378px;
|
||||
}
|
||||
|
||||
.perc-voted {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<v-card id="scroll-window-chekbox" height="300" elevation="0">
|
||||
<!-- Форма голосования -->
|
||||
|
||||
<v-virtual-scroll :items="persons" :item-height="40">
|
||||
<v-virtual-scroll :items="type_fetch=='best'?persons.filter(e=>e.post!='Начальник отдела'):persons" :item-height="40">
|
||||
<template v-slot:default="{ item }">
|
||||
<v-checkbox v-model="vote" :id="item.fio" :value="item.fio" :label="item.fio" required />
|
||||
</template>
|
||||
|
||||
@@ -159,9 +159,9 @@
|
||||
<v-col v-if="admin_panel" justify="center" align="center" cols="6" class=" pa-0">
|
||||
<v-dialog>
|
||||
<template v-slot:activator="{ props: activatorProps }">
|
||||
<v-btn v-bind="activatorProps "
|
||||
<v-btn v-bind="activatorProps " variant='plain'
|
||||
class="procent_card_font pa-0">
|
||||
<span>{{ Math.round(voteresults.usersvotedbest.length*100/(mydepartment.length+1))}}%</span>
|
||||
{{ Math.round(voteresults.usersvotedbest.length*100/(mydepartment.length+1))}}%
|
||||
</v-btn>
|
||||
</template>
|
||||
<template v-slot:default="{ isActive }">
|
||||
@@ -181,14 +181,15 @@
|
||||
</v-dialog>
|
||||
</v-col>
|
||||
<v-col v-else justify="center" align="center" cols="6" class="procent_card_font pa-0">
|
||||
<span>{{ Math.round(voteresults.usersvotedbest.length*100/(mydepartment.length+1))}}%</span>
|
||||
|
||||
<span>{{ (Math.round(voteresults.usersvotedbest.filter(e=>e.department_user==mydepartment[0].department).length )*100/(mydepartment.length+1))}}%</span>
|
||||
|
||||
</v-col>
|
||||
<v-col v-if="admin_panel" justify="center" align="center" cols="6" class=" pa-0">
|
||||
<v-dialog>
|
||||
<template v-slot:activator="{ props: activatorProps }">
|
||||
<v-btn v-bind="activatorProps "
|
||||
class="procent_card_font pa-0">
|
||||
<v-btn v-bind="activatorProps " variant='plain'
|
||||
class="procent_card_font pa-0" >
|
||||
<span>{{ Math.round(voteresults.uservotedthanks.length*100/(allsorted.length+1))}}%</span>
|
||||
</v-btn>
|
||||
</template>
|
||||
@@ -294,7 +295,7 @@ export default {
|
||||
isFlipped2.value = !isFlipped2.value;
|
||||
}
|
||||
|
||||
if (['9966-00-134', '9966-00-141','9966-00-011','9966-00-001'].includes(account_login.user.login)) {
|
||||
if (['9966-00-134', '9966-00-141','9966-00-011','9966-00-125'].includes(account_login.user.login)) {
|
||||
admin_panel = true;
|
||||
|
||||
}
|
||||
@@ -330,7 +331,8 @@ export default {
|
||||
})
|
||||
const mydepartment = computed({
|
||||
get(){
|
||||
let ac= allcod.value.filter(e=> e.id_dict_department===myrealdep.value.id_dict_department && e.id!=myrealdep.value.id)
|
||||
console.log(allcod.value);
|
||||
let ac= allcod.value.filter(e=> e.id_dict_department===myrealdep.value.id_dict_department && e.id!=myrealdep.value.id )
|
||||
return ac.sort((a,b)=>{if(b.fio>a.fio) return -1
|
||||
else if(b.fio<a.fio)return 1
|
||||
return 0
|
||||
|
||||
Reference in new issue
Block a user