From 145c188d1900b96c08cef432dba845ad46097ffe Mon Sep 17 00:00:00 2001 From: khj0414 Date: Mon, 17 Mar 2025 15:59:20 +0900 Subject: [PATCH] =?UTF-8?q?=ED=88=AC=ED=91=9C=20=EB=B3=B8=EC=9D=B8=20?= =?UTF-8?q?=E3=84=B4=EB=B9=84=ED=99=9C=EC=84=B1=ED=99=94=20=EB=A7=89?= =?UTF-8?q?=EC=9D=8C=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/user/UserList.vue | 16 +++++++++++++++- src/views/voteboard/voteboardWrite.vue | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/user/UserList.vue b/src/components/user/UserList.vue index afa2185..c1ae02e 100644 --- a/src/components/user/UserList.vue +++ b/src/components/user/UserList.vue @@ -30,12 +30,14 @@ import { onMounted, ref, nextTick, computed, watch } from 'vue'; import { useUserStore } from '@s/userList'; import { useProjectStore } from '@s/useProjectStore'; import $api from '@api'; +import { useToastStore } from "@s/toastStore"; const emit = defineEmits(['user-list-update']); const userStore = useUserStore(); const userList = ref([]); const baseUrl = $api.defaults.baseURL.replace(/api\/$/, ''); const userProjectPeriods = ref([]); +const toastStore = useToastStore(); const props = defineProps({ projctSeq: { @@ -45,6 +47,10 @@ const props = defineProps({ showOnlyActive: { type: Boolean, default: false + }, + role: { + type:String, + required:false } }); @@ -139,8 +145,16 @@ const isUserDisabled = (user) => { // showOnlyActive가 true일 때는 toggleDisable 함수가 실행되지 않음 const toggleDisable = async (index) => { if (props.showOnlyActive) return; - const user = displayedUserList.value[index]; + + // 본인 계정이면 비활성화 방지 + if (props.role === 'vote') { + if(user.MEMBERSEQ === userStore.userInfo.id) { + toastStore.onToast('본인은 비활성화할 수 없습니다.', 'e'); + return; + } + } + if (user) { const newParticipationStatus = props.projctSeq ? user.PROJCTYON === '1' diff --git a/src/views/voteboard/voteboardWrite.vue b/src/views/voteboard/voteboardWrite.vue index deb6ebc..20d6f1f 100644 --- a/src/views/voteboard/voteboardWrite.vue +++ b/src/views/voteboard/voteboardWrite.vue @@ -10,7 +10,7 @@
투표 인원
- +
2명이상 선택해주세요.