이름 -> 프로젝트명
This commit is contained in:
parent
cf52ab8a1b
commit
a391d677bd
@ -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();
|
||||
});
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
<template #title> 프로젝트 등록 </template>
|
||||
<template #body>
|
||||
<FormInput
|
||||
title="이름"
|
||||
title="프로젝트명"
|
||||
name="name"
|
||||
:is-essential="true"
|
||||
:is-alert="nameAlert"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user