휴가 수정
This commit is contained in:
parent
4c01039581
commit
28067c7f02
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="isOpen" class="vac-modal-dialog" @click.self="closeModal">
|
<div v-if="isOpen" class="vac-modal-dialog" @click.self="closeModal">
|
||||||
<div class="vac-modal-content p-5 modal-scroll">
|
<div class="vac-modal-content p-5 modal-scroll">
|
||||||
<h5 class="vac-modal-title">📅 내 연차 내역</h5>
|
<h5 class="vac-modal-title">📅 내 연차 (누적 개수)</h5>
|
||||||
<button class="close-btn" @click="closeModal">✖</button>
|
<button class="close-btn" @click="closeModal">✖</button>
|
||||||
<!-- 연차 목록 -->
|
<!-- 연차 목록 -->
|
||||||
<div class="vac-modal-body" v-if="mergedVacations.length > 0">
|
<div class="vac-modal-body" v-if="mergedVacations.length > 0">
|
||||||
@ -11,9 +11,6 @@
|
|||||||
:key="vac._expandIndex"
|
:key="vac._expandIndex"
|
||||||
class="vacation-item"
|
class="vacation-item"
|
||||||
>
|
>
|
||||||
<span v-if="vac.category === 'used'" class="fw-bold text-dark me-2">
|
|
||||||
{{ usedVacationIndexMap[vac._expandIndex] }})
|
|
||||||
</span>
|
|
||||||
<span :class="vac.category === 'used' ? 'fw-bold text-danger me-2' : 'fw-bold text-primary me-2'">
|
<span :class="vac.category === 'used' ? 'fw-bold text-danger me-2' : 'fw-bold text-primary me-2'">
|
||||||
{{ vac.category === 'used' ? '-' : '+' }}
|
{{ vac.category === 'used' ? '-' : '+' }}
|
||||||
</span>
|
</span>
|
||||||
@ -22,6 +19,9 @@
|
|||||||
>
|
>
|
||||||
{{ formatDate(vac.date) }}
|
{{ formatDate(vac.date) }}
|
||||||
</span>
|
</span>
|
||||||
|
<span v-if="vac.category === 'used'" class="fw-bold text-dark ms-1">
|
||||||
|
( {{ usedVacationIndexMap[vac._expandIndex] }} )
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -122,7 +122,7 @@ const router = createRouter({
|
|||||||
router.beforeEach(async (to, from, next) => {
|
router.beforeEach(async (to, from, next) => {
|
||||||
const authStore = useAuthStore();
|
const authStore = useAuthStore();
|
||||||
await authStore.checkAuthStatus(); // 로그인 상태 확인
|
await authStore.checkAuthStatus(); // 로그인 상태 확인
|
||||||
const allowedUserId = 26; // 특정 ID (변경필요!!)
|
const allowedUserId = 1; // 특정 ID (변경필요!!)
|
||||||
const userStore = useUserInfoStore();
|
const userStore = useUserInfoStore();
|
||||||
const userId = userStore.user?.id ?? null;
|
const userId = userStore.user?.id ?? null;
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
<h5>{{ user.name }}</h5>
|
<h5>{{ user.name }}</h5>
|
||||||
</div>
|
</div>
|
||||||
<!-- 권한 토글 버튼 -->
|
<!-- 권한 토글 버튼 -->
|
||||||
<label class="switch">
|
<label class="switch me-0">
|
||||||
<input type="checkbox" :checked="user.isAdmin" @change="toggleAdmin(user)" />
|
<input type="checkbox" :checked="user.isAdmin" @change="toggleAdmin(user)" />
|
||||||
<span class="slider round"></span>
|
<span class="slider round"></span>
|
||||||
</label>
|
</label>
|
||||||
@ -32,7 +32,7 @@ const users = ref([]);
|
|||||||
const toastStore = useToastStore();
|
const toastStore = useToastStore();
|
||||||
const baseUrl = axios.defaults.baseURL.replace(/api\/$/, "");
|
const baseUrl = axios.defaults.baseURL.replace(/api\/$/, "");
|
||||||
const defaultProfile = "/img/icons/icon.png";
|
const defaultProfile = "/img/icons/icon.png";
|
||||||
|
const allowedUserId = 1; // 특정 ID (변경필요!!)
|
||||||
// 사용자 목록 가져오기
|
// 사용자 목록 가져오기
|
||||||
async function fetchUsers() {
|
async function fetchUsers() {
|
||||||
try {
|
try {
|
||||||
@ -43,14 +43,17 @@ async function fetchUsers() {
|
|||||||
throw new Error("올바른 데이터 형식이 아닙니다.");
|
throw new Error("올바른 데이터 형식이 아닙니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 데이터 매핑 (올바른 형식으로 변환)
|
// MEMBERSEQ가 1이 아닌 회원만 필터링하여 데이터 매핑
|
||||||
users.value = response.data.data.map(user => ({
|
users.value = response.data.data
|
||||||
|
.filter(user => user.MEMBERSEQ !== allowedUserId) // MEMBERSEQ가 1이면 제외
|
||||||
|
.map(user => ({
|
||||||
id: user.MEMBERSEQ,
|
id: user.MEMBERSEQ,
|
||||||
name: user.MEMBERNAM,
|
name: user.MEMBERNAM,
|
||||||
photo: user.MEMBERPRF ? `${baseUrl}upload/img/profile/${user.MEMBERPRF}` : defaultProfile,
|
photo: user.MEMBERPRF ? `${baseUrl}upload/img/profile/${user.MEMBERPRF}` : defaultProfile,
|
||||||
color: user.MEMBERCOL,
|
color: user.MEMBERCOL,
|
||||||
isAdmin: user.MEMBERROL === 'ROLE_ADMIN',
|
isAdmin: user.MEMBERROL === 'ROLE_ADMIN',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toastStore.onToast('사용자 목록을 불러오지 못했습니다.', 'e');
|
toastStore.onToast('사용자 목록을 불러오지 못했습니다.', 'e');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user