Merge branch 'khj'
This commit is contained in:
commit
a97d3b4609
@ -58,6 +58,7 @@
|
||||
<template #body>
|
||||
<div>
|
||||
<vote-list
|
||||
:key="voteListKey"
|
||||
:data="selectVoteDate"
|
||||
@checkedNames="checkedNames"
|
||||
@addContents="addContents"
|
||||
@ -70,9 +71,6 @@
|
||||
<BackButton @click="closeModal" />
|
||||
</template>
|
||||
</CenterModal>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -83,8 +81,12 @@ import CenterModal from '@c/modal/CenterModal.vue';
|
||||
import BackButton from '@c/button/BackBtn.vue';
|
||||
import voteList from '@c/voteboard/voteCardList.vue';
|
||||
import { useToastStore } from '@s/toastStore';
|
||||
const toastStore = useToastStore();
|
||||
|
||||
const toastStore = useToastStore();
|
||||
const currentPage = ref(1);
|
||||
const voteset = ref(0);
|
||||
const voteListData= ref([]);
|
||||
const voteListKey = ref(0); //초기화
|
||||
// 로그 모달 상태
|
||||
const isModalOpen = ref(false);
|
||||
const selectVoteDate = ref([]);
|
||||
@ -99,8 +101,8 @@ const openModal = async (id) => {
|
||||
// 로그 모달 닫기
|
||||
const closeModal = () => {
|
||||
isModalOpen.value = false;
|
||||
voteListKey.value++;
|
||||
};
|
||||
|
||||
// 프로필 이미지
|
||||
const baseUrl = $api.defaults.baseURL.replace(/api\/$/, '');
|
||||
const defaultProfile = "/img/icons/icon.png";
|
||||
@ -111,9 +113,6 @@ const setDefaultImage = (event) => {
|
||||
event.target.src = defaultProfile;
|
||||
};
|
||||
|
||||
const currentPage = ref(1);
|
||||
const voteset = ref(0);
|
||||
const voteListData= ref([]);
|
||||
onMounted(() => {
|
||||
getvoteList();
|
||||
});
|
||||
@ -121,7 +120,6 @@ onMounted(() => {
|
||||
//투표목록
|
||||
const getvoteList = () => {
|
||||
$api.get('vote/getVoteList',{
|
||||
//목록조회시 파라미터 전달
|
||||
params:
|
||||
{
|
||||
page: 1
|
||||
@ -131,7 +129,6 @@ const getvoteList = () => {
|
||||
}).then(res => {
|
||||
voteListData.value = res.data.data.list;
|
||||
voteListData.value = res.data.data.list.slice(0, 6);
|
||||
|
||||
})
|
||||
};
|
||||
|
||||
@ -145,18 +142,39 @@ const checkedNames = (numList) => {
|
||||
toastStore.onToast('투표가 완료되었습니다.', 's');
|
||||
isModalOpen.value = false;
|
||||
getvoteList();
|
||||
voteListKey.value++;
|
||||
}
|
||||
})
|
||||
}
|
||||
//투표항목추가
|
||||
const addContents = (itemList, voteId) => {
|
||||
console.log('itemList',itemList)
|
||||
$api.post('vote/insertWord',{
|
||||
itemList :itemList
|
||||
,voteId :voteId
|
||||
}).then((res)=>{
|
||||
if(res.data.status === 'OK'){
|
||||
toastStore.onToast('항목이 등록되었습니다.', 's');
|
||||
getvoteList();
|
||||
const updatedVote = selectVoteDate.value.find(vote => vote.localVote.LOCVOTSEQ === voteId);
|
||||
if (updatedVote) {
|
||||
if (!updatedVote.voteDetails) {
|
||||
updatedVote.voteDetails = [];
|
||||
}
|
||||
const maxSeq = updatedVote.voteDetails.reduce((max, item) => {
|
||||
return item.VOTDETSEQ > max ? item.VOTDETSEQ : max;
|
||||
}, 0);
|
||||
// 새 항목을 voteDetails에 추가
|
||||
itemList.forEach(item => {
|
||||
updatedVote.voteDetails.push({
|
||||
VOTDETSEQ: maxSeq + 1,
|
||||
LOCVOTSEQ: voteId,
|
||||
LOCVOTCON: item.content,
|
||||
LOCVOTLIK: item.url,
|
||||
VOTE_COUNT: 0,
|
||||
yesvote: 0
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -209,7 +227,7 @@ const getDaysAgo = (dateString) => {
|
||||
const dayDiff = Math.floor(timeDiff / (1000 * 60 * 60 * 24))+1; // 일 단위 변환
|
||||
|
||||
// 오늘 날짜인 경우 "오늘" 반환
|
||||
if (dayDiff === 0) return "금일 종료";
|
||||
if (dayDiff === 0) return "⏰금일 종료";
|
||||
|
||||
return `⏰종료 ${Math.abs(dayDiff)}일 전`;
|
||||
};
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center flex-wrap border-top-0 p-0">
|
||||
<div class="d-flex flex-wrap align-items-center">
|
||||
<ul class="list-unstyled users-list d-flex align-items-center avatar-group m-0 me-2">
|
||||
<ul class="list-unstyled users-list d-flex align-items-center avatar-group">
|
||||
<vote-complete-user-list-card :data="data"/>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<img
|
||||
class="rounded-circle user-avatar border border-3"
|
||||
:src="`${baseUrl}upload/img/profile/${data.MEMBERPRF}`"
|
||||
:style="`border-color: ${data.usercolor} !important;`"
|
||||
:style="`border-color: ${data.usercolor} !important; width: 90%; height: auto;`"
|
||||
@error="$event.target.src = '/img/icons/icon.png'"
|
||||
alt="user"
|
||||
/>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center flex-wrap border-top-0 p-0">
|
||||
<div class="d-flex flex-wrap align-items-center">
|
||||
<ul class="list-unstyled users-list d-flex align-items-center avatar-group m-0 me-2">
|
||||
<ul class="list-unstyled users-list d-flex align-items-center avatar-group ">
|
||||
<vote-in-complete-user-list-card :data="data" />
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<img
|
||||
class="rounded-circle user-avatar border border-3"
|
||||
:src="`${baseUrl}upload/img/profile/${data.MEMBERPRF}`"
|
||||
:style="`border-color: ${data.usercolor} !important;`"
|
||||
:style="`border-color: ${data.usercolor} !important; width: 90%; height: auto;`"
|
||||
@error="$event.target.src = '/img/icons/icon.png'"
|
||||
alt="user"
|
||||
/>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<div class="d-flex align-items-start mt-3">
|
||||
<!--투표한 사람 목록 -->
|
||||
<div class="d-flex align-items-center gap-2 flex-wrap">
|
||||
<i class='bx bxs-user-check link-info fa-3x'></i>
|
||||
<i class='bx bxs-user-check link-info fa-2x'></i>
|
||||
<vote-complete-user-list
|
||||
v-for="(item, index) in voetedUsers"
|
||||
:key="index"
|
||||
@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<!-- 투표안한 사람 목록 -->
|
||||
<div class="d-flex align-items-center gap-2 ms-auto flex-wrap">
|
||||
<i class='bx bxs-user-x link-danger fa-3x'></i>
|
||||
<i class='bx bxs-user-x link-danger fa-2x'></i>
|
||||
<vote-in-complete-user-list
|
||||
v-for="(item, index) in noVoetedUsers"
|
||||
:key="index"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user