From bde50388d1fa90939167543fb5beae71cfa4438b Mon Sep 17 00:00:00 2001 From: yschoi Date: Mon, 11 Aug 2025 09:34:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=9C=EC=84=A4=EC=9A=A9=EB=9F=89=20?= =?UTF-8?q?=EC=B2=9C=EB=8B=A8=EC=9C=84=20=EC=BD=A4=EB=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fo/app/pages/(map-layout)/map/page.tsx | 23 +++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/fo/app/pages/(map-layout)/map/page.tsx b/apps/fo/app/pages/(map-layout)/map/page.tsx index d27dbe834..f41439b92 100644 --- a/apps/fo/app/pages/(map-layout)/map/page.tsx +++ b/apps/fo/app/pages/(map-layout)/map/page.tsx @@ -73,6 +73,17 @@ const Map = () => { fetchData(); }, []); + function formatWithCommas(value: any) { + if (value === null || value === undefined) return value; + const num = Number(value); + return isNaN(num) ? value : num.toLocaleString(); + } + + function formatDateString(dateStr: string) { + if (typeof dateStr !== "string" || dateStr.length !== 8) return dateStr; + return `${dateStr.slice(0, 4)}-${dateStr.slice(4, 6)}-${dateStr.slice(6)}`; + } + // ===== 오버레이 콘텐츠 빌더 ===== const buildOverlayContent = (layerType: string, feature: FeatureData) => { const props: Record = {}; @@ -84,9 +95,9 @@ const Map = () => { if (layerType === "tb_il_swage_prcs_fclt") { // 하수처리시설 props["하수처리시설명"] = mayGet("swtrmt_fclt_nm"); - props["시설용량(m³/d)"] = mayGet("fclt_cpct"); + props["시설용량(m³/d)"] = formatWithCommas(mayGet("fclt_cpct")); props["주소"] = mayGet("rdnm_addr"); - props["가동개시일"] = mayGet("oprtng_strt_ymd"); + props["가동개시일"] = formatDateString(mayGet("oprtng_strt_ymd")); props["공법"] = mayGet("rprs_msrc_cn"); } else if (layerType === "tb_ms_swage_prcs_zone") { // 처리구역(존) @@ -116,14 +127,14 @@ const Map = () => {
${title}
${Object.entries(props) - .map( - ([k, v]) => ` + .map( + ([k, v]) => ` ` - ) - .join("")} + ) + .join("")}
${k} ${safe(v)}
`; return el;