'use client' import { VerticalTable } from "@/components/verticalTable"; import { Button, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@common/components/ui"; import { useState } from "react"; const RxTableColumn = [ { id: 'FTR_CDE', title: '지형지물부호' }, { id: 'FTR_IDN', title: '관리번호' }, { id: 'HJD_CDE', title: '행정읍면동코드' }, { id: 'SHT_NUM', title: '도엽번호' }, { id: 'MNG_CDE', title: '관리기관코드' }, { id: 'IST_YMD', title: '설치일자' }, { id: 'SBA_CDE', title: '하수관용도' }, { id: 'MOP_CDE', title: '관재질' }, { id: 'LIT_CDE', title: '규모' }, { id: 'FOR_CDE', title: '시설물형태' }, { id: 'STD_DIP', title: '관경' }, { id: 'STD_HOL', title: '가로길이' }, { id: 'STD_VEL', title: '세로길이' }, { id: 'BYC_LEN', title: '연장' }, { id: 'BEG_DEP', title: '시점깊이' }, { id: 'END_DEP', title: '종점깊이' }, { id: 'SBK_HSL', title: '시점관저고' }, { id: 'SBL_HSL', title: '종점관저고' }, { id: 'PIP_SLP', title: '평균구배' }, { id: 'SPH_LIN', title: '차선통로수' }, { id: 'BST_ARA', title: '우수배수면적' }, { id: 'DRT_ARA', title: '오수배수면적' }, { id: 'SBQ_SPD', title: '우천시유속' }, { id: 'SBR_SPD', title: '청천시유속' }, { id: 'CNT_NUM', title: '공사번호' }, { id: 'BOM_CDE', title: '시점맨홀지형지물부호' }, { id: 'BOM_IDN', title: '시점맨홀관리번호' }, { id: 'EOM_CDE', title: '중점맨홀지형지물부호' }, { id: 'EOM_IDN', title: '중점맨홀관리번호' }, { id: 'SYS_CHK', title: '대장초기화여부' }, { id: 'PIP_LBL', title: '관라벨' }, { id: 'IQT_CDE', title: '탐사구분' }, { id: 'ORG_IDN', title: '기관관리번호' }, { id: 'SRV_CHK', title: '인입관 유무' } ]; const tableData = [ { FTR_CDE: "001", FTR_IDN: "관리번호001", HJD_CDE: "행정코드001", SHT_NUM: "도엽번호001", MNG_CDE: "관리기관001", IST_YMD: "2025-04-16", SBA_CDE: "하수관용도001", MOP_CDE: "관재질001", LIT_CDE: "규모001", FOR_CDE: "시설물형태001", STD_DIP: "300mm", STD_HOL: "500mm", STD_VEL: "1.2m/s", BYC_LEN: "100m", BEG_DEP: "1.5m", END_DEP: "2.0m", SBK_HSL: "50m", SBL_HSL: "48m", PIP_SLP: "2%", SPH_LIN: "2개", BST_ARA: "200㎡", DRT_ARA: "150㎡", SBQ_SPD: "3.5m/s", SBR_SPD: "2.0m/s", CNT_NUM: "공사번호001", BOM_CDE: "맨홀지형지물부호001", BOM_IDN: "맨홀관리번호001", EOM_CDE: "중점맨홀지형지물부호001", EOM_IDN: "중점맨홀관리번호001", SYS_CHK: "초기화여부001", PIP_LBL: "관라벨001", IQT_CDE: "탐사구분001", ORG_IDN: "기관관리번호001", SRV_CHK: "인입관 유무001", }, ]; const inputColumn = [ { id: "title", title: "설치주제", type: "select", options: ["BTL", "재정사업"] }, { id: "guyeok", title: "처리구역", type: "select", options: ["구역1", "구역2"] }, { id: "basu", title: "배수구역", type: "input" }, { id: "bungu", title: "배수분구", type: "input" }, { id: "wltjs", title: "지선/간선", type: "select", options: ["지선", "간선"] }, { id: "flow", title: "흐름방식", type: "select", options: ["자연유하", "압송"] }, { id: "place", title: "매설위치", type: "select", options: ["도로", "하상"] }, ]; const FeatureClickEventPopup = ({ onClose }: { onClose: () => void }) => { // TODO: 런타임 에러 해결 필요 const [repairData, setRepairData] = useState([ { year: "2025", type: "개대체" }, { year: "2025", type: "보수" }, ]); const [cleaningData, setCleaningData] = useState([ { year: "2025", type: "청소" }, { year: "2025", type: "준설" }, ]); const [inspectionData, setInspectionData] = useState([ { year: "2025", type: "관로기술진단" }, { year: "2025", type: "관로기술진단" }, ]); const handleInputChange = (section: string, index: number, field: string, value: string) => { const updateData = (data: { year: string; type: string }[], setData: React.Dispatch>) => { const updated = [...data]; if (updated[index]) { updated[index][field as keyof typeof updated[number]] = value; } setData(updated); }; if (section === "repair") { updateData(repairData, setRepairData); } else if (section === "cleaning") { updateData(cleaningData, setCleaningData); } else if (section === "inspection") { updateData(inspectionData, setInspectionData); } }; const renderSection = (title: string, data: { year: string; type: string }[], sectionKey: string) => (
{/* 섹션 제목 */}

{title}

{/* 테이블 */}
년도 구분 {data.map((row, index) => ( handleInputChange(sectionKey, index, "year", e.target.value)} className="w-full text-xl border-radius-0 px-3 py-2 text-base text-center leading-normal" /> {row.type} ))}
); return ( ) } export default FeatureClickEventPopup;