diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx index 5435ef8bf..62532385f 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/headList.tsx @@ -17,10 +17,10 @@ export const pubFacHeadListExport: TableUpperProps[] = [ ]; export const pbnstMngUpHeadListExport: TableUpperProps[] = [ - { id: "operMthd", title: "운영방식" }, - { id: "rprtvBzenty", title: "대행업체" }, - { id: "bgngDt", title: "시작일", upName: "upChangeRe", upSequnce: 1 }, - { id: "endDt", title: "종료일", upName: "upChangeRe", upSequnce: 2 }, + { id: "operMthd", title: "운영방식", edit: true}, + { id: "rprtvBzenty", title: "대행업체", edit: true}, + { id: "bgngDt", title: "시작일", upName: "upChangeRe", upSequnce: 1, type: "date"}, + { id: "endDt", title: "종료일", upName: "upChangeRe", upSequnce: 2, type: "date"}, ]; diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index 247e66103..1061a1df3 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -36,7 +36,7 @@ const formSchema = z.object({ }); export function PbnstMngForm({ data }: { data: customPbnst }) { - const { pbnst, pbnstUpdate } = useWrStore((state) => state); + const { pbnst ,pbnstUpdate} = useWrStore((state) => state); const { pbnstMngUpHeadList} = pbnst; const [ruseOperData, setRuseOperData] = useState(); const [planFiles, setPlanFiles] = useState(null); diff --git a/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx b/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx index 0774f6226..5eabc06bb 100644 --- a/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx +++ b/apps/wr/components/ui/table/pbnstReg/ruseMngTable/ruseMngTable.tsx @@ -1,7 +1,7 @@ import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead"; import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList"; import { selectClass, type TableUpperProps } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; -import { SelectBox, type SelectDataType } from "@common/business_components/ui"; +import { DatePicker, SelectBox, type SelectDataType } from "@common/business_components/ui"; import { Input, Table, @@ -11,6 +11,8 @@ import { TableHeader, TableRow, } from "@common/components/ui"; +import moment from "moment"; +import { useState } from "react"; export default function RuseMngTable({ tableData, @@ -23,8 +25,7 @@ export default function RuseMngTable({ upHeadList?: chHeadType[]; code?:{name:string, val:SelectDataType[] }[] }) { - - +const [tableState, setTableState] = useState([...tableData]); return ( <> @@ -44,11 +45,11 @@ export default function RuseMngTable({ - {tableData.map((item, index) => ( - - {headList.map((head, index) => ( + {tableState.map((item, i) => ( + + {headList.map((head, j) => ( {}} > @@ -64,16 +65,32 @@ export default function RuseMngTable({ label="" selectArray={code.find(item => item.name === head.selectData)?.val ?? []} value={ - tableData[index][item[head.id]] + item[head.id] } className={""} selectClass={selectClass} onSelectValue={(val) => { - tableData[index][head.id] = val; + setTableState((prev)=>{ + prev[i][head.id] = val + return [...prev] + }) }} > - ) - : ( + ) : head.type === "date" ? ( + { + item[head.id] = moment(date).format('yyyyMMdd'); + } + }} + selectClass={"w-full"} + /> + ) : ( `${item[head.id] || ""}` )} diff --git a/apps/wr/package.json b/apps/wr/package.json index 58a01dc42..44ba5a06b 100644 --- a/apps/wr/package.json +++ b/apps/wr/package.json @@ -17,6 +17,7 @@ "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "lucide-react": "^0.474.0", + "moment": "^2.30.1", "next": "15.1.7", "react-hook-form": "^7.54.2", "react-hot-toast": "^2.5.2",