From 9c0ca52036e480e6e7e351d6c312999a735f2c15 Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Thu, 27 Mar 2025 10:07:09 +0900 Subject: [PATCH 1/5] =?UTF-8?q?title=EC=98=81=EC=97=AD,=20main=5Fcontents?= =?UTF-8?q?=20=EC=98=81=EC=97=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business_components/src/ui/main_content_div/index.tsx | 2 +- packages/common/business_components/src/ui/title/index.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/main_content_div/index.tsx b/packages/common/business_components/src/ui/main_content_div/index.tsx index d1e818196..1432f472e 100644 --- a/packages/common/business_components/src/ui/main_content_div/index.tsx +++ b/packages/common/business_components/src/ui/main_content_div/index.tsx @@ -2,7 +2,7 @@ export default function MainDiv(props: {children: React.ReactNode}) { return ( -
+
{props.children}
) diff --git a/packages/common/business_components/src/ui/title/index.tsx b/packages/common/business_components/src/ui/title/index.tsx index aaa9d74fd..b496ad55f 100644 --- a/packages/common/business_components/src/ui/title/index.tsx +++ b/packages/common/business_components/src/ui/title/index.tsx @@ -2,7 +2,11 @@ function Title(props: {title: string}) { return ( -

{props.title}

+
+

+ {props.title} +

+
) } From fa209d0c5d3745409a38e708f3d9792f8f3e81ac Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Thu, 27 Mar 2025 11:04:59 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EC=8A=A4=ED=83=80=EC=9D=BC=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=20=EC=A4=91=20(=ED=91=9C=EC=98=81=EC=97=AD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/business_components/src/ui/table/index.tsx | 10 ++++++---- .../common/business_components/src/ui/title/index.tsx | 2 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index d22a5835d..e56bd7a5d 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -24,8 +24,9 @@ export function UiTable({ tableData, headlist, pageSize, total, children, headNa {headName ?
{headName}
: <>} - - +
+
+ {children ? <>{children} : {headlist?.map((head) => ( {head.title} @@ -41,8 +42,9 @@ export function UiTable({ tableData, headlist, pageSize, total, children, headNa ))} -
- {total <= 0 ? <> : } + + {total <= 0 ? <> : } +
); } diff --git a/packages/common/business_components/src/ui/title/index.tsx b/packages/common/business_components/src/ui/title/index.tsx index b496ad55f..5b6d9bff4 100644 --- a/packages/common/business_components/src/ui/title/index.tsx +++ b/packages/common/business_components/src/ui/title/index.tsx @@ -2,11 +2,9 @@ function Title(props: {title: string}) { return ( -

{props.title}

-
) } From 33d82eff22cb66a0a85900e5683f24a9fc6a3dea Mon Sep 17 00:00:00 2001 From: YangJinSoo94 Date: Thu, 27 Mar 2025 13:21:42 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=ED=91=9C=20=EC=8A=A4=ED=83=80=EC=9D=BC=20?= =?UTF-8?q?=EC=99=84=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/common/business_components/src/ui/table/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index e56bd7a5d..b8c2706bc 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -22,9 +22,9 @@ export function UiTable({ tableData, headlist, pageSize, total, children, headNa return ( <> {headName ?
- {headName} +

{headName}

: <>} -
+
{children ? <>{children} : From 01612302ba3b4d742213d0c53d4a8ce9ae488e38 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Thu, 27 Mar 2025 15:20:38 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EC=8B=A0=EA=B7=9C=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=20ui=20=EA=B9=8C=EC=A7=80=20=EC=99=84?= =?UTF-8?q?=EC=84=B1=20css=20=EC=95=84=EC=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/page.tsx | 1 + .../app/ruseFcltMng/fcltReg/rainReg/page.tsx | 2 +- .../lib/type/zod/fcltReg/controlZod.ts | 14 +- .../ui/form/fcltReg/bdstReg/component.tsx | 188 +++++++++++++++--- .../ui/form/fcltReg/rainReg/component.tsx | 41 ++-- .../components/ui/modal/bdstReg/component.tsx | 2 +- .../src/ui/select/index.tsx | 2 +- 7 files changed, 185 insertions(+), 65 deletions(-) diff --git a/apps/wr/app/page.tsx b/apps/wr/app/page.tsx index 385cfb9e8..05a47c53a 100644 --- a/apps/wr/app/page.tsx +++ b/apps/wr/app/page.tsx @@ -1,3 +1,4 @@ +'use client' import Link from "next/link"; import { Button } from "@common/components/ui"; diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index 2f2c72546..b0bcb9708 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -93,7 +93,7 @@ export default function Home() {
- +
diff --git a/apps/wr/components/lib/type/zod/fcltReg/controlZod.ts b/apps/wr/components/lib/type/zod/fcltReg/controlZod.ts index 52e2d8181..9c49e56cd 100644 --- a/apps/wr/components/lib/type/zod/fcltReg/controlZod.ts +++ b/apps/wr/components/lib/type/zod/fcltReg/controlZod.ts @@ -1,7 +1,7 @@ import { z } from "zod"; -const rainZod = { +export const rainZod = { instlCmptnDt: z.date(), instlCst: z.number(), pntfColKnd: z.string(), @@ -20,7 +20,7 @@ const rainZod = { } -const rainDefZod= { +export const rainDefZod= { instlCmptnDt: new Date(), instlCst: 0, pntfColKnd: "", @@ -37,7 +37,7 @@ const rainDefZod= { grntchBdstCertNo: "", grntchBdstCertGrd: "", } -const bdstZod ={ +export const bdstZod ={ ctpvCd: z.string(), // 시도 sggCd: z.string(), // 시군구 daddr: z.string(), // 위치 @@ -51,7 +51,7 @@ const bdstZod ={ bdstNm: z.string(), } -const bdstDefZod={ +export const bdstDefZod={ ctpvCd: '', // 시도 sggCd: '', // 시군구 daddr: '', // 위치 @@ -65,9 +65,3 @@ const bdstDefZod={ bdstNm: '', } -export const rainForm = z.object({ - ...rainZod, - ...bdstZod -}); -export const rainDefault= {...rainDefZod,bdstDefZod}; - \ No newline at end of file diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/component.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/component.tsx index cbc099cb9..3dafc0878 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/component.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/component.tsx @@ -1,32 +1,166 @@ -import { FormField, FormUi } from "@common/business_components"; +import { useWrStore } from "@/app/store"; +import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import { FormField, FormUi, SelectBox } from "@common/business_components"; import { Input } from "@common/components"; +export default function BdstReg(form: any) { + const { code } = useWrStore((state) => { + return state; + }); -export default function BdstReg(form:any){ - - - - - return( - <> -
-
- ( - - +
+
+ ( + + { + field.onChange(val); + }} + value={field.value} + /> + + )} + /> +
+
+ ( + + { + field.onChange(val); + }} + value={field.value} + /> + + )} + /> +
+
+ ( + + field.onChange(e.target.value ? new Date(e.target.value) : undefined)} - value={field.value ? field?.value.toString().split('T')[0] : ""} + placeholder="1,000,000" + type="text" + {...field} /> - - )} - /> -
-
- - ) -} \ No newline at end of file +
+ )} + /> + + +
+
+ + ( + + + + )} + /> + + +
+ ( + + { + field.onChange(val); + }} + value={field.value} + /> + + )} + /> +
+
+ ( + + + + )} + /> +
+
+ ( + + + + )} + /> +
+
+ ( + + { + field.onChange(val); + }} + value={field.value} + /> + + )} + /> +
+
+
+ + ); +} diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx index 49ca89fc2..6139ab5b5 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/component.tsx @@ -9,21 +9,26 @@ import { FormUi } from "@common/business_components"; import { useWrStore } from "@/app/store"; import { selectClass, type rainRuseBd, } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { useEffect } from "react"; -import { rainDefault, rainForm } from "@/components/lib/type/zod/fcltReg/controlZod"; +import { bdstDefZod, bdstZod, rainDefZod, rainZod } from "@/components/lib/type/zod/fcltReg/controlZod"; +import BdstReg from "../bdstReg/component"; -const formSchema = rainForm; +export function RainRegForm({data,isModal}:{data:rainRuseBd[], isModal:boolean} ) { + + console.log(isModal) + const formSchema = isModal + ? z.object({ ...rainZod, ...bdstZod }) + : z.object(rainZod) -console.log(formSchema) -export function RainRegForm({data}:{data:rainRuseBd[]} ) { const { rain ,code} = useWrStore((state) => state); const {rainFcltCd } = code useEffect(() => { if (data && data.length > 0) { console.log(data) - const selectedOption = rainFcltCd.find(item => item.val === String(data[0].pntfColKnd)); + const selectedOption = rainFcltCd.find(item => item.val === String(data[0]?.pntfColKnd ?? "")); const formData = { ...data[0], - pntfColKnd: selectedOption ? selectedOption.val : "" + pntfColKnd: selectedOption ? selectedOption.val : "", + instlCmptnDt: data[0]?.instlCmptnDt ? new Date(data[0].instlCmptnDt) : undefined }; form.reset(formData); } @@ -31,24 +36,8 @@ export function RainRegForm({data}:{data:rainRuseBd[]} ) { const form = useForm>({ resolver: zodResolver(formSchema), - defaultValues: rainDefault - // { - // instlCmptnDt: new Date(), - // instlCst: 0, - // pntfColKnd: "", - // pntfColArea: 0, - // filtrTrtmfctYn: "N", - // filtrTrtmfctCpct: "", - // filtrTrtmfctPrs: "", - // instlCstSprtYn: "", - // instlCstSprtAmt: "", - // grntchCstSprtYn: "", - // grntchCstSprtCst: "", - // grntchBdstCertYn: "", - // grntchBdstCertYr: "", - // grntchBdstCertNo: "", - // grntchBdstCertGrd: "", - // }, + defaultValues: isModal ? {...rainDefZod, ...bdstDefZod} : {...rainDefZod} + }); // form 값이 변경될 때마다 로그 출력 @@ -117,7 +106,9 @@ export function RainRegForm({data}:{data:rainRuseBd[]} ) { )} /> - + + + {isModal? :<>}

빗물이용시설 정보 diff --git a/apps/wr/components/ui/modal/bdstReg/component.tsx b/apps/wr/components/ui/modal/bdstReg/component.tsx index 13ab4df08..e505242ae 100644 --- a/apps/wr/components/ui/modal/bdstReg/component.tsx +++ b/apps/wr/components/ui/modal/bdstReg/component.tsx @@ -62,7 +62,7 @@ export function BdstReg(){

- +
diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index 1f1294666..5762332e8 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -4,7 +4,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ". /** 차트 기본 스타일 */ interface SelectBox1 { - text:string, + text:string|number, val:string } From a263ec0961bc475b8bc1797ef8360d36116e5871 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Thu, 27 Mar 2025 15:24:09 +0900 Subject: [PATCH 5/5] =?UTF-8?q?selectbox1=20val=20=ED=83=80=EC=9E=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20alert=5Fdialog=5Fui=20=EB=B0=8F=20dialog?= =?UTF-8?q?=5Fui=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/ui/{alert_dialog_ui => dialog_ui}/index.tsx | 0 packages/common/business_components/src/ui/select/index.tsx | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/common/business_components/src/ui/{alert_dialog_ui => dialog_ui}/index.tsx (100%) diff --git a/packages/common/business_components/src/ui/alert_dialog_ui/index.tsx b/packages/common/business_components/src/ui/dialog_ui/index.tsx similarity index 100% rename from packages/common/business_components/src/ui/alert_dialog_ui/index.tsx rename to packages/common/business_components/src/ui/dialog_ui/index.tsx diff --git a/packages/common/business_components/src/ui/select/index.tsx b/packages/common/business_components/src/ui/select/index.tsx index 1f1294666..c7fbc5ef0 100644 --- a/packages/common/business_components/src/ui/select/index.tsx +++ b/packages/common/business_components/src/ui/select/index.tsx @@ -5,7 +5,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from ". /** 차트 기본 스타일 */ interface SelectBox1 { text:string, - val:string + val:string|number } const SelectBox = React.forwardRef<