diff --git a/apps/wr/components/lib/func/TableData.tsx b/apps/wr/components/lib/func/TableData.tsx index f17af3a7f..b2411eea4 100644 --- a/apps/wr/components/lib/func/TableData.tsx +++ b/apps/wr/components/lib/func/TableData.tsx @@ -314,6 +314,25 @@ const handleChange = ( ); }; +const handleTextChange = ( + rowIndex: number, + field: any, + value: string, + setInputData: (data: any) => void +) => { + setInputData((prevData: any) => + prevData?.map((row: any, index: number) => { + if (index === rowIndex) { + return { + ...row, + [field]: value, + }; + } + return row; + }) + ); +}; + // 재이용실적등록 > 지도점검결과 등록 - 상세 modal의 body export const InputTableBody = ( @@ -350,17 +369,7 @@ export const InputTableBody = ( return ( {headList.map((head, headIndex) => { - //냄새면 계산 못하게 - 로 수정 - // if (["smll"].includes(head.id)) { - // return ( - // - // - - // - // ); - // } + const isTextColumn = head.id === "구분" || head.id === "utztnUsgCdText"; const textAlignClass = isTextColumn ? "text-center" @@ -419,22 +428,39 @@ export const InputTableBody = ( key={head.id + headIndex} className={`w-36 ${bgClass}`} > - - handleCommaNumberChange(e, (val) => - handleChange( + {head.id === "smll" ? ( + + handleTextChange( dataIndex, head.id, - String(val), + e.target.value, setInputData ) - ) - } - value={formatCommaNumber(data[head.id as keyof any]) ?? ""} - maxLength={numSize} - /> + } + value={String(data[head.id as keyof any] ?? "")} + maxLength={numSize} + /> + ) : ( + + handleCommaNumberChange(e, (val) => + handleChange( + dataIndex, + head.id, + String(val), + setInputData + ) + ) + } + value={formatCommaNumber(data[head.id as keyof any]) ?? ""} + maxLength={numSize} + /> + )} ) : ( ); -}; \ No newline at end of file +}; diff --git a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx index 595cff55e..0e4152db6 100644 --- a/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx +++ b/apps/wr/components/ui/modal/chkgd/chkgdExcel/chkgdExcel.tsx @@ -192,7 +192,7 @@ export default function ChkgdExcel({ } }) .finally(() => setRswtChkLoading(false)); - console.log("업로드파일 점검 완료"); + // console.log("업로드파일 점검 완료"); } } }, [file]);