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

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 { useUserStore } from '@s/userList';
import { useProjectStore } from '@s/useProjectStore'; import { useProjectStore } from '@s/useProjectStore';
import $api from '@api'; import $api from '@api';
import { useToastStore } from "@s/toastStore";
const emit = defineEmits(['user-list-update']); const emit = defineEmits(['user-list-update']);
const userStore = useUserStore(); const userStore = useUserStore();
const userList = ref([]); const userList = ref([]);
const baseUrl = $api.defaults.baseURL.replace(/api\/$/, ''); const baseUrl = $api.defaults.baseURL.replace(/api\/$/, '');
const userProjectPeriods = ref([]); const userProjectPeriods = ref([]);
const toastStore = useToastStore();
const props = defineProps({ const props = defineProps({
projctSeq: { projctSeq: {
@ -45,6 +47,10 @@ const props = defineProps({
showOnlyActive: { showOnlyActive: {
type: Boolean, type: Boolean,
default: false default: false
},
role: {
type:String,
required:false
} }
}); });
@ -139,8 +145,16 @@ const isUserDisabled = (user) => {
// showOnlyActive true toggleDisable // showOnlyActive true toggleDisable
const toggleDisable = async (index) => { const toggleDisable = async (index) => {
if (props.showOnlyActive) return; if (props.showOnlyActive) return;
const user = displayedUserList.value[index]; const user = displayedUserList.value[index];
//
if (props.role === 'vote') {
if(user.MEMBERSEQ === userStore.userInfo.id) {
toastStore.onToast('본인은 비활성화할 수 없습니다.', 'e');
return;
}
}
if (user) { if (user) {
const newParticipationStatus = props.projctSeq const newParticipationStatus = props.projctSeq
? user.PROJCTYON === '1' ? user.PROJCTYON === '1'

View File

@ -10,7 +10,7 @@
<div class="timeline-header mb-2"> <div class="timeline-header mb-2">
<h6 class="mb-0">투표 인원</h6> <h6 class="mb-0">투표 인원</h6>
</div> </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> <div v-if="UserListAlert" class="invalid-feedback d-block">2명이상 선택해주세요.</div>
<form-input <form-input
title="제목" title="제목"