From e30a7d184b9e748154d06b12d58e88726e49cf7d Mon Sep 17 00:00:00 2001 From: leedj312 Date: Tue, 22 Jul 2025 15:57:20 +0900 Subject: [PATCH 1/4] =?UTF-8?q?=EA=B6=8C=ED=95=9C=20=EC=B2=B4=ED=81=AC=20?= =?UTF-8?q?=EC=9E=91=EC=97=85=EC=A4=91=20=EC=9E=91=EC=97=85=ED=95=B4?= =?UTF-8?q?=EC=95=BC=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ruseFcltMng/fcltReg/pbnstReg/page.tsx | 46 +++++++++++-------- .../prfmncSttn/chkgdnSttn/page.tsx | 2 + apps/wr/app/store/common/auth/index.tsx | 17 +------ 3 files changed, 29 insertions(+), 36 deletions(-) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 5a962fc0a..05714a336 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -47,8 +47,10 @@ export default function PublicReuseFaciltyInsert() { pubHasuSearch, pbnstRuseBizUpdate, } = useWrStore((state) => state); + const { t } = useTranslation("base"); const { pubFacHeadList, pbnstHasuResCount, pbnstHasuRes, pbnstRes } = pbnst; + const [, setCurrentTab] = useState("mng"); const [isRuseReg, setIsRuseReg] = useState<{ isModal: boolean; @@ -262,6 +264,13 @@ export default function PublicReuseFaciltyInsert() { isResetPage(false); }, [pageNation, pubHasuInit]); + const { auth } = useWrStore((state) => state); + const { mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn } =auth; + useEffect(() => { + console.log("auth", mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn); + }, [mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn]); + + return ( <> @@ -283,12 +292,12 @@ export default function PublicReuseFaciltyInsert() { className="" size={"sm"} onClick={() => { - if (searchTxt && searchTxt?.length > 0) { - pubHasuSearch(String(pageNation), "41", searchTxt); - } else { - pubHasuInit(String(pageNation), "41"); - } - isResetPage(true); + if (searchTxt && searchTxt?.length > 0) { + pubHasuSearch(String(pageNation), "41", searchTxt); + } else { + pubHasuInit(String(pageNation), "41"); + } + isResetPage(true); }} > 조회 @@ -319,19 +328,17 @@ export default function PublicReuseFaciltyInsert() {
- {/* */} - {" "} - {/* 높이 조정 */} - + {/* */} {/* 높이 조정 */} + {/* */}
@@ -377,7 +384,6 @@ export default function PublicReuseFaciltyInsert() { indexBiz={indexBiz} /> - ) : ( diff --git a/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx b/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx index a2955f386..d5127f19d 100644 --- a/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx +++ b/apps/wr/app/ruseFcltMng/prfmncSttn/chkgdnSttn/page.tsx @@ -99,7 +99,9 @@ export default function Page() { isRainSttn(true) rainChkSttnInit(1, rainPageSize, new Date().getFullYear().toString(), commonCd); setIsModal({ data: {}, open: false }); + } + }, [rainChkSttn.isInit, rainChkSttnInit, rainPageSize]); useEffect(() => { diff --git a/apps/wr/app/store/common/auth/index.tsx b/apps/wr/app/store/common/auth/index.tsx index 4e0b08d1b..21be6e01c 100644 --- a/apps/wr/app/store/common/auth/index.tsx +++ b/apps/wr/app/store/common/auth/index.tsx @@ -1,21 +1,6 @@ -import { getFetch, getFetchWithCount } from "@/components/lib/api"; +import { getFetchWithCount } from "@/components/lib/api"; import toast from "react-hot-toast"; -export const getMenuAuthrts = async (menuCd: number) => { - const response = await getFetch( - "LOCAL", - `/cms-service/api/v1/menu-authrts/pageinfo/${menuCd}` - ); - - authStateExport.auth = { - mngAuthrtYn: response[0].mngAuthrtYn, - inqAuthrtYn: response[0].mngAuthrtYn, - regAuthrtYn: response[0].mngAuthrtYn, - mdfcnAuthrtYn: response[0].mngAuthrtYn, - delAuthrtYn: response[0].mngAuthrtYn, - }; -}; - export type authState = { auth: { mngAuthrtYn: string; From 0d48a0b579ec0b940391137c3d3065ee0504373d Mon Sep 17 00:00:00 2001 From: leedj312 Date: Wed, 23 Jul 2025 17:51:47 +0900 Subject: [PATCH 2/4] =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=B3=84=20?= =?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EA=B6=8C=ED=95=9C=EC=B2=B4?= =?UTF-8?q?=ED=81=AC,=20=EC=8B=9C=EC=84=A4=20=EB=93=B1=EB=A1=9D,=ED=98=84?= =?UTF-8?q?=ED=99=A9,=20=EC=88=98=EC=9A=94=EC=B2=98=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=20=EA=B9=8C=EC=A7=80=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/matMng/coMng/coSttn/page.tsx | 4 +++ .../app/ruseFcltMng/fcltReg/htdflReg/page.tsx | 13 ++++---- .../app/ruseFcltMng/fcltReg/pbnstReg/page.tsx | 28 ++++++++--------- .../app/ruseFcltMng/fcltReg/rainReg/page.tsx | 27 +++++++++-------- .../app/ruseFcltMng/fcltReg/rswtReg/page.tsx | 6 +++- .../fcltReg/pbnstReg/buseReg/bugRegForm.tsx | 24 ++++++++++++++- .../fcltReg/pbnstReg/mngReg/mngRegForm.tsx | 30 +++++++------------ .../mngRegFormDetail/mngRegFormDetail.tsx | 19 +++++++++--- .../components/ui/searchInput/searchInput.tsx | 6 +++- .../ruseMngTableForm/ruseMngTableForm.tsx | 14 ++++++--- 10 files changed, 107 insertions(+), 64 deletions(-) diff --git a/apps/wr/app/matMng/coMng/coSttn/page.tsx b/apps/wr/app/matMng/coMng/coSttn/page.tsx index 992b1bdd1..8e2705450 100644 --- a/apps/wr/app/matMng/coMng/coSttn/page.tsx +++ b/apps/wr/app/matMng/coMng/coSttn/page.tsx @@ -33,6 +33,7 @@ import toast, { Toaster } from "react-hot-toast"; export default function CoSttn() { const { + auth, code, coSttn, coSttnInit, @@ -43,6 +44,7 @@ export default function CoSttn() { coSttnTxtSearch, demandCompList, } = useWrStore((state) => state); + const { regAuthrtYn, mdfcnAuthrtYn } = auth; const [bdstTable, setBdstTable] = useState(); const [pageNation, setPageNation] = useState(1); @@ -205,6 +207,7 @@ export default function CoSttn() { setUpdateData(undefined); setIsDmdModal({ ...isDmdModal, isMoal: true }); }} + disabled={regAuthrtYn === "N"} > 등록 @@ -222,6 +225,7 @@ export default function CoSttn() { }); } }} + disabled={mdfcnAuthrtYn === "N"} > 수정 diff --git a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx index 5d7480257..b0b2e7182 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/htdflReg/page.tsx @@ -21,7 +21,7 @@ import { useEffect, useState } from "react"; import { Toaster } from "react-hot-toast"; export default function Home() { - const { code, htdfl, initHtdflReg, getHtdflBdstData, htdflNmSearch } = + const { auth,code, htdfl, initHtdflReg, getHtdflBdstData, htdflNmSearch } = useWrStore((state) => state); const [searchTxt, setSearchTxt] = useState(""); const [pageNation, setPageNation] = useState(1); @@ -30,12 +30,9 @@ export default function Home() { const [bdstTable, setbdstTable] = useState(); const [issNewReg, setIsNewReg] = useState(false); - // const [bdstChgProps, setBdstChgProps] = useState<{ - // isOpen: boolean; - // chgBuilding: chgBuilding[]; - // }>({ isOpen: false, chgBuilding: [] }); const { htdflRes ,htdflResCount} = htdfl; + const { regAuthrtYn, mdfcnAuthrtYn } = auth; useEffect(() => { if (!htdfl.isInit) { @@ -116,7 +113,10 @@ export default function Home() { > 조회 -
@@ -149,6 +149,7 @@ export default function Home() { diff --git a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx index 4ac167f3f..934946b74 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -38,6 +38,7 @@ import { useTranslation } from "react-i18next"; export default function PublicReuseFaciltyInsert() { const { + auth, code, pbnst, pubHasuInit, @@ -50,7 +51,7 @@ export default function PublicReuseFaciltyInsert() { const { t } = useTranslation("base"); const { pubFacHeadList, pbnstHasuResCount, pbnstHasuRes, pbnstRes } = pbnst; - + const { regAuthrtYn, mdfcnAuthrtYn } = auth; const [, setCurrentTab] = useState("mng"); const [isRuseReg, setIsRuseReg] = useState<{ isModal: boolean; @@ -264,13 +265,6 @@ export default function PublicReuseFaciltyInsert() { isResetPage(false); }, [pageNation, pubHasuInit]); - const { auth } = useWrStore((state) => state); - const { mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn } =auth; - useEffect(() => { - console.log("auth", mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn); - }, [mngAuthrtYn, inqAuthrtYn, regAuthrtYn, mdfcnAuthrtYn, delAuthrtYn]); - - return ( <> @@ -292,13 +286,14 @@ export default function PublicReuseFaciltyInsert() { className="" size={"sm"} onClick={() => { - if (searchTxt && searchTxt?.length > 0) { - pubHasuSearch(String(pageNation), "41", searchTxt); - } else { - pubHasuInit(String(pageNation), "41"); - } - isResetPage(true); + if (searchTxt && searchTxt?.length > 0) { + pubHasuSearch(String(pageNation), "41", searchTxt); + } else { + pubHasuInit(String(pageNation), "41"); + } + isResetPage(true); }} + > 조회 @@ -316,6 +311,7 @@ export default function PublicReuseFaciltyInsert() { appendPbnstRuseFclt(); } }} + disabled={regAuthrtYn === "N"} > 신규등록 @@ -358,6 +354,7 @@ export default function PublicReuseFaciltyInsert() { size={"sm"} onClick={form.handleSubmit(onSubmit, onInvalid)} className="mr-5 mt-2" + disabled={mdfcnAuthrtYn === "N"} > 저장 @@ -371,7 +368,7 @@ export default function PublicReuseFaciltyInsert() { setIndexMng(index); }} indexMng={indexMng} - readonly={false} + readonly={mdfcnAuthrtYn === "N"} /> @@ -383,6 +380,7 @@ export default function PublicReuseFaciltyInsert() { }} indexMng={indexMng} indexBiz={indexBiz} + readonly={mdfcnAuthrtYn === "N"} /> diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index bd0b9bb8e..6bf250365 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -1,8 +1,6 @@ "use client"; import { useWrStore } from "@/app/store"; -import { - type customRainBdst, -} from "@/app/store/ruseFcltMng/fcltReg/rainReg"; +import { type customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg"; import { formatCommaNumber, tableData } from "@/components/lib/func/commom"; import RainRegForm from "@/components/ui/form/fcltReg/rainReg/rainRegForm"; import { BdstReg } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal"; @@ -19,14 +17,19 @@ import { import ListDiv from "@common/business_components/ui/list_div"; import { Button } from "@common/components"; import { useEffect, useState } from "react"; -import { Toaster } from "react-hot-toast"; +import { Toaster } from "react-hot-toast"; export default function Home() { - const { rain, code, initRain, rainSearch, getRainData } = useWrStore( + const { auth, rain, code, initRain, rainSearch, getRainData } = useWrStore( (state) => { return state; } ); + + const { regAuthrtYn, mdfcnAuthrtYn } = auth; + + + const { rainRes, rainResCount } = rain; const [rainForm, setRainForm] = useState(); const [issNewReg, setIsNewReg] = useState(false); @@ -53,7 +56,6 @@ export default function Home() { return { ...item, archArea: formatCommaNumber(archArea), - }; } ); @@ -64,13 +66,10 @@ export default function Home() { } } }, [code, rainRes]); - const cellClick: (val: number | undefined) => void = ( - val - ) => { + const cellClick: (val: number | undefined) => void = (val) => { if (val !== undefined) { setRainForm(rainRes[val]); } - }; useEffect(() => { @@ -99,7 +98,7 @@ export default function Home() { size={"sm"} onClick={() => { rainSearch(searchTxt || "", 1, "41"); - //rainSearch(searchTxt || "", pageNation, "41"); + //rainSearch(searchTxt || "", pageNation, "41"); }} > 조회 @@ -107,7 +106,10 @@ export default function Home() { @@ -143,6 +145,7 @@ export default function Home() { diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx index b1d5cbb04..598ddfeca 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rswtReg/page.tsx @@ -20,9 +20,11 @@ import { useEffect, useState } from "react"; import { Toaster } from "react-hot-toast"; export default function Home() { - const { code, rswt, initRswt, rswtBdstSearch, getRswtBdstData } = useWrStore( + const { auth,code, rswt, initRswt, rswtBdstSearch, getRswtBdstData } = useWrStore( (state) => state ); + const { regAuthrtYn, mdfcnAuthrtYn } = auth; + const [rswtForm, setRswtForm] = useState(); const [searchTxt, setSearchTxt] = useState(); const [issNewReg, setIsNewReg] = useState(false); @@ -114,6 +116,7 @@ export default function Home() { size={"sm"} className="mr-4" onClick={() => setIsNewReg(!issNewReg)} + disabled={regAuthrtYn === "N"} > 신규등록 @@ -146,6 +149,7 @@ export default function Home() { diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index 5c1edb471..2589422c8 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -44,6 +44,7 @@ export function PbnstBuseForm({ indexBiz = 0, setIndexBiz, form, + readonly = false, }: { formType: string; firstBizData?: fcBizType[]; @@ -51,6 +52,7 @@ export function PbnstBuseForm({ indexMng: number; indexBiz: number; setIndexBiz: (index: number) => void; + readonly?: boolean; }) { const { code, @@ -329,6 +331,7 @@ export function PbnstBuseForm({ onClick={addRuseFcltObj} type="button" size={commonButonSize} + disabled={readonly} > 추가 @@ -343,6 +346,7 @@ export function PbnstBuseForm({ sonClass="col-span-4" indexMng={indexMng} indexBiz={indexBiz} + readonly={readonly} />

재이용 원수취수 현황

@@ -394,6 +402,7 @@ export function PbnstBuseForm({ onClick={() => setIsFcOrgwts(true)} size={commonButonSize} className="" + disabled={readonly} > 추가등록 @@ -412,6 +421,7 @@ export function PbnstBuseForm({ indexMng={indexMng} formNm={"fcOrgwts"} indexBiz={indexBiz} + readonly={readonly} />

재이용 공급관로 설치 현황

@@ -424,6 +434,7 @@ export function PbnstBuseForm({ className="w-32" selectClass="w-full" onSelectValue={(val) => setPpiYn(String(val))} + readOnly={readonly} /> 추가등록 @@ -447,6 +459,7 @@ export function PbnstBuseForm({ size={commonButonSize} className="!text-xl !bg-red-500 !text-white ml-1" onClick={removeSelected} + disabled={readonly} > 삭제 @@ -471,6 +484,7 @@ export function PbnstBuseForm({ form={form} formNm={"pplInstls"} upHeadList={[]} + readonly={readonly} /> @@ -494,7 +508,7 @@ export function PbnstBuseForm({ sonClass="col-span-4" indexMng={indexMng} indexBiz={indexBiz} - readonly={false} + readonly={readonly} /> @@ -510,6 +524,7 @@ export function PbnstBuseForm({ }} size={commonButonSize} className="mt-6 mr-3" + disabled={readonly} > 수요처 추가 @@ -523,6 +538,7 @@ export function PbnstBuseForm({ }} size={commonButonSize} className="mt-6" + disabled={readonly} > 수요처 신규등록 @@ -575,6 +591,7 @@ export function PbnstBuseForm({ searchPk: item.dmdInfoId, }; })} + readonly={readonly} > )} @@ -611,6 +628,7 @@ export function PbnstBuseForm({ selectArray={code.dmdUszCd} onSelectValue={f.onChange} value={f.value ?? code.dmdUszCd[0]?.val} + readOnly={readonly} /> )} @@ -630,6 +648,7 @@ export function PbnstBuseForm({ f.onChange(date), }} selectClass={"rounded-lg !w-full"} + readOnly={readonly} /> )} @@ -652,6 +671,7 @@ export function PbnstBuseForm({ f.onChange(date), }} selectClass={"rounded-lg !w-full"} + readOnly={readonly} /> )} @@ -670,6 +690,7 @@ export function PbnstBuseForm({ handleCommaNumberChange(e, f.onChange); }} value={formatCommaNumber(f.value)} + readOnly={readonly} /> )} @@ -690,6 +711,7 @@ export function PbnstBuseForm({ f.onChange(val) } value={f.value ?? code.yn[0]?.val} + readOnly={readonly} /> )} 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 f7355bfd9..68d7634a0 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -41,13 +41,13 @@ export function PbnstMngForm({ formType, indexMng, setIndexMng, - readonly + readonly, }: { form: UseFormReturn<{ items: PbnstRegArrrayType }>; formType: string; indexMng: number; setIndexMng: (index: number) => void; - readonly:boolean + readonly: boolean; }) { const { code, pbnst, fileDelete, fileDownLoad } = useWrStore( (state) => state @@ -60,6 +60,7 @@ export function PbnstMngForm({ const [mngMtdCode, setMngMtdCode] = useState<{ name: string; val: SelectDataType[] }[]>(); + const { fields: fcOpersField, prepend, @@ -87,7 +88,6 @@ export function PbnstMngForm({ endDt: new Date(), }); //trigger(`items.${indexMng}.fcOpers`); - }; const removeSelected = () => { @@ -318,6 +318,7 @@ export function PbnstMngForm({ size={commonButonSize} className="!text-xl" onClick={plusHist} + disabled={readonly} > 추가등록 @@ -326,6 +327,7 @@ export function PbnstMngForm({ size={commonButonSize} className="!text-xl !bg-red-500 !text-white ml-1" onClick={removeSelected} + disabled={readonly} > 삭제 @@ -335,20 +337,11 @@ export function PbnstMngForm({
{ - return { - ...item, - readonly: true, - }; - }) - : pbnst.pbnstMngUpHeadList - } + tableData={form.getValues(`items.${indexMng}.fcOpers`) || []} + headList={pbnst.pbnstMngUpHeadList} upHeadList={pbnst.pbnstMngNm} code={mngMtdCode || []} - + readonly={readonly} indexMng={indexMng} form={form} formNm={"fcOpers"} @@ -372,7 +365,6 @@ export function PbnstMngForm({ maxLength={numSize} //입력제한 type="text" onChange={(e) => { - if (formType !== "sttn") handleCommaNumberChange(e, field.onChange); }} value={formatCommaNumber(field.value)} @@ -396,7 +388,6 @@ export function PbnstMngForm({ maxLength={numSize} //입력제한 type="text" onChange={(e) => { - if (formType !== "sttn") handleCommaNumberChange(e, field.onChange); }} value={formatCommaNumber(field.value)} @@ -419,7 +410,6 @@ export function PbnstMngForm({ maxLength={numSize} //입력제한 type="text" onChange={(e) => { - if (formType !== "sttn") handleCommaNumberChange(e, field.onChange); }} value={formatCommaNumber(field.value)} @@ -435,7 +425,7 @@ export function PbnstMngForm({
- {formType === "sttn" ? ( + {readonly ? ( relationfiles && relationfiles?.length > 0 ? ( <> @@ -472,7 +462,7 @@ export function PbnstMngForm({ )}
- {formType === "sttn" ? ( + {readonly ? ( planFiles && planFiles?.length > 0 ? ( <> diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx index 8ec7a5a05..2885c07a5 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegFormDetail/mngRegFormDetail.tsx @@ -21,6 +21,7 @@ export default function MngRegFormDetail({ sonClass, indexBiz, indexMng, + readonly }: { formList: formDetailType[]; h1Title?: string; @@ -30,6 +31,7 @@ export default function MngRegFormDetail({ indexBiz?: number; indexMng?: number; sonClass?: string; + readonly?:boolean }) { const { code } = useWrStore((state) => state); @@ -67,7 +69,10 @@ export default function MngRegFormDetail({ field.onChange(date), }} selectClass={"w-full"} - disabled={formHead.option === "disabled" ? true : false} + readOnly={readonly + //|| formHead.option === "disabled" ? true : false + + } /> ) : formHead.type === "number" ? ( @@ -81,7 +86,9 @@ export default function MngRegFormDetail({ ); }} value={formatCommaNumber(field.value)} - readOnly={formHead.option === "readOnly" ? true : false} + readOnly={readonly + // || formHead.option === "readOnly" ? true : false + } disabled={formHead.option === "disabled" ? true : false} maxLength={numSize} /> @@ -103,7 +110,9 @@ export default function MngRegFormDetail({ } onSelectValue={field.onChange} value={field.value?.trim() ?? (Array.isArray(potentialOptions) && potentialOptions[0]?.val)} - readOnly={formHead.option === "readOnly"} + readOnly={readonly + // || formHead.option === "readOnly" + } /> ); })() @@ -113,7 +122,9 @@ export default function MngRegFormDetail({ type="text" value={field.value ?? ""} onChange={field.onChange} - readOnly={formHead.option === "readOnly" ? true : false} + readOnly={readonly + // || formHead.option === "readOnly" ? true : false + } disabled={formHead.option === "disabled" ? true : false} maxLength={txtSize} /> diff --git a/apps/wr/components/ui/searchInput/searchInput.tsx b/apps/wr/components/ui/searchInput/searchInput.tsx index be63b9685..f512516b8 100644 --- a/apps/wr/components/ui/searchInput/searchInput.tsx +++ b/apps/wr/components/ui/searchInput/searchInput.tsx @@ -1,3 +1,4 @@ +import { Input } from "@common/components/ui"; import React, { useCallback, useEffect, useRef, useState } from "react"; type SearchType = { @@ -10,6 +11,7 @@ type thisProps = { setValue: (searchNm?: string) => void; setRtnData: (rtnData: any) => void; searchList?: any[]; + readonly?:boolean }; export default function SearchInputText({ label = undefined, @@ -17,6 +19,7 @@ export default function SearchInputText({ setValue = () => {}, setRtnData = () => {}, searchList = undefined, + readonly = false, // 추가: readonly prop }: thisProps) { const [isOpen, setIsOpen] = useState(false); @@ -65,13 +68,14 @@ export default function SearchInputText({ return (
- setIsOpen(true)} */ className="w-full h-[3.2rem] !text-xl pl-3 text-gray-600 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder={`${label}을(를) 입력하세요`} + readOnly={readonly} // readonly 상태 적용 /> {isOpen && (
diff --git a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx index 2efa1c795..b13160e8b 100644 --- a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx +++ b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx @@ -35,6 +35,7 @@ type RuseMngTableProps = { indexBiz?: number; form?: any; formNm?: string; + readonly?: boolean; }; const RuseMngTableForm = React.forwardRef( @@ -48,6 +49,7 @@ const RuseMngTableForm = React.forwardRef( form, formNm, indexBiz, + readonly= false }, ref ) => { @@ -111,7 +113,7 @@ const RuseMngTableForm = React.forwardRef( ? formatCommaNumber(field.value) : field.value || "" } - readOnly={head.readonly ? true : false} + readOnly={readonly|| head.readonly ? true : false} maxLength={head.maxLength?head.maxLength:15} /> ) : head.type === "select" ? ( @@ -132,7 +134,7 @@ const RuseMngTableForm = React.forwardRef( field.onChange(val); } }} - readOnly={head.readonly ? true : false} + readOnly={ readonly||head.readonly ? true : false} // Disabled prop removed as SelectBox does not support it > ) : head.type === "date" ? ( @@ -149,14 +151,18 @@ const RuseMngTableForm = React.forwardRef( }, }} selectClass={"w-full"} - readOnly={head.readonly ? true : false} + readOnly={readonly||head.readonly ? true : false} /> ) : head.type === "checkbox" ? ( { - field.onChange(checked); + if(readonly || head.readonly) { + return; + }else{ + field.onChange(checked); + } }} > ) : ( From f332d64aa65e91cb47d69276228ac40ef4a83289 Mon Sep 17 00:00:00 2001 From: leedj312 Date: Thu, 24 Jul 2025 14:06:20 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=EB=AC=BC=EC=9E=AC=EC=9D=B4=EC=9A=A9=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=EB=B3=84=20=EB=93=B1=EB=A1=9D/=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EA=B6=8C=ED=95=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/wr/app/matMng/coMat/coMatRvw/page.tsx | 829 +++++++++--------- .../wr/app/matMng/coMat/ruseRvwHstry/page.tsx | 5 +- .../ui/form/coMat/conCostForm/conCostForm.tsx | 63 +- 3 files changed, 458 insertions(+), 439 deletions(-) diff --git a/apps/wr/app/matMng/coMat/coMatRvw/page.tsx b/apps/wr/app/matMng/coMat/coMatRvw/page.tsx index d33611128..8a965211c 100644 --- a/apps/wr/app/matMng/coMat/coMatRvw/page.tsx +++ b/apps/wr/app/matMng/coMat/coMatRvw/page.tsx @@ -41,9 +41,11 @@ import toast, { Toaster } from "react-hot-toast"; import { z } from "zod"; export default function CoMatRvw() { - const { code, coRvw, coMatRvwInit, coMatRvwSearch, coMatRvwInqua } = + const { auth, code, coRvw, coMatRvwInit, coMatRvwSearch, coMatRvwInqua } = useWrStore((state) => state); - const { coMatRvwRes,coMatRvwCount } = coRvw; + const { coMatRvwRes, coMatRvwCount } = coRvw; + const { regAuthrtYn } = auth; + //init, sub, match const initRef = useRef(false); const { coRvwHeadList } = coRvw; @@ -91,10 +93,9 @@ export default function CoMatRvw() { const form = useForm>({ resolver: zodResolver(DmdCoReqSchema), shouldUnregister: false, - // defaultValues: DmdCoReqSchema.parse({}) + // defaultValues: DmdCoReqSchema.parse({}) }); - const TableCellClick = (index: number) => { if (coMatRvwRes && coMatRvwRes[index]) { setSelectData(coMatRvwRes[index]); @@ -103,23 +104,21 @@ export default function CoMatRvw() { }; const useUsgCdWatch = useWatch({ control: form.control, name: "useUsgCd" }); useEffect(() => { - if (useUsgCdWatch) { form.setValue( "demandCst.usgPrcsProcs", - usageProcData?.find( - (item) => item.usage === useUsgCdWatch - )?.process ?? "" + usageProcData?.find((item) => item.usage === useUsgCdWatch)?.process ?? + "" ); } - }, [useUsgCdWatch, form,selectionVersion]); + }, [useUsgCdWatch, form, selectionVersion]); useEffect(() => { - if (coMatRvwRes&&coMatRvwRes.length > 0) { + if (coMatRvwRes && coMatRvwRes.length > 0) { const data = coMatRvwRes?.map((item) => { let flag = ""; - - flag = getdmdMatFlag(item?.demandMatching?.splyFcltFlg ||undefined); + + flag = getdmdMatFlag(item?.demandMatching?.splyFcltFlg || undefined); return { ...item, @@ -127,7 +126,7 @@ export default function CoMatRvw() { sggCd: item.demandCo?.sggCd, dmdCoNm: item.demandCo?.dmdCoNm, daddr: item.demandCo?.daddr, - telno: formatPhoneNumber(item?.demandCo?.telno||''), + telno: formatPhoneNumber(item?.demandCo?.telno || ""), dmndTmng: item?.dmndTmng, splyFcltFlg: flag, }; @@ -156,7 +155,6 @@ export default function CoMatRvw() { useEffect(() => { if (selectData) { - try { DmdCoReqSchema.parse(selectData); } catch (e) { @@ -164,15 +162,14 @@ export default function CoMatRvw() { console.log(e.flatten()); } } - form.reset( selectData); - setSelectionVersion((v) => v + 1); // 강제로 바뀌었다고 알리기 + form.reset(selectData); + setSelectionVersion((v) => v + 1); // 강제로 바뀌었다고 알리기 } }, [selectData, form]); return ( <>
-
<SearchDiv> @@ -195,7 +192,7 @@ export default function CoMatRvw() { <div className="col-span-7 w-full"> <div className="flex flex-row items-center"> <Label className="text-xl text-gray-600 mx-6"> - 수요신청년도 + 수요신청년도 </Label> <SelectBox className="h-full w-32 text-2xl" @@ -248,7 +245,10 @@ export default function CoMatRvw() { if (String(objSearch.city).length > 0) { con = String(objSearch.city); } - if (String(objSearch.sgg).length > 0 && String(objSearch.sgg) !== "0") { + if ( + String(objSearch.sgg).length > 0 && + String(objSearch.sgg) !== "0" + ) { con = String(objSearch.sgg); } getSearch(fromNum, toNum, con, dmdCoNm); @@ -279,403 +279,410 @@ export default function CoMatRvw() { TableCellClick(index); } }} - onPageChange={(val) => {setPageNatiion(val)}} + onPageChange={(val) => { + setPageNatiion(val); + }} ></UiTable> </ListDiv> <hr /> {/* <ScrollArea className="h-[49vh]"> */} - <ListDiv> - <h3 className="mt-4 ml-2 text-2xl font-medium text-label"> - 수요신청 상세현황 - </h3> - <Form {...form}> - <div className="grid grid-cols-12 gap-4 ml-4 mr-4"> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="dmndTmng" - render={({ field }) => ( - <FormUi label="요구시기"> - <Input - placeholder="" - type="text" - onChange={(e) => { - field.onChange(String(e.target.value)); - }} - value={ - moment(field.value).format("YYYY-MM-DD") ?? "" - } - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="dmndQty" - render={({ field }) => ( - <FormUi label="요구수량(m³/일)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="useUsgCd" - render={({ field }) => ( - <FormUi label="사용용도"> - <Input - placeholder="" - type="text" - step="0.1" - onChange={(e) => { - field.onChange(e.target.value); - }} - value={field.value ?? ""} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="wntUntprc" - render={({ field }) => ( - <FormUi label="희망단가(원/m3)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-12 w-full"> - <h1 className={formH1Class}>요구수질</h1> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="grssClfg" - render={({ field }) => ( - <FormUi label="총대장균군수 (개/100ml)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="combResdch" - render={({ field }) => ( - <FormUi label="결합잔류염소(mg/L)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="trbt" - render={({ field }) => ( - <FormUi label="탁도(NTU)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="blgcOxygDmndQnt" - render={({ field }) => ( - <FormUi label="생물학적 산소요구량(BOD)(mg/L)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="smll" - render={({ field }) => ( - <FormUi label="냄새"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="crmty" - render={({ field }) => ( - <FormUi label="색도(도)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="tn" - render={({ field }) => ( - <FormUi label="총질소 (T-N)(mg/L)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="tph" - render={({ field }) => ( - <FormUi label="총인(T-P)(mg/L)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="ph" - render={({ field }) => ( - <FormUi label="수소이온농도(pH)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="clIonQnt" - render={({ field }) => ( - <FormUi label="염화물(mgCL/L)"> - <Input - placeholder="" - type="number" - step="0.1" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="cdtnv" - render={({ field }) => ( - <FormUi label="전기전도도(㎲/cm)"> - <Input - placeholder="" - type="number" - onChange={(e) => { - field.onChange(Number(e.target.value)); - }} - value={field.value ?? 0} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-3 mt-4"> - <FormField - control={form.control} - name="rmrk" - render={({ field }) => ( - <FormUi label="비고"> - <Input - placeholder="" - type="text" - onChange={(e) => { - field.onChange(e.target.value); - }} - value={field.value ?? ""} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-12 w-full"> - <h1 className={formH1Class}>공급처 후보지</h1> - </div> - <div className="col-span-4 mt-4"> - <FormField - control={form.control} - name={`demandMatching.splyCndtList.${0}`} - render={({ field }) => ( - <FormUi label="후보지1"> - <Input - placeholder="" - type="text" - onChange={(e) => { - field.onChange(String(e.target.value)); - }} - value={field.value ?? ""} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-4 mt-4"> - <FormField - control={form.control} - name={`demandMatching.splyCndtList.${1}`} - render={({ field }) => ( - <FormUi label="후보지2"> - <Input - placeholder="" - type="text" - onChange={(e) => { - field.onChange(e.target.value); - }} - value={field.value ?? ""} - readOnly - /> - </FormUi> - )} - /> - </div> - <div className="col-span-4 mt-4"> - <FormField - control={form.control} - name={`demandMatching.splyCndtList.${2}`} - render={({ field }) => ( - <FormUi label="후보지3"> - <Input - placeholder="" - type="text" - onChange={(e) => { - field.onChange(e.target.value); - }} - value={field.value ?? ""} - readOnly - /> - </FormUi> - )} - /> - </div> + <ListDiv> + <h3 className="mt-4 ml-2 text-2xl font-medium text-label"> + 수요신청 상세현황 + </h3> + <Form {...form}> + <div className="grid grid-cols-12 gap-4 ml-4 mr-4"> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="dmndTmng" + render={({ field }) => ( + <FormUi label="요구시기"> + <Input + placeholder="" + type="text" + onChange={(e) => { + field.onChange(String(e.target.value)); + }} + value={ + moment(field.value).format("YYYY-MM-DD") ?? "" + } + readOnly + /> + </FormUi> + )} + /> </div> - </Form> - <ConCostForm form={form} type={"mat"} selectionVersion={selectionVersion} /> - </ListDiv> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="dmndQty" + render={({ field }) => ( + <FormUi label="요구수량(m³/일)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="useUsgCd" + render={({ field }) => ( + <FormUi label="사용용도"> + <Input + placeholder="" + type="text" + step="0.1" + onChange={(e) => { + field.onChange(e.target.value); + }} + value={field.value ?? ""} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="wntUntprc" + render={({ field }) => ( + <FormUi label="희망단가(원/m3)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-12 w-full"> + <h1 className={formH1Class}>요구수질</h1> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="grssClfg" + render={({ field }) => ( + <FormUi label="총대장균군수 (개/100ml)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="combResdch" + render={({ field }) => ( + <FormUi label="결합잔류염소(mg/L)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="trbt" + render={({ field }) => ( + <FormUi label="탁도(NTU)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="blgcOxygDmndQnt" + render={({ field }) => ( + <FormUi label="생물학적 산소요구량(BOD)(mg/L)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="smll" + render={({ field }) => ( + <FormUi label="냄새"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="crmty" + render={({ field }) => ( + <FormUi label="색도(도)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="tn" + render={({ field }) => ( + <FormUi label="총질소 (T-N)(mg/L)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="tph" + render={({ field }) => ( + <FormUi label="총인(T-P)(mg/L)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="ph" + render={({ field }) => ( + <FormUi label="수소이온농도(pH)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="clIonQnt" + render={({ field }) => ( + <FormUi label="염화물(mgCL/L)"> + <Input + placeholder="" + type="number" + step="0.1" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="cdtnv" + render={({ field }) => ( + <FormUi label="전기전도도(㎲/cm)"> + <Input + placeholder="" + type="number" + onChange={(e) => { + field.onChange(Number(e.target.value)); + }} + value={field.value ?? 0} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-3 mt-4"> + <FormField + control={form.control} + name="rmrk" + render={({ field }) => ( + <FormUi label="비고"> + <Input + placeholder="" + type="text" + onChange={(e) => { + field.onChange(e.target.value); + }} + value={field.value ?? ""} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-12 w-full"> + <h1 className={formH1Class}>공급처 후보지</h1> + </div> + <div className="col-span-4 mt-4"> + <FormField + control={form.control} + name={`demandMatching.splyCndtList.${0}`} + render={({ field }) => ( + <FormUi label="후보지1"> + <Input + placeholder="" + type="text" + onChange={(e) => { + field.onChange(String(e.target.value)); + }} + value={field.value ?? ""} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-4 mt-4"> + <FormField + control={form.control} + name={`demandMatching.splyCndtList.${1}`} + render={({ field }) => ( + <FormUi label="후보지2"> + <Input + placeholder="" + type="text" + onChange={(e) => { + field.onChange(e.target.value); + }} + value={field.value ?? ""} + readOnly + /> + </FormUi> + )} + /> + </div> + <div className="col-span-4 mt-4"> + <FormField + control={form.control} + name={`demandMatching.splyCndtList.${2}`} + render={({ field }) => ( + <FormUi label="후보지3"> + <Input + placeholder="" + type="text" + onChange={(e) => { + field.onChange(e.target.value); + }} + value={field.value ?? ""} + readOnly + /> + </FormUi> + )} + /> + </div> + </div> + </Form> + <ConCostForm + form={form} + type={"mat"} + selectionVersion={selectionVersion} + readonly={regAuthrtYn ==="N"} + /> + </ListDiv> {/* </ScrollArea> */} </div> </div> diff --git a/apps/wr/app/matMng/coMat/ruseRvwHstry/page.tsx b/apps/wr/app/matMng/coMat/ruseRvwHstry/page.tsx index 1c034ac89..d1fa8f069 100644 --- a/apps/wr/app/matMng/coMat/ruseRvwHstry/page.tsx +++ b/apps/wr/app/matMng/coMat/ruseRvwHstry/page.tsx @@ -30,6 +30,7 @@ import toast, { Toaster } from "react-hot-toast"; import { useTranslation } from "react-i18next"; export default function RuseRvwHstry() { const { + auth, code, ruseHist, ruseRvwHistInit, @@ -38,6 +39,8 @@ export default function RuseRvwHstry() { ruseRvwComplete, } = useWrStore((state) => state); const { rvwHistRes, ruseHistHeadList, rvwHistCount } = ruseHist; + const { regAuthrtYn } = auth; + const [pageNation, setPageNatiion] = useState<number>(1); const [dmdCoNm, setDmdCoNm] = useState<string>(""); @@ -305,7 +308,7 @@ export default function RuseRvwHstry() { > 조회 </Button> - <Button size={"sm"} onClick={confrirmToast}> + <Button size={"sm"} onClick={confrirmToast} disabled={regAuthrtYn==='N'}> 저장 </Button> </div> diff --git a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx index 9184f702f..5900014e0 100644 --- a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx +++ b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx @@ -31,10 +31,12 @@ export default function ConCostForm({ form, type, selectionVersion, + readonly = false, }: { form: UseFormReturn<DmdCoReqType>; type: string; selectionVersion: number; + readonly: boolean; }) { const { constCostRes, @@ -58,14 +60,11 @@ export default function ConCostForm({ } }, [ref, getConstCostFee, getRateFee]); - useEffect(() => { // 다른 행을 선택하면(selectionVersion 변경) 체크박스 상태를 초기화합니다. setCheckFinish(false); }, [selectionVersion]); - - const zipDowonLoad = () => { fetch(`/2024_constarctFeeProgram.zip`, {}).then(async (response) => { const blobRet = await response.blob(); @@ -165,29 +164,32 @@ export default function ConCostForm({ cstrnCst: value.demandCst.cstrnCst || 0, fcltSbsdCstrnCst: value.demandCst.fcltSbsdCstrnCst || 0, prcsFcltCpctCstrnCst: value.demandCst.prcsFcltCpctCstrnCst || 0, - flg: checkFinish?'Checked':'Sub', + flg: checkFinish ? "Checked" : "Sub", rgtr: TEST_UUID, }; if (checkFinish) { toast((t) => ( - <span className="flex flex-col items-center text-2xl" > - 검토완료 변경시 공사비는 변경할수 없습니다. + <span className="flex flex-col items-center text-2xl"> + 검토완료 변경시 공사비는 변경할수 없습니다. <br /> 진행하시겠습니까? <div className="flex gap-2 mt-2"> - <Button - size='sm' - - onClick={() => { - toast.dismiss(t.id); - coMatRvwUpdate("11000SW001R1", form.getValues("dmdInfoId"), data); - }} - > - 확인 - </Button> - <Button - size='sm' - onClick={() => toast.dismiss(t.id)}>취소</Button> + <Button + size="sm" + onClick={() => { + toast.dismiss(t.id); + coMatRvwUpdate( + "11000SW001R1", + form.getValues("dmdInfoId"), + data + ); + }} + > + 확인 + </Button> + <Button size="sm" onClick={() => toast.dismiss(t.id)}> + 취소 + </Button> </div> </span> )); @@ -229,6 +231,7 @@ export default function ConCostForm({ className="mr-3" size={"sm"} onClick={form.handleSubmit(onSubmit)} + disabled={readonly} > 저장 </Button> @@ -236,9 +239,14 @@ export default function ConCostForm({ <Checkbox className="ml-3 mr-6" checked={checkFinish} - onCheckedChange={(checked) => + onCheckedChange={ + (checked) => { + if (readonly) return; + setCheckFinish(checked === true); + } + // 'indeterminate' 상태를 무시하고 순수 boolean 값으로만 상태를 업데이트합니다. - setCheckFinish(checked === true)} + } ></Checkbox> <Label>관로 표준공사비 산정 프로그램</Label> <Button @@ -350,7 +358,7 @@ export default function ConCostForm({ type="number" step="0.001" onChange={(e) => { - console.log('dmndQty ', e) + console.log("dmndQty ", e); //field.onChange(Number(e.target.value) * 365 ); }} value={Number(field.value) * 365 || 0} @@ -377,7 +385,7 @@ export default function ConCostForm({ } childrenBody={ <> - <ConstCostFeeTable/> + <ConstCostFeeTable /> </> } bodyClassName={"w-[40vw] h-full"} @@ -414,8 +422,7 @@ export default function ConCostForm({ } childrenBody={ <> - <RateFeeTableModal/> - + <RateFeeTableModal /> </> } bodyClassName={"w-[22vw]"} @@ -476,8 +483,7 @@ export default function ConCostForm({ type="number" step="0.01" onChange={(e) => { - console.log('totalConstCost ', e) - + console.log("totalConstCost ", e); }} value={field.value ?? 0} readOnly @@ -521,6 +527,9 @@ export default function ConCostForm({ type="number" step="0.01" onChange={(e) => { + + if(readonly) return; + field.onChange(Number(e.target.value)); }} value={field.value ?? 0} From c5f4f6ddd0a867ffcc3479b8f5cf2266f2a53fe9 Mon Sep 17 00:00:00 2001 From: leedj312 <dlehd467@gmail.com> Date: Thu, 24 Jul 2025 14:09:43 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=EB=AC=BC=EC=9E=AC=EC=9D=B4=EC=9A=A9=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EA=B1=B4=EC=B6=95=EB=AC=BC=20=EC=9E=AC?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=97=AC=EB=B6=80=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/ruseFcltMng/fcltReg/rainReg/page.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx index 6bf250365..e3daab9f9 100644 --- a/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -56,6 +56,7 @@ export default function Home() { return { ...item, archArea: formatCommaNumber(archArea), + bdstChgYn: item.chgBuilding[0]?.bdstChgNm != null ? "Y" : "N", }; } );