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:
commit
ecd65516cb
2 files changed
+8
-7
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "1.3.1",
|
"version": "1.3.2",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -38,9 +38,9 @@
|
|||||||
<v-card
|
<v-card
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
@click="opendialogWinn(department, getWinnersByDepartment(question).groupedByDepartment[department])"
|
@click="opendialogWinn(department, getWinnersByDepartment(question).groupedByDepartment[department])"
|
||||||
style="max-height: 50vh; overflow-y: auto;">
|
style="height: 30vh; overflow-y: auto;">
|
||||||
<v-card-title>
|
<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-title>
|
||||||
<v-card-subtitle>
|
<v-card-subtitle>
|
||||||
Победитель: {{ winner.employee.fio || winner.name }} 🏆
|
Победитель: {{ winner.employee.fio || winner.name }} 🏆
|
||||||
@@ -162,14 +162,14 @@
|
|||||||
<v-dialog v-model="dialogWinner" max-width="800">
|
<v-dialog v-model="dialogWinner" max-width="800">
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-card-title class="d-flex">
|
<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-spacer></v-spacer>
|
||||||
<v-btn color="red-darken-1" density="compact" icon="mdi-close-thick" size="small" @click="dialogWinner=false" />
|
<v-btn color="red-darken-1" density="compact" icon="mdi-close-thick" size="small" @click="dialogWinner=false" />
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-list>
|
<v-list>
|
||||||
<v-list-item
|
<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"
|
:key="index"
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
@@ -191,9 +191,8 @@
|
|||||||
<small>Должность: {{ answer.employee ? answer.employee.post : '' }}</small>
|
<small>Должность: {{ answer.employee ? answer.employee.post : '' }}</small>
|
||||||
</template>
|
</template>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<v-progress-linear
|
<v-progress-linear
|
||||||
:model-value="getPercentage(answer.count, questions[index])"
|
:model-value="getPercentage(answer.count, questions[activeTab])"
|
||||||
color="teal-darken-4"
|
color="teal-darken-4"
|
||||||
height="13"
|
height="13"
|
||||||
rounded
|
rounded
|
||||||
@@ -308,6 +307,8 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const getPercentage = (count, question) => {
|
const getPercentage = (count, question) => {
|
||||||
|
console.log(question);
|
||||||
|
if (typeof question === 'undefined') return 100
|
||||||
const totalVotes = question.answers.reduce((sum, answer) => sum + answer.count, 0);
|
const totalVotes = question.answers.reduce((sum, answer) => sum + answer.count, 0);
|
||||||
return totalVotes > 0 ? (count / totalVotes) * 100 : 0;
|
return totalVotes > 0 ? (count / totalVotes) * 100 : 0;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user