Merge remote-tracking branch 'origin/main' into board-comment

This commit is contained in:
kimdaae328 2025-02-13 13:27:51 +09:00
commit 04ab0325b7
7 changed files with 179 additions and 245 deletions

5
.env.dev Normal file
View File

@ -0,0 +1,5 @@
VITE_DOMAIN = http://localhost:5173/
# VITE_LOGIN_URL = http://localhost:10325/ms/
# VITE_FILE_URL = http://localhost:10325/ms/
# VITE_API_URL = http://localhost:10325/api/
VITE_API_URL = http://localhost:10325/test/

View File

@ -29,68 +29,82 @@
/* 휴가*/ /* 휴가*/
.half-day-buttons { .half-day-buttons {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 10px; gap: 10px;
margin-top: 20px; margin-top: 20px;
} }
.half-day-buttons .btn.active { .half-day-buttons .btn.active {
border: 2px solid black; border: 2px solid black;
} }
.fc-daygrid-day-frame { .fc-daygrid-day-frame {
min-height: 80px !important; min-height: 80px !important;
max-height: 120px !important; max-height: 120px !important;
overflow: hidden !important; overflow: hidden !important;
padding-top: 25px !important; padding-top: 25px !important;
} }
.fc-daygrid-day-events { .fc-daygrid-day-events {
max-height: 100px !important; max-height: 100px !important;
overflow-y: auto !important; overflow-y: auto !important;
} }
.fc-daygrid-event { .fc-daygrid-event {
position: absolute !important; position: absolute !important;
height: 20px !important; height: 20px !important;
width: 100% !important; width: 100% !important;
left: 0 !important; left: 0 !important;
margin: 2px 0 !important; margin: 2px 0 !important;
padding: 0 !important; padding: 0 !important;
border-radius: 2px !important; border-radius: 2px !important;
border: none !important; border: none !important;
} }
.fc-daygrid-event-harness { .fc-daygrid-event-harness {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
justify-content: flex-start; justify-content: flex-start;
width: 100%; width: 100%;
gap: 22px; gap: 22px;
} }
.fc-daygrid-event.half-day-am { .fc-daygrid-event.half-day-am {
width: 45% !important; width: 45% !important;
left: 0 !important; left: 0 !important;
} }
.fc-daygrid-event.half-day-pm { .fc-daygrid-event.half-day-pm {
width: 45% !important; width: 45% !important;
left: auto !important; left: auto !important;
right: 0 !important; right: 0 !important;
} }
.fc-daygrid-event.full-day { .fc-daygrid-event.full-day {
width: 100% !important; width: 100% !important;
left: 0 !important; left: 0 !important;
} }
.fc-day-sun .fc-daygrid-day-number, .fc-day-sun .fc-daygrid-day-number,
.fc-col-header-cell:first-child .fc-col-header-cell-cushion { .fc-col-header-cell:first-child .fc-col-header-cell-cushion {
color: #ff4500 !important; color: #ff4500 !important;
} }
.fc-day-sat .fc-daygrid-day-number, .fc-day-sat .fc-daygrid-day-number,
.fc-col-header-cell:last-child .fc-col-header-cell-cushion { .fc-col-header-cell:last-child .fc-col-header-cell-cushion {
color: #6076e0 !important; color: #6076e0 !important;
} }
.fc-daygrid-day-number { .fc-daygrid-day-number {
position: absolute !important; position: absolute !important;
top: 0px !important; top: 0px !important;
left: 5px !important; left: 5px !important;
text-align: left !important; text-align: left !important;
} }
.user-avatar {
border: 3px solid;
width: 110px;
height: 110px;
object-fit: cover;
background-color: white;
transition: transform 0.2s ease-in-out;
}
.grayscaleImg {
filter: grayscale(100%);
}

View File

@ -1,12 +1,12 @@
import axios from "axios"; import axios from 'axios';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useToastStore } from '@s/toastStore'; import { useToastStore } from '@s/toastStore';
const $api = axios.create({ const $api = axios.create({
baseURL: 'http://localhost:10325/api/', baseURL: 'http://localhost:10325/api/',
timeout: 300000, timeout: 300000,
withCredentials : true withCredentials: true,
}) });
/** /**
* Default Content-Type : json * Default Content-Type : json
@ -14,7 +14,6 @@ const $api = axios.create({
*/ */
$api.interceptors.request.use( $api.interceptors.request.use(
function (config) { function (config) {
let contentType = 'application/json'; let contentType = 'application/json';
if (config.isFormData) contentType = 'multipart/form-data'; if (config.isFormData) contentType = 'multipart/form-data';
@ -23,21 +22,21 @@ $api.interceptors.request.use(
config.headers['X-Requested-With'] = 'XMLHttpRequest'; config.headers['X-Requested-With'] = 'XMLHttpRequest';
return config; return config;
}, function (error) { },
function (error) {
// 요청 오류가 있는 작업 수행 // 요청 오류가 있는 작업 수행
return Promise.reject(error); return Promise.reject(error);
} },
); );
// 응답 인터셉터 추가하기 // 응답 인터셉터 추가하기
$api.interceptors.response.use( $api.interceptors.response.use(
function (response) { function (response) {
// 2xx 범위의 응답 처리 // 2xx 범위의 응답 처리
return response; return response;
}, },
function (error) { function (error) {
const toastStore = useToastStore() const toastStore = useToastStore();
const currentPage = error.config.headers['X-Page-Route']; const currentPage = error.config.headers['X-Page-Route'];
// 오류 응답 처리 // 오류 응답 처리
if (error.response) { if (error.response) {
@ -70,7 +69,7 @@ $api.interceptors.response.use(
} }
return Promise.reject(error); return Promise.reject(error);
} },
); );
export default $api; export default $api;

View File

@ -62,17 +62,19 @@ watch(() => props.dislikeCount, (newVal) => {
}); });
const handleLike = () => { const handleLike = () => {
console.log('좋아요',likeCount.value) const isLike = !likeClicked.value;
// emit('updateReaction', { type: 'like', boardId: props.boardId, commentId: props.commentId }); const isDislike = false;
// likeClicked.value = true; emit('updateReaction', { boardId: props.boardId, commentId: props.commentId, isLike, isDislike });
emit('updateReaction', { boardId: props.boardId, commentId: props.commentId, isLike: true, isDislike: false }); likeClicked.value = isLike;
dislikeClicked.value = false;
}; };
const handleDislike = () => { const handleDislike = () => {
console.log('싫어요') const isDislike = !dislikeClicked.value;
// emit('updateReaction', { type: 'dislike', boardId: props.boardId, commentId: props.commentId }); const isLike = false;
// dislikeClicked.value = true; emit('updateReaction', { boardId: props.boardId, commentId: props.commentId, isLike, isDislike });
emit('updateReaction', { boardId: props.boardId, commentId: props.commentId, isLike: false, isDislike: true }); dislikeClicked.value = isDislike;
likeClicked.value = false;
}; };
</script> </script>

View File

@ -1,14 +1,7 @@
<template> <template>
<form @submit.prevent="handleSubmit"> <form @submit.prevent="handleSubmit">
<div class="col-xl-12"> <div class="col-xl-12">
<UserFormInput <UserFormInput title="아이디" name="id" :is-alert="idAlert" :useInputGroup="true" @update:data="handleIdChange" :value="id" />
title="아이디"
name="id"
:is-alert="idAlert"
:useInputGroup="true"
@update:data="handleIdChange"
:value="id"
/>
<UserFormInput <UserFormInput
title="비밀번호" title="비밀번호"
@ -63,17 +56,24 @@
}; };
const handleSubmit = async () => { const handleSubmit = async () => {
$api.post('user/login', { $api.post(
loginId: id.value, 'user/login',
password: password.value, {
remember: remember.value, loginId: id.value,
}, { headers: { 'X-Page-Route': route.path } }) password: password.value,
.then(res => { remember: remember.value,
},
{ headers: { 'X-Page-Route': route.path } },
).then(res => {
if (res.status === 200) { if (res.status === 200) {
// TODO:
const sessionCookie = res.data.data;
document.cookie = `JSESSIONID=${sessionCookie};path=/;expires=-1;`;
document.cookie = `JSESSIONID=${sessionCookie};path=/`;
userStore.userInfo(); userStore.userInfo();
router.push('/'); router.push('/');
} }
}) });
}; };
</script> </script>

View File

@ -1,54 +1,54 @@
<template> <template>
<div class="users-list-wrapper"> <div class="card-body d-flex justify-content-center">
<button class="scroll-btn left" @click="scrollLeft"></button> <ul class="list-unstyled d-flex align-items-center gap-7 mb-0 mt-2">
<li
<div class="users-list-container" ref="userListContainer"> v-for="(user, index) in sortedUserList"
<ul class="list-unstyled users-list d-flex align-items-center justify-content-start">
<li
v-for="(user, index) in userList"
:key="index" :key="index"
class="avatar pull-up position-relative"
:class="{ disabled: user.disabled }" :class="{ disabled: user.disabled }"
@click="toggleDisable(index)" @click="toggleDisable(index)"
data-bs-toggle="tooltip"
data-popup="tooltip-custom"
data-bs-placement="top" data-bs-placement="top"
:aria-label="user.MEMBERSEQ" :aria-label="user.MEMBERSEQ"
:data-bs-original-title="getTooltipTitle(user)" >
>
<div class="tooltip-custom">{{ getTooltipTitle(user) }}</div>
<img <img
class="rounded-circle user-avatar" class="rounded-circle user-avatar"
:src="getUserProfileImage(user.MEMBERPRF)" :src="getUserProfileImage(user.MEMBERPRF)"
alt="user" alt="user"
:style="{ borderColor: user.usercolor }" :style="getDynamicStyle(user)"
@error="setDefaultImage" @error="setDefaultImage"
@load="showImage" @load="showImage"
/> />
</li> </li>
</ul> </ul>
</div>
<button class="scroll-btn right" @click="scrollRight"></button>
</div> </div>
</template> </template>
<script setup> <script setup>
import { onMounted, ref, nextTick } from "vue"; import { onMounted, ref, computed, nextTick } from "vue";
import { useUserStore } from "@s/userList"; import { useUserStore } from "@s/useUserStore"; //
import { useUserStore as useUserListStore } from "@s/userList"; //
import $api from "@api"; import $api from "@api";
const emit = defineEmits();
const userStore = useUserStore(); const userStore = useUserStore();
const userList = ref([]); const userListStore = useUserListStore();
const userListContainer = ref(null); //
const baseUrl = $api.defaults.baseURL.replace(/api\/$/, ""); const userList = ref([]);
const defaultProfile = "/img/icons/icon.png"; // const userListContainer = ref(null);
const baseUrl = $api.defaults.baseURL.replace(/api\/$/, "");
const defaultProfile = "/img/icons/icon.png";
const employeeId = ref(null); // ID
//
onMounted(async () => { onMounted(async () => {
await userStore.fetchUserList(); await userStore.userInfo(); //
userList.value = userStore.userList; await userListStore.fetchUserList(); //
userList.value = userListStore.userList;
// ID
if (userStore.user) {
employeeId.value = userStore.user.id;
}
nextTick(() => { nextTick(() => {
const tooltips = document.querySelectorAll('[data-bs-toggle="tooltip"]'); const tooltips = document.querySelectorAll('[data-bs-toggle="tooltip"]');
tooltips.forEach((tooltip) => { tooltips.forEach((tooltip) => {
@ -57,131 +57,51 @@
}); });
}); });
// //
const sortedUserList = computed(() => {
if (!employeeId.value) return userList.value; //
//
const myProfile = userList.value.find(user => user.MEMBERSEQ === employeeId.value);
const otherUsers = userList.value.filter(user => user.MEMBERSEQ !== employeeId.value);
return myProfile ? [myProfile, ...otherUsers] : userList.value;
});
const getUserProfileImage = (profilePath) => { const getUserProfileImage = (profilePath) => {
return profilePath && profilePath.trim() return profilePath && profilePath.trim()
? `${baseUrl}upload/img/profile/${profilePath}` ? `${baseUrl}upload/img/profile/${profilePath}`
: defaultProfile; : defaultProfile;
}; };
//
const setDefaultImage = (event) => { const setDefaultImage = (event) => {
event.target.src = defaultProfile; event.target.src = defaultProfile;
}; };
//
const showImage = (event) => { const showImage = (event) => {
event.target.style.visibility = "visible"; event.target.style.visibility = "visible";
}; };
// //
const getTooltipTitle = (user) => { const profileSize = computed(() => {
return user.MEMBERSEQ === userList.value.MEMBERSEQ ? "나" : user.MEMBERNAM; const totalUsers = userList.value.length;
};
// ( ) if (totalUsers <= 7) return "120px"; // 7
const scrollLeft = () => { if (totalUsers <= 10) return "110px"; // ~10
userListContainer.value.scrollBy({ left: -userListContainer.value.clientWidth, behavior: "smooth" }); if (totalUsers <= 20) return "80px"; // ~20
}; return "60px"; // 20
});
const scrollRight = () => { //
userListContainer.value.scrollBy({ left: userListContainer.value.clientWidth, behavior: "smooth" }); const getDynamicStyle = (user) => {
return {
width: profileSize.value,
height: profileSize.value,
borderWidth: "3px",
borderColor: user.usercolor || "#ccc",
};
}; };
</script> </script>
<style scoped> <style scoped>
/* ✅ 전체 프로필 목록 감싸는 영역 */
.users-list-wrapper {
position: relative;
width: 100%;
max-width: 1250px;
margin: auto;
}
/* ✅ 스크롤 가능하도록 컨테이너 설정 */
.users-list-container {
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
display: flex;
flex-wrap: wrap;
max-height: 200px; /* 한 줄 이상 넘어가지 않도록 조절 */
padding: 50px;
scrollbar-width: none; /* Firefox에서 스크롤바 숨김 */
}
/* ✅ 스크롤바 숨기기 */
.users-list-container::-webkit-scrollbar {
display: none; /* Chrome, Safari에서 스크롤바 숨김 */
}
/* ✅ 프로필 목록 */
.users-list {
display: flex;
flex-wrap: wrap;
gap: 20px; /* 프로필 간격 */
padding: 10px;
}
/* ✅ 프로필 이미지 스타일 */
.user-avatar {
border: 3px solid;
width: 100px;
height: 100px;
object-fit: cover;
background-color: white;
transition: transform 0.2s ease-in-out;
}
/* ✅ 프로필 선택 효과 */
.avatar:hover .user-avatar {
transform: scale(1.1);
}
/* ✅ 툴팁 위치 조정 */
.tooltip-custom {
position: absolute;
top: -30px;
left: 50%;
transform: translateX(-50%);
background: rgba(0, 0, 0, 0.75);
color: white;
padding: 5px 8px;
font-size: 12px;
border-radius: 5px;
white-space: nowrap;
display: none;
}
/* ✅ 툴팁 표시 */
.avatar:hover .tooltip-custom {
display: block;
}
/* ✅ 좌우 스크롤 버튼 */
.scroll-btn {
position: absolute;
top: 50%;
transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0.5);
color: white;
border: none;
cursor: pointer;
padding: 10px 15px;
font-size: 20px;
z-index: 100;
transition: background 0.3s ease;
}
.scroll-btn.left {
left: -40px;
}
.scroll-btn.right {
right: -40px;
}
.scroll-btn:hover {
background-color: rgba(0, 0, 0, 0.8);
}
</style> </style>

View File

@ -1,27 +1,23 @@
<template> <template>
<div class="vacation-management"> <div class="vacation-management">
<div class="container flex-grow-1"> <div class="container-xxl flex-grow-1 container-p-y">
<div class="card app-calendar-wrapper"> <div class="card app-calendar-wrapper">
<div class="row g-0"> <div class="row g-0">
<div class="col app-calendar-content"> <div class="col app-calendar-content">
<div class="card shadow-none border-0"> <div class="card shadow-none border-0">
<ProfileList />
<div class="card-body"> <div class="card-body">
<full-calendar <full-calendar
ref="fullCalendarRef" ref="fullCalendarRef"
:options="calendarOptions" :options="calendarOptions"
class="flatpickr-calendar-only" class="flatpickr-calendar-only"
/> />
<HalfDayButtons
@toggleHalfDay="toggleHalfDay"
@addVacationRequests="addVacationRequests"
/>
</div> </div>
</div> </div>
<ProfileList />
<HalfDayButtons
@toggleHalfDay="toggleHalfDay"
@addVacationRequests="addVacationRequests"
/>
<br />
</div> </div>
</div> </div>
</div> </div>
@ -72,7 +68,6 @@ const calendarEvents = ref([]); // 최종적으로 FullCalendar에 표시할 이
const fetchedEvents = ref([]); // API (, ) const fetchedEvents = ref([]); // API (, )
const selectedDates = ref(new Map()); // const selectedDates = ref(new Map()); //
const halfDayType = ref(null); const halfDayType = ref(null);
const employeeId = ref(1);
// (YYYY-MM-DD ) ( ) // (YYYY-MM-DD ) ( )
const holidayDates = ref(new Set()); const holidayDates = ref(new Set());
@ -216,7 +211,6 @@ if (selectedDates.value.size === 0) {
const vacationRequests = Array.from(selectedDates.value).map(([date, type]) => ({ const vacationRequests = Array.from(selectedDates.value).map(([date, type]) => ({
date, date,
type, type,
employeeId: employeeId.value,
})); }));
try { try {
const response = await axios.post("vacation", vacationRequests); const response = await axios.post("vacation", vacationRequests);