From 27e08b59e5c528e0e5284efc1d5edf6fca3e89d5 Mon Sep 17 00:00:00 2001 From: Nukeap <53114367+Nukeap@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:44:20 +0300 Subject: [PATCH 1/5] Update VoteHomePage.vue --- src/front/src/views/VoteHomePage.vue | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/front/src/views/VoteHomePage.vue b/src/front/src/views/VoteHomePage.vue index 8a26c634e..777e8b572 100644 --- a/src/front/src/views/VoteHomePage.vue +++ b/src/front/src/views/VoteHomePage.vue @@ -108,8 +108,9 @@ export default { res.value = data; } catch (error) { console.error("Ошибка при загрузке данных голосования:", error); - res.value = null; - router.push({ name: "VoteHomePage" }); + // res.value = {}; + + throw error; } }; @@ -119,7 +120,7 @@ export default { result.value = data; } catch (error) { console.error("Ошибка при загрузке данных голосования:", error); - res.value = null; + res.value = {}; } }; @@ -135,9 +136,14 @@ export default { const openModal = async (type, voting) => { selectedVoting.value = voting; if (type === "vote") { - await loadVoteDetails(voting.id); - voteModal.value = true; + try{ + await loadVoteDetails(voting.id); + console.log("sd;lkjs;ljlmnjlk"); + voteModal.value = true; router.push({name: "Voting", params: {id: voting.id}}); + }catch(e){ + router.push({ name: "VoteHomePage" }) + } } else if (type === "results") { await loadVoteResult(voting.id); resultsModal.value = true; @@ -162,8 +168,12 @@ export default { if (!voteModal.value && !resultsModal.value) { const voting = votes.value.find((v) => v.id === route.params.id); if (route.name === "Voting") { + try{ await loadVoteDetails(route.params.id); - voteModal.value = true; + voteModal.value = true;} + catch(e){ + router.push({ name: "VoteHomePage" }) + } } // if (route.name === "EditVote") editVoteModal.value = true; if (route.name === "VoteResults") { From a482345a3b693b2cbd9719e6353d0b4a78afe313 Mon Sep 17 00:00:00 2001 From: Denzel Date: Thu, 23 Jan 2025 13:28:13 +0300 Subject: [PATCH 2/5] =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=BC=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BA=20=D0=B7=D0=B0=D0=B2=D0=B5=D1=80=D1=88=D1=91?= =?UTF-8?q?=D0=BD=D0=BD=D0=BE=D0=BC=D1=83=20=D0=B3=D0=BE=D0=BB=D0=BE=D1=81?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8E,=20=D1=81=D0=BE=D1=80?= =?UTF-8?q?=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=B4=D0=B5=D0=BF?= =?UTF-8?q?=D0=B0=D1=80=D1=82=D0=B0=D0=BC=D0=B5=D0=BD=D1=82=D0=BE=D0=B2,?= =?UTF-8?q?=20=D0=BE=D1=82=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=81=D0=BA=D1=80?= =?UTF-8?q?=D0=BE=D0=BB=D0=BB=D0=B0=20=D1=83=20=D0=BA=D0=BE=D0=BD=D1=81?= =?UTF-8?q?=D1=82=D1=80=D1=83=D0=BA=D1=82=D0=BE=D1=80=D0=B0,=20=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B5=20=D0=BA=D0=B0=D1=80?= =?UTF-8?q?=D1=82=D0=BE=D1=87=D0=BA=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=20=D0=B2=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B2=D0=B5=D1=80=D1=88=D1=91=D0=BD=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=B3=D0=BE=D0=BB=D0=BE=D1=81=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/fiousercard/infoUserCard.vue | 2 +- .../src/components/vote/NonVoteHappy.vue | 143 ++++++++++++++++++ src/front/src/components/vote/NonVoteSad.vue | 127 ++++++++++++++++ src/front/src/components/vote/VoteCard.vue | 4 - .../src/components/vote/VoteConstructor.vue | 82 +++++----- src/front/src/components/vote/VoteResult.vue | 48 ++++-- 6 files changed, 350 insertions(+), 56 deletions(-) create mode 100644 src/front/src/components/vote/NonVoteHappy.vue create mode 100644 src/front/src/components/vote/NonVoteSad.vue 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 @@