diff --git a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx index 18c065ee2..0f919a603 100644 --- a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx +++ b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx @@ -8,7 +8,7 @@ import { } from "@/components/lib/func/commom"; import { - DatePicker, + // DatePicker, FormField, FormUi, SelectBox, @@ -24,6 +24,7 @@ import { TableHeader, TableRow, } from "@common/components/ui"; +import moment from "moment"; import React from "react"; type RuseMngTableProps = { @@ -49,14 +50,17 @@ const RuseMngTableForm = React.forwardRef( form, formNm, indexBiz, - readonly= false + readonly = false, }, ref ) => { return ( <> - +
{upHeadList ? ( headMakeprfmnc(headList, upHeadList) @@ -76,20 +80,20 @@ const RuseMngTableForm = React.forwardRef( {tableData.map((item, i) => ( - + {headList.map((head, j) => ( { }} + onClick={() => {}} > = 0 && - typeof indexBiz === "number" && - indexBiz >= 0 + indexMng >= 0 && + typeof indexBiz === "number" && + indexBiz >= 0 ? `items.${indexMng}.fcBizs.${indexBiz}.${formNm}.${i}.${head.id}` : typeof indexMng === "number" && indexMng >= 0 ? `items.${indexMng}.${formNm}.${i}.${head.id}` @@ -99,7 +103,7 @@ const RuseMngTableForm = React.forwardRef( {head.edit === true ? ( { if (head.type === "number") { @@ -113,8 +117,10 @@ const RuseMngTableForm = React.forwardRef( ? formatCommaNumber(field.value) : field.value || "" } - readOnly={readonly|| head.readonly ? true : false} - maxLength={head.maxLength?head.maxLength:15} + readOnly={ + readonly || head.readonly ? true : false + } + maxLength={head.maxLength ? head.maxLength : 15} /> ) : head.type === "select" ? ( ( field.onChange(val); } }} - readOnly={ readonly||head.readonly ? true : false} - // Disabled prop removed as SelectBox does not support it + readOnly={ + readonly || head.readonly ? true : false + } + // Disabled prop removed as SelectBox does not support it > ) : head.type === "date" ? ( - { - console.log("date", date); - field.onChange(date); // readonly 상태가 아닐 때만 값 변경 - }, + // { + // console.log("date", date); + // field.onChange(date); // readonly 상태가 아닐 때만 값 변경 + // }, + // }} + // selectClass={"w-full"} + // readOnly={readonly||head.readonly ? true : false} + // /> + { + // 브라우저에서 선택한 값은 "YYYY-MM-DD" + const date = new Date(e.target.value); // e.g. "2025-06-01" + field.onChange(date); }} - selectClass={"w-full"} + value={ + field.value? moment(field.value, "YYYYMMDD").format( "YYYY-MM-DD"): "" + } + className={"w-full text-gray-600"} readOnly={readonly||head.readonly ? true : false} /> ) : head.type === "checkbox" ? ( @@ -158,22 +179,19 @@ const RuseMngTableForm = React.forwardRef( className="" checked={field.value || false} onCheckedChange={(checked) => { - if(readonly || head.readonly) { + if (readonly || head.readonly) { return; - }else{ + } else { field.onChange(checked); } }} > ) : ( - ( - - { - head.type === "number" + + {head.type === "number" ? formatCommaNumber(field.value) - : field.value || "" - } - ) + : field.value || ""} + )} )}