diff --git a/src/front/src/components/UI/fiousercard/infoUserCard.vue b/src/front/src/components/UI/fiousercard/infoUserCard.vue index 7d135ba78..dcb9a4b36 100644 --- a/src/front/src/components/UI/fiousercard/infoUserCard.vue +++ b/src/front/src/components/UI/fiousercard/infoUserCard.vue @@ -67,7 +67,7 @@ Закрыть diff --git a/src/front/src/components/vote/NonVoteHappy.vue b/src/front/src/components/vote/NonVoteHappy.vue new file mode 100644 index 000000000..213e2adca --- /dev/null +++ b/src/front/src/components/vote/NonVoteHappy.vue @@ -0,0 +1,143 @@ + + + + + + + + + + + Все проголосовали!тех, кто не голосовал нет + + + + + + + + diff --git a/src/front/src/components/vote/NonVoteSad.vue b/src/front/src/components/vote/NonVoteSad.vue new file mode 100644 index 000000000..9b5ea1715 --- /dev/null +++ b/src/front/src/components/vote/NonVoteSad.vue @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + diff --git a/src/front/src/components/vote/VoteCard.vue b/src/front/src/components/vote/VoteCard.vue index 9a6422966..e7cac1d48 100644 --- a/src/front/src/components/vote/VoteCard.vue +++ b/src/front/src/components/vote/VoteCard.vue @@ -11,10 +11,6 @@ {{ voteCard.name }} - - - - diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index 63f71a540..54f06ba75 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -14,13 +14,13 @@ - + - + Основная информация - + Создание опроса @@ -40,7 +40,7 @@ @@ -70,7 +70,7 @@ - + Далее @@ -82,7 +82,7 @@ Создание опроса: - + @@ -105,7 +105,7 @@ - @@ -139,7 +139,7 @@ - + Добавить ответ @@ -147,9 +147,9 @@ - - - + + + Голосование по отделам: @@ -158,24 +158,24 @@ {{ x.name }} - + - + - - - question.answers=question.answers.filter(e=>selected.includes(e.text))" > @@ -185,38 +185,38 @@ - + > + {{ item.raw.familyname }} - + - + - - + + @@ -232,10 +232,10 @@ - + - - + + @@ -253,7 +253,7 @@ - + Добавить вопрос @@ -263,25 +263,25 @@ Далее - + - + Подтверждение {{ errorMessage }} - + Название: {{ form.title }} Описание: {{ form.description }} Дата начала: {{ form.startDate.toLocaleDateString() }} Дата окончания: {{ form.endDate.toLocaleDateString() }} Вопросы: - + @@ -289,8 +289,8 @@ Варианты ответов: - - + + {{ answer.text }} @@ -309,20 +309,20 @@ - + Назад Сохранить - + - + @@ -374,7 +374,7 @@ export default { for (let x of allEmployees.value.sort((a,b)=>a.id_dict_department-b.id_dict_department)){ if(!groupped.includes(x.department))groupped.push(x.department) groupped.push(x) - } + } return groupped }) const findEmployeeById = (id) => @@ -538,7 +538,7 @@ export default { removeQuestion, addAnswer, removeAnswer, - findEmployeeById, + findEmployeeById, saveVoting, isVoteCreated, resetForm, diff --git a/src/front/src/components/vote/VoteResult.vue b/src/front/src/components/vote/VoteResult.vue index 426696733..4ebd1aa50 100644 --- a/src/front/src/components/vote/VoteResult.vue +++ b/src/front/src/components/vote/VoteResult.vue @@ -28,7 +28,6 @@ Не голосовали - @@ -89,18 +88,25 @@ - Не голосовали: - + + Не голосовали: + + {{ department }} - - + - + + {{ voter.fio }} - ({{ voter.post }}) 👿 @@ -133,9 +139,13 @@ import {computed, ref} from 'vue'; import {baseURL, spravURL} from "@/utils/axios-api"; import {checkremote} from "@/utils/universal_functions"; +import NonVoteHappy from "@/components/vote/NonVoteHappy.vue"; +import NonVoteSad from "@/components/vote/NonVoteSad.vue"; +import InfoUserCard from "@/components/UI/fiousercard/infoUserCard.vue"; export default { name: 'VoteResult', + components: {InfoUserCard, NonVoteSad, NonVoteHappy}, methods: { checkremote, spravURL() { @@ -157,6 +167,7 @@ export default { setup(props) { const activeTab = ref(0); const questions = computed(() => props.data.questions || []); + const userCardIndex = ref(null); const title = props.data.name; const description = props.data.description; @@ -204,7 +215,8 @@ export default { } const groupedByDepartment = computed(() => { - return nonVoters.reduce((groups, voter) => { + // Группируем пользователей по департаментам + const departments = nonVoters.reduce((groups, voter) => { const department = voter.department || ''; if (!groups[department]) { groups[department] = []; @@ -212,9 +224,25 @@ export default { groups[department].push(voter); return groups; }, {}); + + // Сортируем департаменты по id_dict_department + const sortedDepartments = Object.keys(departments).sort((a, b) => { + const idA = nonVoters.find(voter => voter.department === a)?.id_dict_department; + const idB = nonVoters.find(voter => voter.department === b)?.id_dict_department; + return idA - idB; + }); + + // Возвращаем отсортированные департаменты с пользователями + const sortedGroupedByDepartment = {}; + sortedDepartments.forEach(department => { + sortedGroupedByDepartment[department] = departments[department]; + }); + + return sortedGroupedByDepartment; }); return { + userCardIndex, activepick, opendialog, dialog,
тех, кто не голосовал нет
Название: {{ form.title }}
Описание: {{ form.description }}
Дата начала: {{ form.startDate.toLocaleDateString() }}
Дата окончания: {{ form.endDate.toLocaleDateString() }}
Вопросы:
Варианты ответов:
- + + {{ voter.fio }} - ({{ voter.post }}) 👿