투표 본인 ㄴ비활성화 막음음

This commit is contained in:
khj0414 2025-03-17 15:59:20 +09:00
parent cc8e347aa9
commit 145c188d19
2 changed files with 16 additions and 2 deletions

View File

@ -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'

View File

@ -10,7 +10,7 @@
<div class="timeline-header mb-2">
<h6 class="mb-0">투표 인원</h6>
</div>
<UserList @userListInfo="userSet" @user-list-update="handleUserListUpdate" class="mb-3" />
<UserList :role="'vote'" @userListInfo="userSet" @user-list-update="handleUserListUpdate" class="mb-3" />
<div v-if="UserListAlert" class="invalid-feedback d-block">2명이상 선택해주세요.</div>
<form-input
title="제목"