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

@ -1,18 +1,18 @@
<template> <template>
<div> <div>
<card <card
@addContents="addContents" @addContents="addContents"
@checkedNames="checkedNames" @checkedNames="checkedNames"
@endVoteId="endVoteId" @endVoteId="endVoteId"
@voteEnded="voteEnded" @voteEnded="voteEnded"
@voteDelete="voteDelete" @voteDelete="voteDelete"
@randomList="randomList" @randomList="randomList"
@updateVote="updateVote" @updateVote="updateVote"
v-for="(item, index) in data" v-for="(item, index) in data"
:key="index" :key="index"
:data="item" :data="item"
/> />
</div> </div>
</template> </template>
<script setup> <script setup>

View File

@ -50,26 +50,28 @@
</div> </div>
<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"
id="addvoteitem" id="addvoteitem"
v-model="addvoteitem" v-model="addvoteitem"
/> />
항목 추가여부 항목 추가여부
</label> </label>
<label class="list-group-item"> </div>
<input <div>
class="form-check-input me-1" <label >
type="checkbox" <input
id="addvotemulti" class="form-check-input me-1"
v-model="addvotemulti" type="checkbox"
/> id="addvotemulti"
다중투표 허용여부 v-model="addvotemulti"
</label> />
</div> 다중투표 허용여부
</label>
</div>
</div> </div>
</li> </li>
</ul> </ul>
@ -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() === '') {
valid = false; contentAlerts.value[index] = true;
} else { valid = false;
contentAlerts.value[0] = false; } else if (index >= 2 && item.content.trim() === '' && item.url.trim() !== '') {
} contentAlerts.value[index] = true;
if (itemList.value[1].content.trim() === '') { valid = false;
contentAlerts.value[1] = true; } else {
valid = false; contentAlerts.value[index] = 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)) {
contentAlerts.value[index] = false;
}
} }
if(field == 'content2'){ };
contentAlerts.value[1] = false;
}
}
const ValidHandlerendDate = () =>{ const ValidHandlerendDate = () =>{
endDateAlert.value = false; endDateAlert.value = false;
} }