From 46e5ef701dec472ac43a257aa6ac1f258a748ffa Mon Sep 17 00:00:00 2001 From: jyha00 Date: Thu, 10 Jul 2025 11:33:46 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=9E=AC=EC=9D=B4=EC=9A=A9=ED=86=B5?= =?UTF-8?q?=EA=B3=84=20=EC=A1=B0=ED=9A=8C=20=EB=B2=84=ED=8A=BC=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=20=EC=8B=9C=EC=97=90=EB=A7=8C=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=EB=90=98=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/stats/rainStat/page.tsx | 4 ++-- apps/wr/app/stats/rswtStat/page.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/wr/app/stats/rainStat/page.tsx b/apps/wr/app/stats/rainStat/page.tsx index 45d32d3a4..591ea5fdf 100644 --- a/apps/wr/app/stats/rainStat/page.tsx +++ b/apps/wr/app/stats/rainStat/page.tsx @@ -29,7 +29,7 @@ export default function RainStat() { useEffect(() => { searchRainStatList(searchYear); - }, [code.cityCd, code.sggCd, searchRainStatList, searchYear]) + }, [code.cityCd, code.sggCd, searchRainStatList]) const excelDetailDownLoad=() =>{ const sidoList = new Set(); @@ -237,7 +237,7 @@ export default function RainStat() { />
- + + +
+ )} + {fields.map((field, index) => ( +
+ {!readonly && ( +
+ toggleSelect(field.id)} + /> +
+ )} +
+ ( + + f.onChange(val)} + value={f.value ?? code.chBuCd[0]?.val} + className={""} + label={""} + /> + + )} + /> +
+ +
+ ( + + f.onChange(date), + }} + selectClass="w-full" + /> + + )} + /> +
+
+ ( + + f.onChange(e.target.value)} + value={f.value || ''} + className={selectClass} + /> + + )} + /> +
+
+ ))} +
+ + ) +} \ No newline at end of file diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx index 188b1380a..c14bd7d48 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx @@ -28,28 +28,6 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { const [useCityCd, setUserCityCd] = useState([]) const [useSggCd, setUserSggCd] = useState([]) - const { fields, append, remove } = useFieldArray({ - name: "chgBuilding", - control: form?.control, // Provide a fallback to avoid errors - }); - - const plusHist = () => { - append({ - bdstNm: "", - daddr: "", - bdstUsgCd: "", - }); - }; - const removeSelected = () => { - const idxsToRemove = fields - .map((item, idx) => (selectedIds.includes(item.id) ? idx : -1)) - .filter((index) => index > -1) - .sort((prevIndex, nextIndex) => nextIndex - prevIndex); - - remove(idxsToRemove); - setSelectedIds([]); - }; - const [selectSgg, setSelectSgg] = useState(); const [objSearch, setObjSearch] = useState({ sgg: "", @@ -80,9 +58,6 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { } },[form, userSiSggCd, code.cityCd, code.sggCd]) - - - const getSelCity = (val: string) => { const data = getCity(val, code.sggCd); setSelectSgg(data); @@ -110,13 +85,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { return () => subscription?.unsubscribe(); }, [form.form]); - const [selectedIds, setSelectedIds] = useState([]); - const toggleSelect = (id: string) => { - setSelectedIds((prev) => - prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id] - ); - }; useEffect(() =>{ @@ -296,88 +265,7 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { /> -

중축, 개축, 재축

-
- - -
- {fields.map((field, index) => ( -
-
- toggleSelect(field.id)} - /> -
-
- ( - - f.onChange(val)} - value={f.value ?? code.chBuCd[0]?.val} - className={""} - label={""} - /> - - )} - /> -
-
- ( - - f.onChange(date), - }} - selectClass="w-full" - /> - - )} - /> -
-
- ( - - f.onChange} - value={f.value||''} - className={selectClass} - /> - - )} - /> -
-
- ))} -
- + ) : ( <> )} diff --git a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx index be436be82..bb62fee61 100644 --- a/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rainReg/rainRegForm.tsx @@ -20,6 +20,7 @@ import { useForm } from "react-hook-form"; import { z } from "zod"; import BdstReg from "../bdstReg/bdstReg"; import toast from "react-hot-toast"; +import BdstAdd from "../bdstReg/bdstAdd"; export default function RainRegForm({ rainForm, @@ -92,9 +93,6 @@ export default function RainRegForm({ })), }; }; - useEffect(()=>{ - console.log("이즈모달", isModal) - }, []) useEffect(() => { if (grntchBdstCertYn === "N") { @@ -601,6 +599,7 @@ export default function RainRegForm({ /> + diff --git a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx index 33a847565..a3d849b29 100644 --- a/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/rswtrReg/rswtrRegForm.tsx @@ -9,8 +9,7 @@ import { import { formH1Class, formH2Class } from "@/components/lib/class/comClass"; import { formatCommaNumber, - handleCommaNumberChange, - handleMinusNumberChange, + handleMinusNumberChange } from "@/components/lib/func/commom"; import { DatePicker, @@ -22,8 +21,9 @@ import { import { Button, Input, ScrollArea } from "@common/components/ui"; import { zodResolver } from "@hookform/resolvers/zod"; import { useEffect, useState } from "react"; -import { useForm, type UseFormReturn } from "react-hook-form"; +import { useForm } from "react-hook-form"; import { z } from "zod"; +import BdstAdd from "../bdstReg/bdstAdd"; import BdstReg from "../bdstReg/bdstReg"; export default function RswtrRegForm({ @@ -459,9 +459,6 @@ export default function RswtrRegForm({ } }} disabled={grntchBdstCertYn == "N" || grntchBdstCertYn == "D"} - - - /> ) @@ -488,6 +485,7 @@ export default function RswtrRegForm({ /> + From 061b565f7cdb55f773327210e272b816c0589e4c Mon Sep 17 00:00:00 2001 From: jyha00 Date: Thu, 10 Jul 2025 16:49:39 +0900 Subject: [PATCH 3/3] =?UTF-8?q?toast=20=EB=A9=94=EC=84=B8=EC=A7=80=20?= =?UTF-8?q?=ED=86=B5=ED=95=A9=EC=9D=84=20=EC=9C=84=ED=95=9C=20i18n=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/layout.tsx | 21 ++++++++++++++++++--- apps/wr/package.json | 2 ++ apps/wr/public/locales/ko/message.json | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 apps/wr/public/locales/ko/message.json diff --git a/apps/wr/app/layout.tsx b/apps/wr/app/layout.tsx index cb930d6f7..188692837 100644 --- a/apps/wr/app/layout.tsx +++ b/apps/wr/app/layout.tsx @@ -3,23 +3,38 @@ import { BaseLayout } from "@common/components"; import "./globals.css"; import { StoreProvider } from "./store"; import { MainDiv } from "@common/business_components"; +import koBase from '../public/locales/ko/message.json'; +import i18next from "i18next"; +import { I18nextProvider } from "react-i18next"; export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { + i18next.init({ + lng: 'ko', + fallbackLng: 'ko', + resources: { + ko: { + base: koBase, + }, + } + }); + return ( + - + {children} - + + - + ); } diff --git a/apps/wr/package.json b/apps/wr/package.json index 44ba5a06b..78f9dfa95 100644 --- a/apps/wr/package.json +++ b/apps/wr/package.json @@ -16,11 +16,13 @@ "@tanstack/react-table": "^8.21.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", + "i18next": "^25.3.2", "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", + "react-i18next": "^15.6.0", "tailwind-merge": "^3.0.1", "tailwindcss-animate": "^1.0.7", "tus-js-client": "^4.3.1", diff --git a/apps/wr/public/locales/ko/message.json b/apps/wr/public/locales/ko/message.json new file mode 100644 index 000000000..78219a539 --- /dev/null +++ b/apps/wr/public/locales/ko/message.json @@ -0,0 +1,19 @@ +{ + "deleteMsg" : "{{name}}가 삭제되었습니다.", + "insertMsg": "{{name}}가 저장되었습니다.", + "updateMsg": "{{name}}가 수정되었습니다.", + "errorMsg": "{{name}} 중 오류가 발생했습니다.", + "fileErrMsg": "빈 파일 또는 파일 오류입니다.", + "selectErrMsg": "{{name}}을(를) 선택해주세요.", + "noChangedErrMsg": "변경사항이 없습니다.", + "dateErrMsg": "시작년도를 종료년도 이후로 설정할 수 없습니다.", + "fileDateErrMsg": "파일업로드 이전에 등록년도를 작성해주세요.", + + "alreadyInsertedErrMsg": "사업자번호 {{num}}(은)는 이미 등록되었습니다. 다시 등록해주세요.", + "saveRowErrMsg": "수정을 원하는 행을 선택하고 저장버튼을 눌러주세요.", + "costCalcErrMsg":"공사비 계산 진행 후 저장을 눌러주세요", + "maxYearErrMsg": "최대 {{year}}년까지 선택가능합니다.", + "checkQtyMsg": "요구수량(M3/d)을 확인해주세요 계산할수 없습니다." + +} +