Merge branch 'khj'

This commit is contained in:
khj0414 2025-03-18 10:28:39 +09:00
commit 53061dc5f1
4 changed files with 58 additions and 56 deletions

View File

@ -1,6 +1,5 @@
<template> <template>
<div v-if="data.voteMembers.some(item => item.MEMBERSEQ === userStore.user.id)" <div class="card mb-6" :class="{ 'disabled-class': data.localVote.LOCVOTDDT && (topVoters.length == 1 || data.localVote.LOCVOTRES || voteResult == 0)}">
class="card mb-6" :class="{ 'disabled-class': data.localVote.LOCVOTDDT && (topVoters.length == 1 || data.localVote.LOCVOTRES || voteResult == 0)}">
<div class="card-body" v-if="!data.localVote.LOCVOTDEL" > <div class="card-body" v-if="!data.localVote.LOCVOTDEL" >
<h5 class="card-title mb-1"> <h5 class="card-title mb-1">
<div class="list-unstyled users-list d-flex align-items-center gap-1"> <div class="list-unstyled users-list d-flex align-items-center gap-1">

View File

@ -29,10 +29,11 @@
<button class="btn btn-primary btn-icon m-1" @click="addContentSave(item.LOCVOTSEQ)" :disabled="isSaveDisabled"> <button class="btn btn-primary btn-icon m-1" @click="addContentSave(item.LOCVOTSEQ)" :disabled="isSaveDisabled">
<i class="bx bx-check"></i> <i class="bx bx-check"></i>
</button> </button>
<save-btn class="ms-auto" @click="selectVote"/>
</div> </div>
</div> </div>
</div> </div>
<save-btn class="mt-2" @click="selectVote"/>
</div> </div>
</template> </template>

View File

@ -51,7 +51,7 @@
<plus-btn @click="addItem" :disabled="itemList.length >= 10" class="mb-3" /> <plus-btn @click="addItem" :disabled="itemList.length >= 10" class="mb-3" />
<div> <div>
<label class="list-group-item"> <label>
<input <input
class="form-check-input me-1" class="form-check-input me-1"
type="checkbox" type="checkbox"
@ -60,7 +60,9 @@
/> />
항목 추가여부 항목 추가여부
</label> </label>
<label class="list-group-item"> </div>
<div>
<label >
<input <input
class="form-check-input me-1" class="form-check-input me-1"
type="checkbox" type="checkbox"
@ -151,18 +153,17 @@ const saveValid = () => {
} else { } else {
endDateAlert.value = false; endDateAlert.value = false;
} }
if (itemList.value[0].content.trim() === '') { itemList.value.forEach((item, index) => {
contentAlerts.value[0] = true; if (index < 2 && item.content.trim() === '') {
contentAlerts.value[index] = true;
valid = false;
} else if (index >= 2 && item.content.trim() === '' && item.url.trim() !== '') {
contentAlerts.value[index] = true;
valid = false; valid = false;
} else { } else {
contentAlerts.value[0] = false; contentAlerts.value[index] = false;
}
if (itemList.value[1].content.trim() === '') {
contentAlerts.value[1] = true;
valid = false;
} else {
contentAlerts.value[1] = false;
} }
});
if (activeUserList.value.length < 2) { if (activeUserList.value.length < 2) {
UserListAlert.value = true; UserListAlert.value = true;
valid = false; valid = false;
@ -174,6 +175,7 @@ const saveValid = () => {
} }
}; };
const saveVote = () => { const saveVote = () => {
console.log('itemList',itemList)
const filteredItemList = itemList.value.filter(item => item.content && item.content.trim() !== ''); const filteredItemList = itemList.value.filter(item => item.content && item.content.trim() !== '');
const unwrappedUserList = toRaw(activeUserList.value); const unwrappedUserList = toRaw(activeUserList.value);
const listId = unwrappedUserList.map(item => ({ const listId = unwrappedUserList.map(item => ({
@ -194,16 +196,16 @@ const saveVote = () => {
}) })
}; };
const ValidHandler = (field) => { const ValidHandler = (field) => {
if(field == 'title'){ if (field === 'title') {
titleAlert.value = false; titleAlert.value = false;
} }
if(field == 'content1'){ if (field.startsWith('content')) {
contentAlerts.value[0] = false; const index = parseInt(field.replace('content', '')) - 1;
} if (!isNaN(index)) {
if(field == 'content2'){ contentAlerts.value[index] = false;
contentAlerts.value[1] = false;
} }
} }
};
const ValidHandlerendDate = () =>{ const ValidHandlerendDate = () =>{
endDateAlert.value = false; endDateAlert.value = false;
} }