휴가관리 수정 및 공통포맷분리

This commit is contained in:
dyhj625 2025-02-25 12:29:35 +09:00
parent efbeee855a
commit b0735cfec0
5 changed files with 21 additions and 24 deletions

View File

@ -3,7 +3,7 @@ import { useRoute } from 'vue-router';
import { useToastStore } from '@s/toastStore';
const $api = axios.create({
baseURL: 'https://192.168.0.251:10325/api/',
baseURL: 'http://localhost:10325/api/',
timeout: 300000,
withCredentials: true,
});

View File

@ -0,0 +1,13 @@
/** 날짜 포맷1 (YYYY-MM-DD HH:MM) */
export const formattedDate = (dateString) => {
if (!dateString) return "날짜 없음";
const dateObj = new Date(dateString);
return `${dateObj.getFullYear()}-${String(dateObj.getMonth() + 1).padStart(2, '0')}-${String(dateObj.getDate()).padStart(2, '0')} ${String(dateObj.getHours()).padStart(2, '0')}:${String(dateObj.getMinutes()).padStart(2, '0')}`;
};
/** 날짜 포맷2 (YYYY-MM-DD) */
export const formatDate = (dateString) => {
if (!dateString) return "날짜 없음";
const dateObj = new Date(dateString);
return `${dateObj.getFullYear()}-${String(dateObj.getMonth() + 1).padStart(2, '0')}-${String(dateObj.getDate()).padStart(2, '0')}`;
};

View File

@ -41,6 +41,7 @@
<script setup>
import { defineProps, defineEmits, computed } from "vue";
import { formatDate } from '@/common/formattedDate.js';
const props = defineProps({
isOpen: Boolean,
@ -130,14 +131,6 @@ const mergedVacations = computed(() => {
return all;
});
/** 날짜 포맷 (YYYY-MM-DD) */
const formatDate = (dateString) => {
if (!dateString) return "";
// dateString "YYYY-MM-DD"
// "YYYY-MM-DD..." 10
return dateString.substring(0, 10);
};
/** 모달 닫기 */
const closeModal = () => {

View File

@ -156,15 +156,6 @@
if (titleEl) {
titleEl.style.cursor = 'pointer';
titleEl.addEventListener('click', () => {
//
const rect = titleEl.getBoundingClientRect();
const dpEl = calendarDatepicker.value;
dpEl.style.display = 'none';
dpEl.style.position = 'absolute';
dpEl.style.top = (rect.bottom + window.scrollY -120) + 'px';
// dpEl.style.left = (rect.left) + 'px';
dpEl.style.width = '0px'; //
dpEl.style.fontSize = '0.9em';
fpInstance.open();
});
}

View File

@ -2,7 +2,7 @@ import { fileURLToPath, URL } from 'node:url';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueDevTools from 'vite-plugin-vue-devtools';
import mkcert from 'vite-plugin-mkcert';
//import mkcert from 'vite-plugin-mkcert';
// https://vite.dev/config/
export default defineConfig({
@ -10,11 +10,11 @@ export default defineConfig({
vue(),
vueDevTools(),
// 자신의 로컬 서버에 연결하려면 이부분 주석처리
mkcert({
// SSL 키 등록
keyFile: '/localhost-key.pem',
certFile: '/localhost.pem',
}),
// mkcert({
// // SSL 키 등록
// keyFile: '/localhost-key.pem',
// certFile: '/localhost.pem',
// }),
],
resolve: {
alias: {