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

This commit is contained in:
kimdaae328 2025-02-20 12:35:46 +09:00
commit 2226782662
8 changed files with 145 additions and 111 deletions

View File

@ -37,7 +37,7 @@ $api.interceptors.response.use(
}, },
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) {
switch (error.response.status) { switch (error.response.status) {

View File

@ -63,7 +63,7 @@
<script setup> <script setup>
import { defineProps, ref } from 'vue'; import { defineProps, ref } from 'vue';
import UserList from '@c/user/UserList.vue'; import UserList from '@c/user/UserList.vue';
import CenterModal from '../modal/CenterModal.vue'; import CenterModal from '@c/modal/CenterModal.vue';
import $api from '@api'; import $api from '@api';
// Props // Props

View File

@ -34,7 +34,7 @@
:is-label="true" :is-label="true"
:is-common="true" :is-common="true"
:data="allColors" :data="allColors"
v-model="selectedProject.projctcolor" v-model="selectedProject.PROJCTCOL"
/> />
<FormInput <FormInput
@ -85,19 +85,23 @@
import FormInput from '@c/input/FormInput.vue'; import FormInput from '@c/input/FormInput.vue';
import FormSelect from '@c/input/FormSelect.vue'; import FormSelect from '@c/input/FormSelect.vue';
import commonApi from '@/common/commonApi'; import commonApi from '@/common/commonApi';
import ArrInput from '../input/ArrInput.vue'; import ArrInput from '@c/input/ArrInput.vue';
import { useUserInfoStore } from '@/stores/useUserInfoStore'; import { useUserInfoStore } from '@/stores/useUserInfoStore';
import { useToastStore } from '@s/toastStore';
const toastStore = useToastStore();
const projectList = ref([]); const projectList = ref([]);
const isModalOpen = ref(false); const isModalOpen = ref(false);
let originalColor = ref('');
const userStore = useUserInfoStore(); const userStore = useUserInfoStore();
const user = ref(null); const user = ref(null);
const nameAlert = ref(false); const nameAlert = ref(false);
const selectedProject = ref({ const selectedProject = ref({
PROJCTSEQ:'',
PROJCTNAM: '', PROJCTNAM: '',
projctcolor: '',
PROJCTSTR: '', PROJCTSTR: '',
PROJCTEND: '', PROJCTEND: '',
PROJCTZIP: '', PROJCTZIP: '',
@ -105,6 +109,7 @@
PROJCTDTL: '', PROJCTDTL: '',
PROJCTDES: '', PROJCTDES: '',
PROJCTCOL: '', PROJCTCOL: '',
projctcolor:'',
}); });
const { colorList } = commonApi({ const { colorList } = commonApi({
@ -124,13 +129,14 @@
const getProjectList = () => { const getProjectList = () => {
$api.get('project/select').then(res => { $api.get('project/select').then(res => {
projectList.value = res.data.data.projectList; projectList.value = res.data.data.projectList;
console.log(projectList.value);
}); });
}; };
const openModal = (post) => { const openModal = (post) => {
isModalOpen.value = true; isModalOpen.value = true;
originalColor.value = post.PROJCTCOL;
selectedProject.value = { ...post }; selectedProject.value = { ...post };
}; };
@ -156,20 +162,23 @@
}; };
}; };
console.log(projectList.PROJCTSEQ)
const handleSubmit = () => { const handleSubmit = () => {
console.log(selectedProject.value.PROJCTCOL)
console.log(originalColor.value)
$api.patch('project/update', { $api.patch('project/update', {
projctSeq: projectList.PROJCTSEQ, projctSeq: selectedProject.value.PROJCTSEQ,
projctNam: selectedProject.value.PROJCTNAM, projctNam: selectedProject.value.PROJCTNAM,
projctCol: selectedProject.value.projctcolor, projctCol: selectedProject.value.PROJCTCOL,
projctArr: selectedProject.value.PROJCTARR, projctArr: selectedProject.value.PROJCTARR,
projctDtl: selectedProject.value.PROJCTDTL, projctDtl: selectedProject.value.PROJCTDTL,
projctZip: selectedProject.value.PROJCTZIP, projctZip: selectedProject.value.PROJCTZIP,
projctStr: selectedProject.value.PROJCTSTR, projctStr: selectedProject.value.PROJCTSTR,
projctEnd: selectedProject.value.PROJCTEND, projctEnd: selectedProject.value.PROJCTEND || null,
projctDes: selectedProject.value.PROJCTDES, projctDes: selectedProject.value.PROJCTDES,
projctUmb: user.value.name, projctUmb: user.value.name,
originalColor: originalColor.value === selectedProject.value.PROJCTCOL ? null : originalColor.value
}).then(res => { }).then(res => {
if (res.status === 200) { if (res.status === 200) {
toastStore.onToast('수정이 완료 되었습니다.', 's'); toastStore.onToast('수정이 완료 되었습니다.', 's');

View File

@ -1,41 +1,41 @@
<template> <template>
<div v-if="isOpen" class="modal-dialog" @click.self="closeModal"> <div v-if="isOpen" class="modal-dialog" @click.self="closeModal">
<div class="modal-content modal-scroll"> <div class="modal-content modal-scroll">
<h5 class="modal-title">📅 연차 사용 내역</h5> <h5 class="modal-title">📅 연차 사용 내역</h5>
<button class="close-btn" @click="closeModal"></button> <button class="close-btn" @click="closeModal"></button>
<!-- 연차 사용 받은 연차 리스트 --> <!-- 연차 사용 받은 연차 리스트 -->
<div class="modal-body" v-if="mergedVacations.length > 0"> <div class="modal-body" v-if="mergedVacations.length > 0">
<ol class="vacation-list"> <ol class="vacation-list">
<li <li v-for="(vacation, index) in mergedVacations" :key="index" class="vacation-item">
v-for="(vacation, index) in mergedVacations" <span v-if="vacation.type === 'used'" class="vacation-index">
:key="index" {{ getVacationIndex(index) }})
class="vacation-item" </span>
> <span :class="vacation.type === 'used' ? 'minus-symbol' : 'plus-symbol'">
<span v-if="vacation.type === 'used'" class="vacation-index"> {{ vacation.type === 'used' ? '-' : '+' }}
{{ totalUsedVacationCount - usedVacations.findIndex(v => v.date === vacation.date) }} ) </span>
</span> <span
<span :class="vacation.type === 'used' ? 'minus-symbol' : 'plus-symbol'"> :style="{ color: userColors[vacation.senderId || vacation.receiverId] || '#000' }"
{{ vacation.type === 'used' ? '-' : '+' }} class="vacation-date"
</span> >
<span :style="{ color: userColors[vacation.senderId || vacation.receiverId] || '#000' }" {{ formatDate(vacation.date) }}
class="vacation-date">{{ formatDate(vacation.date) }}</span> </span>
</li> </li>
</ol> </ol>
</div> </div>
<!-- 연차 데이터 없음 --> <!-- 연차 데이터 없음 -->
<p v-if="mergedVacations.length === 0" class="no-data"> <p v-if="mergedVacations.length === 0" class="no-data">
🚫 사용한 연차가 없습니다. 🚫 사용한 연차가 없습니다.
</p> </p>
</div> </div>
</div> </div>
</template> </template>
<script setup> <script setup>
import { defineProps, defineEmits, computed } from "vue"; import { defineProps, defineEmits, computed } from "vue";
const props = defineProps({ const props = defineProps({
isOpen: Boolean, isOpen: Boolean,
myVacations: { myVacations: {
type: Array, type: Array,
@ -49,121 +49,138 @@
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
}); });
const emit = defineEmits(["close"]); const emit = defineEmits(["close"]);
// // +
const totalUsedVacationCount = computed(() => props.myVacations.length); const usedVacations = computed(() =>
props.myVacations.map(v => ({ ...v, type: "used" }))
);
// + const receivedVacations = computed(() =>
const usedVacations = computed(() => props.myVacations.map(v => ({ ...v, type: "used" }))); props.receivedVacations.map(v => ({ ...v, type: "received" }))
const receivedVacations = computed(() => props.receivedVacations );
.filter(v => !v.senderId) //
.map(v => ({ ...v, type: "received" }))
);
const mergedVacations = computed(() => { //
const mergedVacations = computed(() => {
return [...usedVacations.value, ...receivedVacations.value].sort( return [...usedVacations.value, ...receivedVacations.value].sort(
(a, b) => new Date(b.date) - new Date(a.date) (a, b) => new Date(b.date) - new Date(a.date)
); );
}); });
// (YYYY-MM-DD) // ( )
const formatDate = (dateString) => { const getVacationIndex = (index) => {
let count = 0;
for (let i = 0; i <= index; i++) {
const v = mergedVacations.value[i];
count += v.used_quota; //
}
return count;
};
// (YYYY-MM-DD)
const formatDate = (dateString) => {
const date = new Date(dateString); const date = new Date(dateString);
return date.toISOString().split("T")[0]; // YYYY-MM-DD return date.toISOString().split("T")[0]; // YYYY-MM-DD
}; };
const closeModal = () => { const closeModal = () => {
emit("close"); emit("close");
}; };
</script> </script>
<style scoped> <style scoped>
/* 모달 스타일 */ /* 모달 스타일 */
.modal-dialog { .modal-dialog {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
/* 스크롤 가능한 모달 */ /* 스크롤 가능한 모달 */
.modal-content { .modal-content {
max-height: 60vh; max-height: 60vh;
overflow-y: auto; overflow-y: auto;
padding: 20px; padding: 20px;
width: 75%; width: 75%;
background: white; background: white;
border-radius: 8px; border-radius: 8px;
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
} }
/* 닫기 버튼 */ /* 닫기 버튼 */
.close-btn { .close-btn {
position: absolute; position: absolute;
top: 10px; top: 10px;
right: 10px; right: 10px;
background: none; background: none;
border: none; border: none;
font-size: 18px; font-size: 18px;
cursor: pointer; cursor: pointer;
font-weight: bold; font-weight: bold;
} }
/* 리스트 기본 스타일 */ /* 리스트 기본 스타일 */
.vacation-list { .vacation-list {
list-style-type: none; list-style-type: none;
padding-left: 0; padding-left: 0;
margin-top: 15px; margin-top: 15px;
} }
/* 리스트 아이템 */ /* 리스트 아이템 */
.vacation-item { .vacation-item {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
margin-bottom: 8px; margin-bottom: 8px;
padding: 5px 10px; padding: 5px 10px;
border-radius: 5px; border-radius: 5px;
background: #f9f9f9; background: #f9f9f9;
} }
/* 인덱스 (연차 사용 개수) */ /* 인덱스 (연차 사용 개수) */
.vacation-index { .vacation-index {
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
margin-right: 8px; margin-right: 8px;
color: #333; color: #333;
} }
/* "-" 빨간색 */ /* "-" 빨간색 */
.minus-symbol { .minus-symbol {
color: red; color: red;
font-weight: bold; font-weight: bold;
margin-right: 8px; margin-right: 8px;
} }
/* "+" 파란색 */ /* "+" 파란색 */
.plus-symbol { .plus-symbol {
color: blue; color: blue;
font-weight: bold; font-weight: bold;
margin-right: 8px; margin-right: 8px;
} }
/* 날짜 스타일 */ /* 날짜 스타일 */
.vacation-date { .vacation-date {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
}
/* 연차 유형 스타일 */
.vacation-type {
font-size: 14px;
font-weight: normal;
color: gray;
margin-left: 5px;
} }
/* 연차 데이터 없음 */ /* 연차 데이터 없음 */
.no-data { .no-data {
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
color: gray; color: gray;
margin-top: 10px; margin-top: 10px;
} }
</style> </style>

View File

@ -87,7 +87,7 @@ const localCateList = ref([...props.cateList]);
const selectedCategory = ref(''); const selectedCategory = ref('');
// cateList emit // cateList emit
const emit = defineEmits(['update:cateList']); const emit = defineEmits(['update:cateList','refreshWordList']);
// //
const isWriteVisible = ref(false); const isWriteVisible = ref(false);
@ -126,6 +126,7 @@ const addCategory = (data) => {
} }
} }
// //
const editWord = (data) => { const editWord = (data) => {
console.log('📌 수정할 데이터:', data); console.log('📌 수정할 데이터:', data);
@ -142,15 +143,15 @@ const editWord = (data) => {
axios.patch('worddict/updateWord', { axios.patch('worddict/updateWord', {
WRDDICSEQ: data.id, WRDDICSEQ: data.id,
WRDDICCAT: 600104, WRDDICCAT: data.category,
WRDDICTTL: data.title, WRDDICTTL: data.title,
WRDDICRIK: $common.deltaAsJson(data.content), WRDDICCON: $common.deltaAsJson(data.content),
}) })
.then((res) => { .then((res) => {
if (res.data.data === '1') { if (res.data.data === 1) {
toastStore.onToast('✅ 용어가 수정되었습니다.', 's'); toastStore.onToast('✅ 용어가 수정되었습니다.', 's');
isWriteVisible.value = false; // isWriteVisible.value = false;
// getwordList(); // emit('refreshWordList');
} else { } else {
console.warn('⚠️ 서버 응답이 예상과 다릅니다:', res.data); console.warn('⚠️ 서버 응답이 예상과 다릅니다:', res.data);
toastStore.onToast('용어 수정이 정상적으로 처리되지 않았습니다.', 'e'); toastStore.onToast('용어 수정이 정상적으로 처리되지 않았습니다.', 'e');

View File

@ -73,6 +73,11 @@ const addCategoryAlert = ref(false);
// //
const selectCategory = ref(''); const selectCategory = ref('');
//
const selectedCategory = computed(() =>
selectCategory.value === '' ? props.formValue : selectCategory.value
);
const props = defineProps({ const props = defineProps({
dataList: { dataList: {
type: Array, type: Array,
@ -133,7 +138,7 @@ const saveWord = () => {
const wordData = { const wordData = {
id: props.NumValue || null, id: props.NumValue || null,
title: wordTitle.value, title: wordTitle.value,
category: selectCategory.value, category: selectedCategory.value,
content: content.value, content: content.value,
}; };

View File

@ -99,6 +99,7 @@ const handleProfileClick = async (user) => {
if (user.MEMBERSEQ === userStore.user.id) { if (user.MEMBERSEQ === userStore.user.id) {
// //
const response = await axios.get(`vacation/history`); const response = await axios.get(`vacation/history`);
console.log(response)
if (response.status === 200 && response.data) { if (response.status === 200 && response.data) {
myVacations.value = response.data.data.usedVacations || []; myVacations.value = response.data.data.usedVacations || [];

View File

@ -49,6 +49,7 @@
:key="item.WRDDICSEQ" :key="item.WRDDICSEQ"
:item="item" :item="item"
:cateList="cateList" :cateList="cateList"
@refreshWordList="getwordList"
/> />
</ul> </ul>