Merge branch 'khj'
This commit is contained in:
commit
53061dc5f1
@ -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">
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
<template>
|
||||
<div>
|
||||
<card
|
||||
@addContents="addContents"
|
||||
@checkedNames="checkedNames"
|
||||
@endVoteId="endVoteId"
|
||||
@voteEnded="voteEnded"
|
||||
@voteDelete="voteDelete"
|
||||
@randomList="randomList"
|
||||
@updateVote="updateVote"
|
||||
v-for="(item, index) in data"
|
||||
:key="index"
|
||||
:data="item"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<card
|
||||
@addContents="addContents"
|
||||
@checkedNames="checkedNames"
|
||||
@endVoteId="endVoteId"
|
||||
@voteEnded="voteEnded"
|
||||
@voteDelete="voteDelete"
|
||||
@randomList="randomList"
|
||||
@updateVote="updateVote"
|
||||
v-for="(item, index) in data"
|
||||
:key="index"
|
||||
:data="item"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
||||
@ -50,26 +50,28 @@
|
||||
</div>
|
||||
|
||||
<plus-btn @click="addItem" :disabled="itemList.length >= 10" class="mb-3" />
|
||||
<div>
|
||||
<label class="list-group-item">
|
||||
<input
|
||||
class="form-check-input me-1"
|
||||
type="checkbox"
|
||||
id="addvoteitem"
|
||||
v-model="addvoteitem"
|
||||
/>
|
||||
항목 추가여부
|
||||
</label>
|
||||
<label class="list-group-item">
|
||||
<input
|
||||
class="form-check-input me-1"
|
||||
type="checkbox"
|
||||
id="addvotemulti"
|
||||
v-model="addvotemulti"
|
||||
/>
|
||||
다중투표 허용여부
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>
|
||||
<input
|
||||
class="form-check-input me-1"
|
||||
type="checkbox"
|
||||
id="addvoteitem"
|
||||
v-model="addvoteitem"
|
||||
/>
|
||||
항목 추가여부
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label >
|
||||
<input
|
||||
class="form-check-input me-1"
|
||||
type="checkbox"
|
||||
id="addvotemulti"
|
||||
v-model="addvotemulti"
|
||||
/>
|
||||
다중투표 허용여부
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@ -151,18 +153,17 @@ const saveValid = () => {
|
||||
} else {
|
||||
endDateAlert.value = false;
|
||||
}
|
||||
if (itemList.value[0].content.trim() === '') {
|
||||
contentAlerts.value[0] = 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;
|
||||
}
|
||||
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[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.startsWith('content')) {
|
||||
const index = parseInt(field.replace('content', '')) - 1;
|
||||
if (!isNaN(index)) {
|
||||
contentAlerts.value[index] = false;
|
||||
}
|
||||
}
|
||||
if(field == 'content2'){
|
||||
contentAlerts.value[1] = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
const ValidHandlerendDate = () =>{
|
||||
endDateAlert.value = false;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user