This commit is contained in:
yoon 2025-03-31 17:20:16 +09:00
parent 19777906a4
commit 12297153e4
3 changed files with 36 additions and 6 deletions

View File

@ -70,6 +70,8 @@
출근 :
<MapPopover
:address="commuter.projectAddress"
:is-visible="visiblePopover.type === 'project' && visiblePopover.index === index"
@update-visible="updatePopover('project', index)"
v-if="commuter.projectAddress"
>
<template #trigger>
@ -90,6 +92,8 @@
퇴근 :
<MapPopover
:address="commuter.leaveProjectAddress"
:is-visible="visiblePopover.type === 'leave' && visiblePopover.index === index"
@update-visible="updatePopover('leave', index)"
v-if="commuter.leaveProjectAddress"
>
<template #trigger>
@ -154,6 +158,12 @@ const checkedInProject = ref(null);
const isModalOpen = ref(false);
const visiblePopover = ref({
type: null, // 'project' 'leave'
index: null //
});
const commuters = ref([]);
const monthlyCommuters = ref([]);
@ -429,6 +439,17 @@ const closeModal = () => {
isModalOpen.value = false;
};
// MapPopover visible
const updatePopover = (popoverType, index) => {
if (visiblePopover.value.type === popoverType && visiblePopover.value.index === index) {
//
visiblePopover.value = { type: null, index: null };
} else {
//
visiblePopover.value = { type: popoverType, index: index };
}
};
const selectedDateCommuters = computed(() => {
return monthlyCommuters.value.filter(commuter =>
commuter.COMMUTDAY === eventDate.value

View File

@ -34,7 +34,8 @@
<div class="d-flex flex-sm-row align-items-center pb-2">
<MapPopover
:address="address"
:ref="mapIconRef"
:is-visible="isMapVisible"
@update-visible="updatePopover"
>
<template #trigger>
<div class="d-flex align-items-center cursor-pointer">
@ -253,7 +254,7 @@ const emit = defineEmits(['update']);
const isModalOpen = ref(false);
const logData = ref([]);
const mapIconRef = ref(null);
const isMapVisible = ref(null);
//
const isEditModalOpen = ref(false);
@ -291,6 +292,9 @@ const openEndDatePicker = () => {
}
};
const updatePopover = (visible) => {
isMapVisible.value = visible;
};
//
const handleEditUserListUpdate = (userLists) => {

View File

@ -47,12 +47,17 @@
const props = defineProps({
address: {
type: String,
required: true
type: String,
required: true
},
isVisible: {
type: Boolean,
required: false
}
});
const isVisible = ref(false);
const emit = defineEmits(['update-visible']);
const coordinates = ref(null);
const map = ref(null);
@ -79,7 +84,7 @@
};
const togglePopover = () => {
isVisible.value = !isVisible.value;
emit('update-visible', !props.isVisible);
};
const onLoadKakaoMap = (mapRef) => {