Merge pull request 'develop' (#132) from develop into main

Reviewed-on: https://sulaco.nodered.ru:5333/COD2/PORTAL_COD2/pulls/132
This commit is contained in:
Nukeap committed 2025-10-23 13:38:30 +00:00
commit ecd65516cb
2 files changed
+8 -7

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "front",
"version": "1.3.1",
"version": "1.3.2",
"type": "module",
"scripts": {
"dev": "vite",
+7 -6
View File
@@ -38,9 +38,9 @@
<v-card
class="cursor-pointer"
@click="opendialogWinn(department, getWinnersByDepartment(question).groupedByDepartment[department])"
style="max-height: 50vh; overflow-y: auto;">
style="height: 30vh; overflow-y: auto;">
<v-card-title>
<strong class="text-teal-darken-4">{{ department }}</strong>
<strong class="text-teal-darken-4" style="max-width: 800px; white-space: normal; word-wrap: break-word;">{{ department }}</strong>
</v-card-title>
<v-card-subtitle>
Победитель: {{ winner.employee.fio || winner.name }} 🏆
@@ -162,14 +162,14 @@
<v-dialog v-model="dialogWinner" max-width="800">
<v-card>
<v-card-title class="d-flex">
<strong class="text-teal-darken-4">Результаты голосования: {{ activeDepartment }}</strong>
<strong class="text-teal-darken-4" style="max-width: 800px; white-space: normal; word-wrap: break-word;">Результаты голосования: {{ activeDepartment }}</strong>
<v-spacer></v-spacer>
<v-btn color="red-darken-1" density="compact" icon="mdi-close-thick" size="small" @click="dialogWinner=false" />
</v-card-title>
<v-card-text>
<v-list>
<v-list-item
v-for="(answer, index) in activeDepartmentResults.filter(el => el.count > 0)"
v-for="(answer, index) in activeDepartmentResults.filter(el => el.count > 0).sort((a, b) => b.count - a.count)"
:key="index"
>
<p>
@@ -191,9 +191,8 @@
<small>Должность: {{ answer.employee ? answer.employee.post : '' }}</small>
</template>
</p>
<v-progress-linear
:model-value="getPercentage(answer.count, questions[index])"
:model-value="getPercentage(answer.count, questions[activeTab])"
color="teal-darken-4"
height="13"
rounded
@@ -308,6 +307,8 @@ export default {
};
const getPercentage = (count, question) => {
console.log(question);
if (typeof question === 'undefined') return 100
const totalVotes = question.answers.reduce((sum, answer) => sum + answer.count, 0);
return totalVotes > 0 ? (count / totalVotes) * 100 : 0;
};