From 657312b4738ee8531ea5ff427aea005e25d72280 Mon Sep 17 00:00:00 2001 From: yoon Date: Fri, 28 Mar 2025 15:58:33 +0900 Subject: [PATCH] =?UTF-8?q?map=20=EA=B3=B5=ED=86=B5=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=20=EB=BA=B4=EA=B8=B0=20=EB=AF=B8=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/custom.css | 2 +- src/components/commuters/CommuterCalendar.vue | 4 +- src/components/list/ProjectCard.vue | 92 +++------------ src/components/map/MapPopover.vue | 109 ++++++++++++++++++ 4 files changed, 125 insertions(+), 82 deletions(-) create mode 100644 src/components/map/MapPopover.vue diff --git a/public/css/custom.css b/public/css/custom.css index d2e01a7..2d61ee1 100644 --- a/public/css/custom.css +++ b/public/css/custom.css @@ -539,7 +539,7 @@ .map { top: -160px; - left: -5px; + left: 90px; } @keyframes sparkle { diff --git a/src/components/commuters/CommuterCalendar.vue b/src/components/commuters/CommuterCalendar.vue index c0d7167..925d5df 100644 --- a/src/components/commuters/CommuterCalendar.vue +++ b/src/components/commuters/CommuterCalendar.vue @@ -63,8 +63,8 @@ {{ commuter.memberName }} -
-
+
+
출근 :
{{ commuter.PROJCTNAM }} diff --git a/src/components/list/ProjectCard.vue b/src/components/list/ProjectCard.vue index a529850..cf627fa 100644 --- a/src/components/list/ProjectCard.vue +++ b/src/components/list/ProjectCard.vue @@ -32,36 +32,19 @@
-
- -
주소
-
-
- {{ address }} {{ addressdtail }} - -
- -
-
- - - -
- - -
-
+ + + +
+ {{ address }} {{ addressdtail }}
@@ -195,6 +178,7 @@ import DeleteBtn from '../button/DeleteBtn.vue'; import FormInput from '@c/input/FormInput.vue'; import FormSelect from '@c/input/FormSelect.vue'; import ArrInput from '@c/input/ArrInput.vue'; +import MapPopover from '@c/map/MapPopover.vue'; import { useToastStore } from '@s/toastStore'; import { useUserInfoStore } from '@/stores/useUserInfoStore'; import commonApi, { refreshColorList } from '@/common/commonApi'; @@ -270,11 +254,7 @@ const emit = defineEmits(['update']); const isModalOpen = ref(false); const logData = ref([]); -// 주소 팝오버 상태 -const isPopoverVisible = ref(false); -const map = ref(); const mapIconRef = ref(null); -const coordinates = ref(null); // 수정 모달 상태 const isEditModalOpen = ref(false); @@ -292,8 +272,6 @@ const selectedUsers = ref({ }); -const isKakaoMapLoaded = ref(false); - const startDateInput = ref(null); const endDateInput = ref(null); @@ -538,43 +516,6 @@ const handleUpdate = async () => { } }; -// 주소를 좌표로 변환하는 함수 -const convertAddressToCoordinates = () => { - if (!window.kakao || !window.kakao.maps) { - return; - } - - const geocoder = new window.kakao.maps.services.Geocoder(); - geocoder.addressSearch(props.address, (result, status) => { - if (status === window.kakao.maps.services.Status.OK) { - coordinates.value = { - lat: parseFloat(result[0].y), - lng: parseFloat(result[0].x) - }; - } - }); -}; - -const onLoadKakaoMap = (mapRef) => { - map.value = mapRef; -}; - -// 지도 확대 -const zoomIn = () => { - if (map.value) { - const level = map.value.getLevel(); - map.value.setLevel(level + 1); - } -}; - -// 지도 축소 -const zoomOut = () => { - if (map.value) { - const level = map.value.getLevel(); - map.value.setLevel(level - 1); - } -}; - // 프로젝트 삭제 const handleDelete = () => { $api.patch('project/delete', { @@ -605,13 +546,6 @@ onMounted(async () => { endInputElement = endDateInput.value.$el.querySelector('input[type="date"]'); } - const checkKakaoMapsLoaded = () => { - if (window.kakao && window.kakao.maps && window.kakao.maps.services) { - convertAddressToCoordinates(); - } - }; - - checkKakaoMapsLoaded(); }); diff --git a/src/components/map/MapPopover.vue b/src/components/map/MapPopover.vue new file mode 100644 index 0000000..c1ba217 --- /dev/null +++ b/src/components/map/MapPopover.vue @@ -0,0 +1,109 @@ + + +