이름 -> 프로젝트명

This commit is contained in:
yoon 2025-03-25 17:43:46 +09:00
parent cf52ab8a1b
commit a391d677bd
2 changed files with 25 additions and 25 deletions

View File

@ -94,7 +94,7 @@
<template #title> 프로젝트 수정 </template>
<template #body>
<FormInput
title="이름"
title="프로젝트명"
name="name"
:is-essential="true"
:is-alert="nameAlert"
@ -538,30 +538,19 @@ const handleUpdate = async () => {
//
const convertAddressToCoordinates = () => {
// kakao maps API
if (window.kakao && window.kakao.maps) {
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)
};
} else {
// ()
coordinates.value = {
lat: 37.2108651707078,
lng: 127.089445559923
};
}
});
} else {
//
coordinates.value = {
lat: 37.2108651707078,
lng: 127.089445559923
};
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) => {
@ -615,6 +604,17 @@ onMounted(async () => {
if (endDateInput.value) {
endInputElement = endDateInput.value.$el.querySelector('input[type="date"]');
}
// Kakao Maps API
const checkKakaoMapsLoaded = () => {
if (window.kakao && window.kakao.maps) {
convertAddressToCoordinates();
} else {
setTimeout(checkKakaoMapsLoaded, 500);
}
};
checkKakaoMapsLoaded();
});

View File

@ -37,7 +37,7 @@
<template #title> 프로젝트 등록 </template>
<template #body>
<FormInput
title="이름"
title="프로젝트명"
name="name"
:is-essential="true"
:is-alert="nameAlert"