реф результатов

This commit is contained in:
Denzel committed 2025-01-24 14:07:19 +03:00
1 parent 12150e738a
commit 59eb528db8
2 files changed
+12 -11

No files matched your search

+5 -1
View File
@@ -35,7 +35,10 @@
v-for="(winner, department) in getWinnersByDepartment(question).winnersByDepartment" v-for="(winner, department) in getWinnersByDepartment(question).winnersByDepartment"
:key="department" :key="department"
> >
<v-card class="cursor-pointer" @click="opendialogWinn(department, getWinnersByDepartment(question).groupedByDepartment[department])" style="max-height: 50vh; overflow-y: auto;"> <v-card
class="cursor-pointer"
@click="opendialogWinn(department, getWinnersByDepartment(question).groupedByDepartment[department])"
style="max-height: 50vh; overflow-y: auto;">
<v-card-title> <v-card-title>
<strong class="text-teal-darken-4">{{ department }}</strong> <strong class="text-teal-darken-4">{{ department }}</strong>
</v-card-title> </v-card-title>
@@ -181,6 +184,7 @@
@click.stop="opendialog(answer)"/> @click.stop="opendialog(answer)"/>
<strong class="ml-4">{{ answer.employee ? answer.employee.fio : answer.name }}</strong>: <strong class="ml-4">{{ answer.employee ? answer.employee.fio : answer.name }}</strong>:
{{ answer.count }} {{ answer.count }}
{{ voteCount(answer.count) }}
<template v-if="answer.employee"> <template v-if="answer.employee">
<br/> <br/>
<small>Отдел: {{ answer.employee ? answer.employee.department : '' }}</small> <small>Отдел: {{ answer.employee ? answer.employee.department : '' }}</small>
+7 -10
View File
@@ -7,12 +7,12 @@
align="center"> align="center">
<v-tab v-for="x in tabs" :key="x.value" :value="x.value">{{ x.text }}</v-tab> <v-tab v-for="x in tabs" :key="x.value" :value="x.value">{{ x.text }}</v-tab>
<v-tab v-if="accountStore.user.is_staff" value="constructor">Создать новое голосование</v-tab> <v-tab v-if="accountStore.user.is_staff" value="constructor">Создать новое голосование</v-tab>
</v-tabs> </v-tabs>
</v-col> </v-col>
<v-col class="pa-0 overflow-hidden"> <v-col class="pa-0 overflow-hidden">
<v-window v-model="currentTab" class="h-100"> <v-window v-model="currentTab" class="h-100">
<!-- Текущие голосования --> <!-- Текущие голосования -->
<v-tabs-window-item v-for="x in ['active','completed']" :value="x" class="h-100 overflow-auto"> <v-tabs-window-item v-for="x in ['active','completed']" :value="x" class="h-100 overflow-auto">
@@ -40,7 +40,7 @@
<VoteConstructor @updating="updating" ref="constructor"/> <VoteConstructor @updating="updating" ref="constructor"/>
</v-tabs-window-item> </v-tabs-window-item>
</v-window> </v-window>
<!-- Модальные окна --> <!-- Модальные окна -->
<v-dialog v-model="voteModal" @click:outside="closeModal"> <v-dialog v-model="voteModal" @click:outside="closeModal">
<CurrentVote :data="res" @closer="closeModal"/> <CurrentVote :data="res" @closer="closeModal"/>
@@ -49,9 +49,6 @@
<v-dialog v-model="resultsModal" max-width="1200px" @click:outside="closeModal"> <v-dialog v-model="resultsModal" max-width="1200px" @click:outside="closeModal">
<v-card> <v-card>
<VoteResult :data="result" @closer="closeModal" /> <VoteResult :data="result" @closer="closeModal" />
<v-card-actions>
<v-btn @click="closeModal">Закрыть</v-btn>
</v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
</v-col> </v-col>
@@ -82,7 +79,7 @@ export default {
const tabs = [ const tabs = [
{value: "active", text: 'Текущие голосования'}, {value: "active", text: 'Текущие голосования'},
{value: "completed", text: 'Завершенные голосования'}, {value: "completed", text: 'Завершенные голосования'},
] ]
const currentTab = ref("active"); const currentTab = ref("active");
@@ -115,7 +112,7 @@ export default {
} catch (error) { } catch (error) {
console.error("Ошибка при загрузке данных голосования:", error); console.error("Ошибка при загрузке данных голосования:", error);
// res.value = {}; // res.value = {};
throw error; throw error;
} }
}; };
@@ -173,7 +170,7 @@ export default {
if (constructor.value !== null) { if (constructor.value !== null) {
constructor.value.resetForm() constructor.value.resetForm()
} }
} }
}) })
watch( watch(