wr: 중수도 상세 modal 냄새
This commit is contained in:
@@ -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 (
|
||||
<TableRow key={dataIndex + "row"}>
|
||||
{headList.map((head, headIndex) => {
|
||||
//냄새면 계산 못하게 - 로 수정
|
||||
// if (["smll"].includes(head.id)) {
|
||||
// return (
|
||||
// <TableCell
|
||||
// key={head.id + headIndex}
|
||||
// className={`w-36 ${bgClass} text-center !text-xl`}
|
||||
// >
|
||||
// <span>-</span>
|
||||
// </TableCell>
|
||||
// );
|
||||
// }
|
||||
|
||||
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}`}
|
||||
>
|
||||
<Input
|
||||
// className={`${head.id !== "utztnUsgCd" ? "text-right" : "text-center"} !text-xl h-10 w-full`}
|
||||
className={`${textAlignClass} !text-xl h-10 w-full`}
|
||||
onChange={(e) =>
|
||||
handleCommaNumberChange(e, (val) =>
|
||||
handleChange(
|
||||
{head.id === "smll" ? (
|
||||
<Input
|
||||
className="text-center !text-xl h-10 w-full"
|
||||
type="text"
|
||||
onChange={(e) =>
|
||||
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}
|
||||
/>
|
||||
) : (
|
||||
<Input
|
||||
// className={`${head.id !== "utztnUsgCd" ? "text-right" : "text-center"} !text-xl h-10 w-full`}
|
||||
className={`${textAlignClass} !text-xl h-10 w-full`}
|
||||
onChange={(e) =>
|
||||
handleCommaNumberChange(e, (val) =>
|
||||
handleChange(
|
||||
dataIndex,
|
||||
head.id,
|
||||
String(val),
|
||||
setInputData
|
||||
)
|
||||
)
|
||||
}
|
||||
value={formatCommaNumber(data[head.id as keyof any]) ?? ""}
|
||||
maxLength={numSize}
|
||||
/>
|
||||
)}
|
||||
</TableCell>
|
||||
) : (
|
||||
<TableCell
|
||||
@@ -627,4 +653,4 @@ export const pbnstTableBody = (
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -192,7 +192,7 @@ export default function ChkgdExcel({
|
||||
}
|
||||
})
|
||||
.finally(() => setRswtChkLoading(false));
|
||||
console.log("업로드파일 점검 완료");
|
||||
// console.log("업로드파일 점검 완료");
|
||||
}
|
||||
}
|
||||
}, [file]);
|
||||
|
||||
Reference in New Issue
Block a user