From a19c5c269ade6d269bee5bee45c854f62f08639e Mon Sep 17 00:00:00 2001 From: jyha00 Date: Tue, 22 Jul 2025 13:37:35 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A7=80=EB=8F=84=EC=A0=90=EA=B2=80=20?= =?UTF-8?q?=ED=85=8C=EC=9D=B4=EB=B8=94=20=EC=9E=AC=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chkgdnReg/rainChkgdn/headList.tsx | 2 +- apps/wr/components/lib/func/TableData.tsx | 53 ++++++++++++------- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx index 29a2de0db..d216b88f6 100644 --- a/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx +++ b/apps/wr/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList.tsx @@ -195,7 +195,7 @@ export const rainChkgdnHeadListExport: TableUpperProps[] = [ title: "부과금액(천원)", upName: "feeHist", upSequnce: 3, - type: "number", + type: "text", edit: true, }, ]; diff --git a/apps/wr/components/lib/func/TableData.tsx b/apps/wr/components/lib/func/TableData.tsx index 8599fec01..24e6349a9 100644 --- a/apps/wr/components/lib/func/TableData.tsx +++ b/apps/wr/components/lib/func/TableData.tsx @@ -3,7 +3,7 @@ import type { TableUpperProps } from "@/app/store/common/type/header"; import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn"; import type { rswtChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn"; import { Checkbox, Input, TableCell, TableRow } from "@common/components/ui"; -import { formatCommaNumber } from "./commom"; +import { formatCommaNumber, handleCommaNumberChange } from "./commom"; export const rainChkTableData = (chkData: rainChkZodType[]) => { // 1. chkgdnSn + utztnUsgCd 기준 누계 정보 만들기 @@ -161,22 +161,40 @@ export const chRowspanTable = ( onClick={() => handleCellClick(rowIndex, head.id)} > {head.edit === true ? ( - { - handleChange(rowIndex, head.id, e.target.value); - }} - value={value || ""} - disabled={!selectedIds.includes(row.chkgdnSn)} - maxLength={numSize} - //input type number일때 slice 처리 - onInput={(e: React.ChangeEvent) => { - if (head.type === 'number' && e.target.value.length > numSize) { - e.target.value = e.target.value.slice(0, numSize); - } - }} - /> + (["levyAmt", "anlOperCst", "dtfcltCpct", "prcsCpct"].includes(head.id)) ? ( + { + handleCommaNumberChange(e, val => + handleChange(rowIndex, head.id, val)) + }} + value={formatCommaNumber(value) || ""} + disabled={!selectedIds.includes(row.chkgdnSn)} + maxLength={numSize} + onInput={(e: React.ChangeEvent) => { + if (head.type === 'number' && e.target.value.length > numSize) { + e.target.value = e.target.value.slice(0, numSize); + } + }} + /> + ) : ( + { + handleChange(rowIndex, head.id, e.target.value); + }} + value={value || ""} + disabled={!selectedIds.includes(row.chkgdnSn)} + maxLength={numSize} + onInput={(e: React.ChangeEvent) => { + if (head.type === 'number' && e.target.value.length > numSize) { + e.target.value = e.target.value.slice(0, numSize); + } + }} + /> + ) ) : ( (["totalSplyUswtrUtztnQnt", "totalRuseFcltUtztnQnt", "splyUswtrUtztnQnt", "ruseFcltUtztnQnt", "levyAmt"].includes(head.id)) ? ( @@ -188,7 +206,6 @@ export const chRowspanTable = ( )} ); - })} ))) : (