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>
<div v-if="data.voteMembers.some(item => item.MEMBERSEQ === userStore.user.id)"
class="card mb-6" :class="{ 'disabled-class': data.localVote.LOCVOTDDT && (topVoters.length == 1 || data.localVote.LOCVOTRES || voteResult == 0)}">
<div 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" >
<h5 class="card-title mb-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">
<i class="bx bx-check"></i>
</button>
<save-btn class="ms-auto" @click="selectVote"/>
</div>
</div>
</div>
<save-btn class="mt-2" @click="selectVote"/>
</div>
</template>

View File

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