diff --git a/src/front/src/assets/emblem.png b/src/front/src/assets/emblem.png new file mode 100644 index 000000000..b81d3984d Binary files /dev/null and b/src/front/src/assets/emblem.png differ diff --git a/src/front/src/components/UI/Auth-form.vue b/src/front/src/components/UI/Auth-form.vue index d5f54cd1f..44fa42370 100644 --- a/src/front/src/components/UI/Auth-form.vue +++ b/src/front/src/components/UI/Auth-form.vue @@ -88,7 +88,7 @@ type="error" density="compact" title="Ошибка авторизации" - :text="info" + v-model="alert" diff --git a/src/front/src/components/news-crossroad.vue b/src/front/src/components/news-crossroad.vue index a9c04cfd3..628e79a4c 100644 --- a/src/front/src/components/news-crossroad.vue +++ b/src/front/src/components/news-crossroad.vue @@ -14,7 +14,7 @@ class="d-flex pa-1 flex-column " > - {{aNewsAll}} + diff --git a/src/front/src/components/vote/CurrentVote.vue b/src/front/src/components/vote/CurrentVote.vue index be2299224..eb2efbc17 100644 --- a/src/front/src/components/vote/CurrentVote.vue +++ b/src/front/src/components/vote/CurrentVote.vue @@ -42,6 +42,7 @@ + + + + + Голос + + + + + + + + + + + diff --git a/src/front/src/components/vote/VoteCard.vue b/src/front/src/components/vote/VoteCard.vue index b44da5956..a4cbf9ef3 100644 --- a/src/front/src/components/vote/VoteCard.vue +++ b/src/front/src/components/vote/VoteCard.vue @@ -25,7 +25,7 @@ + :src="images[index].length < 1 ? defaultImage : `${baseURL.slice(0, -1)}${picture}`"> @@ -42,12 +42,15 @@ {{ voteCard.description }} + timeChange = time"/> + Завершено: {{ new Date(voteCard.dateend).toLocaleDateString() }} + { - return props.voteCard.files.length > 0 ? props.voteCard.files : ['/media/defaultimg/vote.png'] + return props.voteCard.files.length > 0 ? props.voteCard.files : [''] }) const date = new Date(); @@ -143,7 +147,7 @@ export default { isFinished.value = true; } - return {timeChange, baseURL, images, youSure, isFinished, user} + return {timeChange, baseURL, images, youSure, isFinished, user, defaultImage} } } diff --git a/src/front/src/components/vote/VoteConstructor.vue b/src/front/src/components/vote/VoteConstructor.vue index 63f71a540..e4a55aeba 100644 --- a/src/front/src/components/vote/VoteConstructor.vue +++ b/src/front/src/components/vote/VoteConstructor.vue @@ -100,20 +100,20 @@ Настройки вопроса - + Тип ответа - + + - - - + + Число возможных ответов @@ -121,11 +121,13 @@ :rules="[rules.required && question.settings.multiChoice > 0]" hide-details type="number" min="1" variant="outlined"> - + + + @@ -141,6 +143,7 @@ + Добавить ответ @@ -161,10 +164,7 @@ - - + @@ -400,7 +400,7 @@ export default { const addQuestion = () => { form.value.questions.push({ text: "", - settings: { choice: "free", multiChoice: 1, onlyDep: null, withoutDirector: false }, + settings: { choice: "free", multiChoice: 1, onlyDep: null }, image: null, answers: [], selectedEmployees: [] @@ -464,17 +464,11 @@ export default { }); const selectedTimeStart = ref( - `${form.value.startDate.getHours().toString().padStart(2, "0")}:${form.value.startDate - .getMinutes() - .toString() - .padStart(2, "0")}` + `${(form.value.startDate.getHours()+1).toString().padStart(2, "0")}:00` ); const selectedTimeEnd = ref( - `${form.value.endDate.getHours().toString().padStart(2, "0")}:${form.value.endDate - .getMinutes() - .toString() - .padStart(2, "0")}` + `${(form.value.endDate.getHours()+1).toString().padStart(2, "0")}:00` ); watch(form.value, () => { diff --git a/src/front/src/components/vote/VoteResult.vue b/src/front/src/components/vote/VoteResult.vue index 2723f3b18..426696733 100644 --- a/src/front/src/components/vote/VoteResult.vue +++ b/src/front/src/components/vote/VoteResult.vue @@ -1,5 +1,5 @@ - + @@ -46,7 +46,7 @@ Топ {{ getTopResults(question).length }} - + - - - - - - - - - - - - + + Не голосовали: + + + {{ department }} + + + + + {{ voter.fio }} + ({{ voter.post }}) 👿 + + + + + @@ -154,6 +160,7 @@ export default { const title = props.data.name; const description = props.data.description; + const nonVoters = props.data.nonvoting; const getWinner = (question) => { return question.answers.reduce( @@ -196,6 +203,17 @@ export default { activepick.value = val } + const groupedByDepartment = computed(() => { + return nonVoters.reduce((groups, voter) => { + const department = voter.department || ''; + if (!groups[department]) { + groups[department] = []; + } + groups[department].push(voter); + return groups; + }, {}); + }); + return { activepick, opendialog, @@ -209,7 +227,9 @@ export default { voteCount, title, description, - getPercentage + getPercentage, + nonVoters, + groupedByDepartment }; }, }; diff --git a/src/front/src/views/VoteHomePage.vue b/src/front/src/views/VoteHomePage.vue index 59c11e429..8a26c634e 100644 --- a/src/front/src/views/VoteHomePage.vue +++ b/src/front/src/views/VoteHomePage.vue @@ -6,9 +6,13 @@ v-model="currentTab" align="center"> {{ x.text }} + Создать новое голосование + + + @@ -31,11 +35,11 @@ - + - + @@ -63,16 +67,17 @@ import {useRoute, useRouter} from "vue-router"; import VoteResult from "@/components/vote/VoteResult.vue"; import {deleteVote, getVoteDetail, getVoteResult, getVotes} from "@/utils/axios-api"; import {formatDate} from "@vueuse/shared"; - +import { useAccountStore } from "@/store/AccountStore"; export default { methods: {formatDate}, components: {CurrentVote, VoteConstructor, VoteCardVue, VoteResult}, setup() { + const accountStore = useAccountStore(); const tabs = [ {value: "active", text: 'Текущие голосования'}, {value: "completed", text: 'Завершенные голосования'}, - {value: "constructor", text: 'Создать новое голосование'}, + ] const currentTab = ref("active"); @@ -104,6 +109,7 @@ export default { } catch (error) { console.error("Ошибка при загрузке данных голосования:", error); res.value = null; + router.push({ name: "VoteHomePage" }); } }; @@ -173,6 +179,7 @@ export default { updating("active"); return { + accountStore, currentTab, votes, sortedVotes,
+ + {{ voter.fio }} + ({{ voter.post }}) 👿 +