This commit is contained in:
@@ -5,6 +5,7 @@ import { btnClass } from "@/app/store/common/code";
|
||||
import { type customLdrmnt } from "@/app/store/matDmd/ldrmntCoSttn";
|
||||
import { ldrmntHeadListExport } from "@/app/store/matDmd/ldrmntCoSttn/headList";
|
||||
import {
|
||||
confirmToast,
|
||||
excelDownload,
|
||||
getCity,
|
||||
tableData
|
||||
@@ -29,9 +30,10 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function LdrmntCoSttn() {
|
||||
const { code, ldrmnt, ldrmntInit, ldrmntSearch, ldrmntUpdate} = useWrStore(
|
||||
const { code, ldrmnt, ldrmntInit, ldrmntSearch, ldrmntUpdate } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { ldrmntRes, excelList, ldrmntResCount } = ldrmnt;
|
||||
@@ -43,6 +45,7 @@ export default function LdrmntCoSttn() {
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [excelData, setExcelData] = useState<any[]>();
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const { t } = useTranslation('base');
|
||||
// const [isExcelDownload, setIsExcelDownload] = useState(false);
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
@@ -141,7 +144,7 @@ export default function LdrmntCoSttn() {
|
||||
|
||||
setBdstTable(tbData);
|
||||
}, [ldrmntRes, code]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const transData = Array.isArray(excelList) ? excelList : [excelList];
|
||||
const exData = tableData(transData, { code });
|
||||
@@ -261,10 +264,17 @@ export default function LdrmntCoSttn() {
|
||||
setDetailModal({ ...detailModal, isOpen: !detailModal.isOpen })
|
||||
}}
|
||||
bodyClass={"w-[40vw] max-w-none max-h-[calc(100%-70px)]"}
|
||||
body={<CoDetailModal formObj={detailModal.data} onFormSubmit={async (value)=>{
|
||||
await ldrmntUpdate(value)
|
||||
setDetailModal({ ...detailModal, isOpen: false })
|
||||
ldrmntSearch(false, pageNation, '20', computeCityNm(), searchTxt || "");
|
||||
body={<CoDetailModal formObj={detailModal.data} onFormSubmit={async (value) => {
|
||||
// confirmToast(t('isUpdateMsg'), await ldrmntUpdate(value))
|
||||
// // await ldrmntUpdate(value)
|
||||
// setDetailModal({ ...detailModal, isOpen: false })
|
||||
// ldrmntSearch(false, pageNation, '20', computeCityNm(), searchTxt || "");
|
||||
const handleConfirm = async () => {
|
||||
await ldrmntUpdate(value);
|
||||
setDetailModal({ ...detailModal, isOpen: false });
|
||||
ldrmntSearch(false, pageNation, '20', computeCityNm(), searchTxt || "");
|
||||
};
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
}} />}
|
||||
/>
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { excelHtdflSttnParsing } from "@/app/store/ruseFcltMng/fcltSttn/htdflSttn/excel";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function HtdflSttn() {
|
||||
const { code, htdflSttn, htdflSttnSearch, initHtdfl } = useWrStore(
|
||||
@@ -42,7 +44,8 @@ export default function HtdflSttn() {
|
||||
const { htdflSttnRes, htdflSttnResCount } = htdflSttn;
|
||||
|
||||
const ref = useRef<ReturnType>({} as ReturnType);
|
||||
|
||||
const isDownloadTriggered = useRef(false);
|
||||
const { t } = useTranslation('base');
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
const [isChHead, setIsChHead] = useState(false);
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
@@ -59,12 +62,6 @@ export default function HtdflSttn() {
|
||||
}>({ isOpen: false, chBuilding: [] });
|
||||
const [fcltNm, setFcltNm] = useState<string>("");
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
// 최신 검색 조건 반영
|
||||
const con = getConValue();
|
||||
htdflSttnSearch(true, 1, String(htdflSttnResCount), String(con), fcltNm, code.cityCd, code.sggCd);
|
||||
}, [htdflSttnSearch, objSearch, code.cityCd, code.sggCd, fcltNm, htdflSttnResCount]);
|
||||
|
||||
useEffect(() => {
|
||||
htdflSttnSearch(false, pageNation, "20", String(getConValue()), fcltNm, code.cityCd, code.sggCd);
|
||||
isResetPage(false)
|
||||
@@ -108,16 +105,27 @@ export default function HtdflSttn() {
|
||||
setDetailModal({ isOpen: true, data: bdstTable[index] });
|
||||
}
|
||||
};
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
isDownloadTriggered.current = true;
|
||||
htdflSttnSearch(true, 1, String(htdflSttnResCount), String(getConValue()), fcltNm, code.cityCd, code.sggCd);
|
||||
}, [htdflSttnSearch, objSearch, code.cityCd, code.sggCd, fcltNm, htdflSttnResCount]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDownloadTriggered.current) {
|
||||
return;
|
||||
}
|
||||
if (htdflSttn.excelList.length > 0) {
|
||||
if (htdflSttn.excelList.length === 0) return;
|
||||
excelDownload(
|
||||
htdflSttn.excelList,
|
||||
"온배수시설 현황",
|
||||
"sample_htdflSttn.xlsx",
|
||||
"A1:R3"
|
||||
);
|
||||
} else {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
}
|
||||
isDownloadTriggered.current = false;
|
||||
}, [htdflSttn.excelList, code]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -256,6 +264,7 @@ export default function HtdflSttn() {
|
||||
body={<SttnDetailModal type={"HTB"} formObj={detailModal.data} />}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,6 +34,8 @@ import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeCo
|
||||
import SttnDetailModal from "@/components/ui/modal/sttn/sttnDetailModal/sttnDetailModal";
|
||||
import BdstChgModal from "@/components/ui/modal/fcltReg/bdstChgModal/bdstChgModal";
|
||||
import type { objSearchType } from "@/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function RainSttn() {
|
||||
const { code, rainSttn, rainSttnSearch, rainSttnInit } = useWrStore(
|
||||
@@ -47,6 +49,7 @@ export default function RainSttn() {
|
||||
const [bdstTable, setBdstTable] = useState<customRainBdst[]>();
|
||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>()
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const isDownloadTriggered = useRef(false);
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({ sgg: "", city: "" });
|
||||
const [detailModal, setDetailModal] = useState<{ isOpen: boolean, data: customRainBdst | undefined }>({ data: undefined, isOpen: false })
|
||||
const [bdstChgProps, setBdstChgProps] = useState<{
|
||||
@@ -54,7 +57,7 @@ export default function RainSttn() {
|
||||
chBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chBuilding: [] });
|
||||
const [fcltNm, setFcltNm] = useState<string>("");
|
||||
|
||||
const { t } = useTranslation('base');
|
||||
const cellClick = (index: number | undefined, headId: string) => {
|
||||
if (headId !== 'chBuildingYn' && index !== undefined && bdstTable !== undefined) {
|
||||
setDetailModal({ isOpen: true, data: bdstTable[index] })
|
||||
@@ -135,21 +138,25 @@ export default function RainSttn() {
|
||||
}, [pageNation]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDownloadTriggered.current) {
|
||||
return;
|
||||
}
|
||||
if (rainSttn.excelList.length > 0) {
|
||||
if (rainSttn.excelList.length === 0) return;
|
||||
excelDownload(
|
||||
rainSttn.excelList,
|
||||
"빗물재이용시설 현황",
|
||||
"sample_rainSttn.xlsx",
|
||||
"A1:W3"
|
||||
);
|
||||
} else {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
}
|
||||
isDownloadTriggered.current = false;
|
||||
}, [rainSttn.excelList]);
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
// 최신 검색 조건 반영
|
||||
const con = getConValue();
|
||||
rainSttnSearch(true, 1, String(rainSttnResCount), String(con), fcltNm, code.cityCd, code.sggCd);
|
||||
isDownloadTriggered.current = true;
|
||||
rainSttnSearch(true, 1, String(rainSttnResCount), String(getConValue()), fcltNm, code.cityCd, code.sggCd);
|
||||
}, [rainSttnSearch, objSearch, code.cityCd, code.sggCd, fcltNm, rainSttnResCount]);
|
||||
|
||||
return (
|
||||
@@ -276,6 +283,7 @@ export default function RainSttn() {
|
||||
}}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function RswtSttn() {
|
||||
const { code, rswtSttn, rswtSttnSearch, rswtSttnInit } = useWrStore(
|
||||
@@ -43,6 +45,7 @@ export default function RswtSttn() {
|
||||
const [resetPage, isResetPage] = useState(false);
|
||||
const ref = useRef<ReturnType>({} as ReturnType);
|
||||
const [bdstTable, setBdstTable] = useState<customRswtBdst[]>();
|
||||
const isDownloadTriggered = useRef(false);
|
||||
const [selectSgg, setSelectSgg] = useState<SelectDataType[] | []>()
|
||||
const [objSearch, setObjSearch] = useState<objSearchType>({ sgg: "", city: "" });
|
||||
const [detailModal, setDetailModal] = useState<{ isOpen: boolean, data: customRswtBdst | undefined }>({ data: undefined, isOpen: false })
|
||||
@@ -51,7 +54,7 @@ export default function RswtSttn() {
|
||||
chBuilding: chgBuilding[];
|
||||
}>({ isOpen: false, chBuilding: [] });
|
||||
const [fcltNm, setFcltNm] = useState<string>("");
|
||||
|
||||
const { t } = useTranslation('base');
|
||||
const cellClick = (index: number | undefined, headId: string) => {
|
||||
|
||||
if (headId !== 'chBuildingYn' && index !== undefined && bdstTable !== undefined) {
|
||||
@@ -124,22 +127,25 @@ export default function RswtSttn() {
|
||||
}, [code, rswtSttnRes]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isDownloadTriggered.current) {
|
||||
return;
|
||||
}
|
||||
if (rswtSttn.excelList.length > 0) {
|
||||
if (rswtSttn.excelList.length === 0) return;
|
||||
excelDownload(
|
||||
rswtSttn.excelList,
|
||||
"중수도시설 현황",
|
||||
"sample_rswtSttn.xlsx",
|
||||
"A1:W3",
|
||||
);
|
||||
} else {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
}
|
||||
isDownloadTriggered.current = false;
|
||||
}, [rswtSttn.excelList]);
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
// 최신 검색 조건 반영
|
||||
const con = getConValue();
|
||||
|
||||
rswtSttnSearch(true, 1, String(rswtSttnResCount), String(con), fcltNm, code.cityCd, code.sggCd);
|
||||
isDownloadTriggered.current = true;
|
||||
rswtSttnSearch(true, 1, String(rswtSttnResCount), String(getConValue()), fcltNm, code.cityCd, code.sggCd);
|
||||
}, [rswtSttnSearch, objSearch, code.cityCd, code.sggCd, fcltNm, rswtSttnResCount]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -276,6 +282,7 @@ export default function RswtSttn() {
|
||||
}}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
<Toaster position="top-center" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
type rswtrChkDetailsZodType,
|
||||
} from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
|
||||
import {
|
||||
confirmToast,
|
||||
excelArrayDownload,
|
||||
excelDownload,
|
||||
yearOptions,
|
||||
@@ -39,6 +40,7 @@ import {
|
||||
} from "@common/components/ui/tooltip";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function Page() {
|
||||
const {
|
||||
@@ -201,12 +203,19 @@ export default function Page() {
|
||||
}
|
||||
}, [rainChkgdn.isSttn, rswtChkgdn.isSttn]);
|
||||
|
||||
const { t } = useTranslation('base');
|
||||
const clickDelete = (data: number[], selFcltDiv: string) => {
|
||||
if (data.length > 0) {
|
||||
if (selFcltDiv === "RNB") {
|
||||
rainChkDelete(data, searchYear);
|
||||
const handleConfirm = async () => {
|
||||
rainChkDelete(data, searchYear);
|
||||
};
|
||||
confirmToast(t('isDeleteMsg'), handleConfirm);
|
||||
} else {
|
||||
rswtChkDelete(data, searchYear);
|
||||
const handleConfirm = async () => {
|
||||
rswtChkDelete(data, searchYear);
|
||||
};
|
||||
confirmToast(t('isDeleteMsg'), handleConfirm);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { pubHasuType } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import { excelDownload, yearOptions } from "@/components/lib/func/commom";
|
||||
import { confirmToast, excelDownload, yearOptions } from "@/components/lib/func/commom";
|
||||
import PbnPrfExcelModal from "@/components/ui/modal/chkgd/pbnPrfExcelModal/pbnPrfExcelModal";
|
||||
import {
|
||||
ContentsDiv,
|
||||
@@ -37,12 +37,13 @@ import {
|
||||
type PrfType,
|
||||
} from "@/app/store/prfmncReg/pbnstPrfmncReg/type";
|
||||
import { excelToPbnPrfData } from "@/app/store/prfmncReg/pbnstPrfmncReg/excel";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function prfmncPrfmncReg() {
|
||||
const { code, prfmnc, prfmncHasuInit, prfmnRegData,prfmncHasuNmSearch } = useWrStore(
|
||||
const { code, prfmnc, prfmncHasuInit, prfmnRegData, prfmncHasuNmSearch } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const { pbnstPrfmncHeadList, monthHeadList, prfmncRes,prfmncResCount } = prfmnc;
|
||||
const { pbnstPrfmncHeadList, monthHeadList, prfmncRes, prfmncResCount } = prfmnc;
|
||||
const [bdstTable, setbdstTable] = useState<FcPrfType[]>();
|
||||
const [searchTxt, setSearchTxt] = useState<string>();
|
||||
const [isExcelOpen, setIsExcelOPen] = useState<{
|
||||
@@ -65,20 +66,40 @@ export default function prfmncPrfmncReg() {
|
||||
"A1:O1"
|
||||
);
|
||||
}, [prfmnc.excelList]);
|
||||
/*
|
||||
const onSave = useCallback(
|
||||
async() => {
|
||||
if (pbnstRuseFcltPk) {
|
||||
await prfmnRegData(pageNation,'41',
|
||||
excelToPbnPrfData(
|
||||
inputData as unknown as JSON[],
|
||||
searchYear,
|
||||
pbnstRuseFcltPk
|
||||
) as unknown as PrfType
|
||||
);
|
||||
// cellClick(cellNum)
|
||||
}
|
||||
}, [inputData, searchYear, pbnstRuseFcltPk, pageNation,cellNum]);*/
|
||||
|
||||
const onSave = useCallback(
|
||||
async() => {
|
||||
if (pbnstRuseFcltPk) {
|
||||
await prfmnRegData(pageNation,'41',
|
||||
const { t } = useTranslation('base');
|
||||
const onSave = useCallback(() => {
|
||||
const handleConfirm = async () => {
|
||||
if (!pbnstRuseFcltPk) return;
|
||||
|
||||
prfmnRegData(
|
||||
pageNation,
|
||||
'41',
|
||||
excelToPbnPrfData(
|
||||
inputData as unknown as JSON[],
|
||||
searchYear,
|
||||
pbnstRuseFcltPk
|
||||
) as unknown as PrfType
|
||||
) as unknown as PrfType,
|
||||
searchYear
|
||||
);
|
||||
// cellClick(cellNum)
|
||||
}
|
||||
}, [inputData, searchYear, pbnstRuseFcltPk, pageNation,cellNum]);
|
||||
};
|
||||
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
}, [inputData, searchYear, pbnstRuseFcltPk, pageNation, cellNum]);
|
||||
|
||||
const cellClick = useCallback(
|
||||
(index: number | undefined) => {
|
||||
@@ -165,13 +186,13 @@ export default function prfmncPrfmncReg() {
|
||||
useEffect(() => {
|
||||
if (!prfmnc.isInit) {
|
||||
const year = new Date().getFullYear()
|
||||
prfmncHasuInit(1, "41",String(year));
|
||||
prfmncHasuInit(1, "41", String(year));
|
||||
}
|
||||
}, [prfmnc.isInit, prfmncHasuInit]);
|
||||
useEffect(() => {
|
||||
|
||||
|
||||
if(prfmncRes&&prfmncRes.length>0){
|
||||
if (prfmncRes && prfmncRes.length > 0) {
|
||||
|
||||
setbdstTable(prfmncRes);
|
||||
}
|
||||
@@ -224,14 +245,14 @@ export default function prfmncPrfmncReg() {
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button size={"sm"} onClick={(e) => {
|
||||
|
||||
if(searchTxt&&searchTxt?.length>0){
|
||||
prfmncHasuNmSearch(1,'41',searchYear,searchTxt)
|
||||
if (searchTxt && searchTxt?.length > 0) {
|
||||
prfmncHasuNmSearch(1, '41', searchYear, searchTxt)
|
||||
setPageNation(1)
|
||||
}else{
|
||||
prfmncHasuInit(1,'41',searchYear)
|
||||
} else {
|
||||
prfmncHasuInit(1, '41', searchYear)
|
||||
setPageNation(1)
|
||||
}
|
||||
|
||||
|
||||
}}>
|
||||
조회
|
||||
</Button>
|
||||
@@ -282,8 +303,8 @@ export default function prfmncPrfmncReg() {
|
||||
setCellNum(index ?? 0);
|
||||
}}
|
||||
onPageChange={
|
||||
(page) =>{
|
||||
prfmncHasuInit(page, "41",searchYear);
|
||||
(page) => {
|
||||
prfmncHasuInit(page, "41", searchYear);
|
||||
setPageNation(page)
|
||||
}}
|
||||
children={undefined}
|
||||
@@ -303,7 +324,7 @@ export default function prfmncPrfmncReg() {
|
||||
<TableHeader className="font-bold">
|
||||
{headMakeprfmnc(monthHeadList, [])}
|
||||
</TableHeader>
|
||||
<TableBody key={prfmnc.pageKey+'pageKey'}>
|
||||
<TableBody key={prfmnc.pageKey + 'pageKey'}>
|
||||
{InputTableBody(inputData ?? [], monthHeadList, setInputData)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
@@ -319,14 +340,14 @@ export default function prfmncPrfmncReg() {
|
||||
setIsExcelOPen={(open) => {
|
||||
setIsExcelOPen({ ...isExcelOpen, isModal: open })
|
||||
}}
|
||||
setModalExcelData={ async(excelData ) =>{
|
||||
await prfmnRegData(pageNation,'41',
|
||||
setModalExcelData={async (excelData) => {
|
||||
await prfmnRegData(pageNation, '41',
|
||||
excelData,
|
||||
searchYear
|
||||
);
|
||||
// 데이터 저장 후 UI 업데이트는 useEffect가 감지하여 처리하므로 여기서는 호출하지 않습니다.
|
||||
}
|
||||
}
|
||||
}
|
||||
></PbnPrfExcelModal>
|
||||
}
|
||||
open={isExcelOpen.isModal}
|
||||
|
||||
@@ -23,7 +23,8 @@ import {
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Toaster } from "react-hot-toast";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function Page() {
|
||||
const {
|
||||
@@ -97,7 +98,6 @@ export default function Page() {
|
||||
useEffect(() => {
|
||||
if (!rainChkSttn.isInit) {
|
||||
isRainSttn(true)
|
||||
console.log("여기", rainPageSize)
|
||||
rainChkSttnInit(1, rainPageSize, new Date().getFullYear().toString(), commonCd);
|
||||
setIsModal({ data: {}, open: false });
|
||||
}
|
||||
@@ -119,8 +119,13 @@ export default function Page() {
|
||||
},
|
||||
[isModal]
|
||||
);
|
||||
const { t } = useTranslation('base');
|
||||
const excelDown = () => {
|
||||
if (rainChkSttn.sttnExcelList && selFcltDiv === "RNB") {
|
||||
if (!rainChkSttn.sttnExcelList || rainChkSttn.sttnExcelList.length === 0) {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
return;
|
||||
}
|
||||
excelDownload(
|
||||
rainChkSttn.sttnExcelList,
|
||||
"빗물이용시설 지도점검 현황",
|
||||
@@ -129,6 +134,10 @@ export default function Page() {
|
||||
3
|
||||
);
|
||||
} else if (rswtChkSttn.sttnExcelList && selFcltDiv === "RST") {
|
||||
if (!rswtChkSttn.sttnExcelList || rswtChkSttn.sttnExcelList.length === 0) {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
return;
|
||||
}
|
||||
excelDownload(
|
||||
rswtChkSttn.sttnExcelList,
|
||||
"중수도시설 지도점검 현황",
|
||||
|
||||
@@ -11,6 +11,7 @@ import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Button, Label } from "@common/components/ui";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function PbnstPrfmncSttn() {
|
||||
const {
|
||||
@@ -33,12 +34,16 @@ export default function PbnstPrfmncSttn() {
|
||||
const ref = useRef<ReturnType>({} as ReturnType);
|
||||
const [swtrmtFcltNm, setSwtrmtFcltNm] = useState<string>();
|
||||
const [pbnRuseNm, setPbnRuseNm] = useState<string>("");
|
||||
|
||||
const { t } = useTranslation('base');
|
||||
const [searchYear, setSearchYear] = useState<string>(
|
||||
String(new Date().getFullYear())
|
||||
);
|
||||
const [excelData, setExcelData] = useState<any[]>([]);
|
||||
const excelClick = useCallback(() => {
|
||||
if (!excelData || excelData.length === 0) {
|
||||
toast.error(t('excelDownErrMsg'));
|
||||
return;
|
||||
}
|
||||
excelDownload(
|
||||
excelData,
|
||||
"하수재이용실적 현황",
|
||||
@@ -524,14 +529,7 @@ export default function PbnstPrfmncSttn() {
|
||||
selectUnitWaterShedData={code.lgbsnCd}
|
||||
selectMiddleRegionData={code.mdmbsnCd}
|
||||
selectEnvPartData={code.lclgvrnmntCd}
|
||||
rightChildren={<Button
|
||||
className={btnClass}
|
||||
onClick={() => {
|
||||
setIsChHead(true);
|
||||
}}
|
||||
>
|
||||
조회항목설정
|
||||
</Button>}
|
||||
rightChildren={undefined}
|
||||
leftChildren={<div className="col-span-5">
|
||||
<div className="flex flex-row">
|
||||
<div className="flex flex-row items-center">
|
||||
|
||||
@@ -57,7 +57,7 @@ export const rswtChkTableData = (chkData: rswtChkZodType[]) => {
|
||||
const makeRswtData: any[] = [];
|
||||
|
||||
|
||||
if(chkData&&chkData.length>0){
|
||||
if (chkData && chkData.length > 0) {
|
||||
|
||||
chkData?.forEach((root) => {
|
||||
root.rswtrDetails.forEach((detail) => {
|
||||
@@ -99,10 +99,11 @@ export const chRowspanTable = (
|
||||
let order = 0
|
||||
// rowspan된 셀 렌더링 여부 추적용
|
||||
const renderedMap = new Map<string, Set<number>>();
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
{makeTableData.map((row, rowIndex) => (
|
||||
{/* {makeTableData.map((row, rowIndex) => ( */}
|
||||
{makeTableData && makeTableData.length > 0 ? (makeTableData.map((row, rowIndex) => (
|
||||
<TableRow key={rowIndex}>
|
||||
{headList
|
||||
.map((head) => {
|
||||
@@ -177,7 +178,13 @@ export const chRowspanTable = (
|
||||
|
||||
})}
|
||||
</TableRow>
|
||||
))}
|
||||
))) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={headList.length} className="h-24 text-center text-gray-500">
|
||||
조회된 결과가 없습니다.
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -235,44 +242,44 @@ export const InputTableBody = (
|
||||
}
|
||||
return span;
|
||||
};
|
||||
return (
|
||||
return (
|
||||
<>
|
||||
{chgRes.map((data, dataIndex) => {
|
||||
// 소계/총합계 행 판별
|
||||
const isSubTotal = data["용수명"] === "소계";
|
||||
const isTotal = data["구분"] === 0;
|
||||
|
||||
|
||||
const bgClass = isTotal
|
||||
? "bg-[#d5e1eb] font-bold"
|
||||
: isSubTotal
|
||||
? "bg-[#e6eef5] font-semibold"
|
||||
: "";
|
||||
? "bg-[#e6eef5] font-semibold"
|
||||
: "";
|
||||
|
||||
return (
|
||||
<TableRow key={dataIndex + "row"}>
|
||||
{headList.map((head, headIndex) => {
|
||||
// 총합계 행이면 "구분"에서 colSpan=2로 병합
|
||||
if (
|
||||
data["구분"] === 0 &&
|
||||
head.id === "구분"
|
||||
) {
|
||||
return (
|
||||
<TableCell
|
||||
key={head.id + headIndex}
|
||||
colSpan={2}
|
||||
className="font-bold text-center bg-[#d5e1eb]"
|
||||
>
|
||||
총합계
|
||||
</TableCell>
|
||||
);
|
||||
}
|
||||
// 총합계(합계) 행이면 "용수명" 컬럼은 렌더링하지 않음
|
||||
if (
|
||||
data["구분"] === 0 &&
|
||||
head.id === "용수명"
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
// 총합계 행이면 "구분"에서 colSpan=2로 병합
|
||||
if (
|
||||
data["구분"] === 0 &&
|
||||
head.id === "구분"
|
||||
) {
|
||||
return (
|
||||
<TableCell
|
||||
key={head.id + headIndex}
|
||||
colSpan={2}
|
||||
className="font-bold text-center bg-[#d5e1eb]"
|
||||
>
|
||||
총합계
|
||||
</TableCell>
|
||||
);
|
||||
}
|
||||
// 총합계(합계) 행이면 "용수명" 컬럼은 렌더링하지 않음
|
||||
if (
|
||||
data["구분"] === 0 &&
|
||||
head.id === "용수명"
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
// mergeCell 처리
|
||||
if (head.mergeCell) {
|
||||
const rowSpan = getRowSpan(chgRes, head.id, dataIndex);
|
||||
|
||||
@@ -6,24 +6,26 @@ import {
|
||||
filePickedBlobArray,
|
||||
type SheetParameter,
|
||||
} from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import type { RefObject } from "react";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export const getCity = (val: string, sggCd: SelectDataType[]) => {
|
||||
|
||||
let data:any
|
||||
if(val !=='0'){
|
||||
let data: any
|
||||
if (val !== '0') {
|
||||
data = sggCd
|
||||
.filter((item) => String(item.val).substring(0, 2) === val)
|
||||
.map((item) => ({
|
||||
val: item.val,
|
||||
text: item.text, // 한국어 텍스트
|
||||
}));
|
||||
}else{
|
||||
.filter((item) => String(item.val).substring(0, 2) === val)
|
||||
.map((item) => ({
|
||||
val: item.val,
|
||||
text: item.text, // 한국어 텍스트
|
||||
}));
|
||||
} else {
|
||||
data = sggCd
|
||||
.map((item) => ({
|
||||
val: item.val,
|
||||
text: item.text, // 한국어 텍스트
|
||||
}));
|
||||
.map((item) => ({
|
||||
val: item.val,
|
||||
text: item.text, // 한국어 텍스트
|
||||
}));
|
||||
}
|
||||
data.unshift({ val: "0", text: "전체" });
|
||||
return data;
|
||||
@@ -92,7 +94,7 @@ export const excelDownload = (
|
||||
export const excelArrayDownload = (
|
||||
fileNm: string,
|
||||
sampleFile: string,
|
||||
sheetArray:SheetParameter []
|
||||
sheetArray: SheetParameter[]
|
||||
) => {
|
||||
if (!sheetArray) return;
|
||||
fetch(`/${sampleFile}`, {}).then(async (response) => {
|
||||
@@ -113,7 +115,7 @@ export const handleCommaNumberChange = (
|
||||
) => {
|
||||
const raw = e.target.value.replace(/,/g, "");
|
||||
if (!/^\d*$/.test(raw)) return;
|
||||
onChange(raw === "" ? "" : Number(raw));
|
||||
onChange(raw === "" ? "" : Number(raw));
|
||||
};
|
||||
|
||||
|
||||
@@ -124,7 +126,7 @@ export const handleMinusNumberChange = (
|
||||
) => {
|
||||
const raw = e.target.value.replace(/,/g, "");
|
||||
if (!/^\d*$/.test(raw)) return;
|
||||
onChange(raw === "" ? -1 : Number(raw));
|
||||
onChange(raw === "" ? -1 : Number(raw));
|
||||
};
|
||||
|
||||
// 숫자입력시 , 삽입
|
||||
@@ -175,14 +177,14 @@ export const getdmdMatFlag = (flag: string | undefined | null) => {
|
||||
case "Matched":
|
||||
return "매칭완료";
|
||||
case "Checked":
|
||||
return '검토완료';
|
||||
return '검토완료';
|
||||
default:
|
||||
return "신청";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export const formatPhoneNumber=(tel:string) => {
|
||||
export const formatPhoneNumber = (tel: string) => {
|
||||
const onlyNums = tel.replace(/[^0-9]/g, '');
|
||||
if (onlyNums.length === 10) {
|
||||
return onlyNums.replace(/(\d{2})(\d{4})(\d{4})/, '$1-$2-$3');
|
||||
@@ -191,4 +193,32 @@ export const formatPhoneNumber=(tel:string) => {
|
||||
} else {
|
||||
return tel; // 유효하지 않으면 빈 문자열
|
||||
}
|
||||
}
|
||||
|
||||
export const confirmToast = (content: string, saveFunc: () => void) => {
|
||||
toast((t) => (
|
||||
<span className="flex flex-col items-center">
|
||||
<div className="mb-6">
|
||||
{content}
|
||||
</div>
|
||||
<div className="flex flex-row space-x-2">
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={() => {
|
||||
saveFunc();
|
||||
toast.dismiss(t.id);
|
||||
}}
|
||||
>
|
||||
확인
|
||||
</Button>
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={() => toast.dismiss(t.id)}>취소</Button>
|
||||
</div>
|
||||
</span>
|
||||
),
|
||||
{
|
||||
id: "global-confirm-toast", // 중복 토스트 방지
|
||||
duration: Infinity, // 자동 사라짐 방지
|
||||
});
|
||||
}
|
||||
@@ -19,11 +19,13 @@ import {
|
||||
import { useEffect, useState } from "react";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
import {
|
||||
confirmToast,
|
||||
formatCommaNumber,
|
||||
handleCommaNumberChange,
|
||||
} from "@/components/lib/func/commom";
|
||||
import { formH1Class } from "@/components/lib/class/comClass";
|
||||
import toast from "react-hot-toast";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function HtdflRegForm({
|
||||
htdflForm,
|
||||
@@ -48,20 +50,25 @@ export default function HtdflRegForm({
|
||||
|
||||
const bdstNm = form.watch("bdstNm");
|
||||
const isPowerPlant = bdstNm?.includes("발전소");
|
||||
|
||||
const { t } = useTranslation('base');
|
||||
const onSubmit = (values: z.infer<typeof hdtflZod>) => {
|
||||
if (isModal) {
|
||||
const data = regCtpvCd ? regCtpvCd : regSggcd ? regSggcd : "noCd";
|
||||
|
||||
if (data === "noCd") {
|
||||
toast.error("시도/시군구 코드를 선택해야합니다.");
|
||||
return;
|
||||
}
|
||||
htdflBdstReg(values, data);
|
||||
if (setIsModal) setIsModal(false);
|
||||
const handleConfirm = async () => {
|
||||
htdflBdstReg(values, data);
|
||||
if (setIsModal) setIsModal(false);
|
||||
};
|
||||
confirmToast(t('isInsertMsg'), handleConfirm);
|
||||
} else {
|
||||
const handleConfirm = async () => {
|
||||
htdflBdstUpdate(values, "0");
|
||||
};
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
|
||||
htdflBdstUpdate(values, "0");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -90,15 +97,15 @@ export default function HtdflRegForm({
|
||||
};
|
||||
};
|
||||
const [divStyle, setDivStyle] = useState("h-[53vh]");
|
||||
useEffect(()=>{
|
||||
if(isModal===true){
|
||||
useEffect(() => {
|
||||
if (isModal === true) {
|
||||
setDivStyle("h-[53vh] max-h-[37vh]")
|
||||
}else if(readonly===true){
|
||||
} else if (readonly === true) {
|
||||
setDivStyle("h-[62vh]")
|
||||
}else{
|
||||
} else {
|
||||
setDivStyle("h-[53vh]")
|
||||
}
|
||||
},[isModal,readonly]);
|
||||
}, [isModal, readonly]);
|
||||
|
||||
useEffect(() => {
|
||||
console.log("form errors:", form.formState.errors);
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import { formH1Class, formH2Class } from "@/components/lib/class/comClass";
|
||||
import {
|
||||
confirmToast,
|
||||
formatCommaNumber,
|
||||
handleMinusNumberChange,
|
||||
} from "@/components/lib/func/commom";
|
||||
@@ -21,6 +22,7 @@ import { z } from "zod";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
import toast from "react-hot-toast";
|
||||
import BdstAdd from "../bdstReg/bdstAdd";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function RainRegForm({
|
||||
rainForm,
|
||||
@@ -40,9 +42,10 @@ export default function RainRegForm({
|
||||
const defaultValues: z.infer<typeof rainZod> = rainZod.parse({});
|
||||
const form = useForm<z.infer<typeof rainZod>>({
|
||||
resolver: zodResolver(rainZod),
|
||||
// defaultValues: defaultValues,
|
||||
// defaultValues: defaultValues,
|
||||
});
|
||||
const instlCst = form.watch(`reuseBuilding.0.instlCst`);
|
||||
const { t } = useTranslation('base');
|
||||
|
||||
const [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctYn] = form.watch([
|
||||
"reuseBuilding.0.grntchBdstCertYn",
|
||||
@@ -51,15 +54,15 @@ export default function RainRegForm({
|
||||
]);
|
||||
|
||||
const [divStyle, setDivStyle] = useState("h-[53vh]");
|
||||
useEffect(()=>{
|
||||
if(isModal===true){
|
||||
useEffect(() => {
|
||||
if (isModal === true) {
|
||||
setDivStyle("h-[53vh] max-h-[37vh]")
|
||||
}else if(readonly===true){
|
||||
} else if (readonly === true) {
|
||||
setDivStyle("h-[62vh]")
|
||||
}else{
|
||||
} else {
|
||||
setDivStyle("h-[53vh]")
|
||||
}
|
||||
},[isModal,readonly]);
|
||||
}, [isModal, readonly]);
|
||||
|
||||
const cleanRainData = (raw: any): z.infer<typeof rainZod> => {
|
||||
const buildings =
|
||||
@@ -122,7 +125,7 @@ export default function RainRegForm({
|
||||
|
||||
// form 값이 변경될 때마다 로그 출력
|
||||
useEffect(() => {
|
||||
const subscription = form.watch((value) => {});
|
||||
const subscription = form.watch((value) => { });
|
||||
return () => subscription.unsubscribe();
|
||||
}, [form]);
|
||||
|
||||
@@ -139,10 +142,16 @@ export default function RainRegForm({
|
||||
return;
|
||||
}
|
||||
|
||||
rainBdstReg(values, data);
|
||||
if (setIsModal) setIsModal(false);
|
||||
const handleConfirm = async () => {
|
||||
rainBdstReg(values, data);
|
||||
if (setIsModal) setIsModal(false);
|
||||
};
|
||||
confirmToast(t('isInsertMsg'), handleConfirm);
|
||||
} else {
|
||||
rainBdstUpdate(values, "41");
|
||||
const handleConfirm = async () => {
|
||||
rainBdstUpdate(values, "41");
|
||||
};
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -174,150 +183,97 @@ export default function RainRegForm({
|
||||
</div>
|
||||
</div>
|
||||
<ScrollArea className={divStyle}>
|
||||
{isModal && rainForm != undefined ? <BdstReg form={form} /> : <></>}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4">
|
||||
빗물이용시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<h1 className={formH1Class}>기본정보</h1>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCmptnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
field.value && !isNaN(new Date(field.value).getTime())
|
||||
? new Date(field.value)
|
||||
: new Date(),
|
||||
onChange: (date: Date | undefined) =>
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
{isModal && rainForm != undefined ? <BdstReg form={form} /> : <></>}
|
||||
{isModal ? (
|
||||
<h1 className="pl-3 text-xl col-span-10 mt-4">
|
||||
빗물이용시설 정보{" "}
|
||||
</h1>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
<h1 className={formH1Class}>기본정보</h1>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCmptnDt"
|
||||
render={({ field }) => (
|
||||
<FormUi label="설치완료일">
|
||||
<DatePicker
|
||||
mode="single"
|
||||
field={{
|
||||
value:
|
||||
field.value && !isNaN(new Date(field.value).getTime())
|
||||
? new Date(field.value)
|
||||
: new Date(),
|
||||
onChange: (date: Date | undefined) =>
|
||||
field.onChange(date),
|
||||
}}
|
||||
selectClass={"w-full"}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`reuseBuilding.0.instlCst`}
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="설치비(원)">
|
||||
<Input
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
className={selectClass}
|
||||
readOnly={readonly}
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name={`reuseBuilding.0.instlCst`}
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="설치비(원)">
|
||||
<Input
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
className={selectClass}
|
||||
readOnly={readonly}
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="">
|
||||
<h1 className={formH1Class}>빗물이용시설 정보</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={formH2Class}>집수면 및 저류조</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-4 mt-4 ">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.dtfcltCpct"
|
||||
render={({ field }) => {
|
||||
const isUnknown = field.value === null || field.value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="저류조 용량(m³)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={
|
||||
isUnknown
|
||||
? "확인불가"
|
||||
: formatCommaNumber(field.value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
<div className="">
|
||||
<h1 className={formH1Class}>빗물이용시설 정보</h1>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.pntfColKnd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="집수면 종류">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={rainFcltCd}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value ?? rainFcltCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
<div>
|
||||
<h2 className={formH2Class}>집수면 및 저류조</h2>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.pntfColArea"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<FormUi label="집수면 용량(m³)">
|
||||
<div className="grid grid-cols-12 gap-4 mt-4 ">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.dtfcltCpct"
|
||||
render={({ field }) => {
|
||||
const isUnknown = field.value === null || field.value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="저류조 용량(m³)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
isUnknown
|
||||
? "확인불가"
|
||||
: formatCommaNumber(field.value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
@@ -332,274 +288,327 @@ export default function RainRegForm({
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className={formH2Class}>여과 등 처리시설</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="유무">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstFilterYn}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctCpct"
|
||||
render={({ field }) => {
|
||||
const isUnknown = field.value === null || field.value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="용량(m³/일)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={
|
||||
isUnknown
|
||||
? "확인불가"
|
||||
: formatCommaNumber(field.value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.pntfColKnd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="집수면 종류">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={rainFcltCd}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value ?? rainFcltCd[0]?.val}
|
||||
readOnly={readonly}
|
||||
disabled={filtrTrtmfctYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.pntfColArea"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<FormUi label="집수면 용량(m³)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctPrs"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === "-"; // 또는 Number(value) === -1
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<FormUi label="처리공정">
|
||||
<div>
|
||||
<h2 className={formH2Class}>여과 등 처리시설</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-12 gap-2 mt-4">
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="유무">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstFilterYn}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctCpct"
|
||||
render={({ field }) => {
|
||||
const isUnknown = field.value === null || field.value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="용량(m³/일)">
|
||||
<Input
|
||||
className={" h-full !text-xl col-span-4"}
|
||||
placeholder="처리공정 입력"
|
||||
className={selectClass}
|
||||
placeholder="1,000,000"
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
value={
|
||||
isUnknown
|
||||
? "확인불가"
|
||||
: formatCommaNumber(field.value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
readOnly={readonly}
|
||||
disabled={filtrTrtmfctYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-2">
|
||||
<h1 className={formH1Class}>인센티브 정보</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={formH2Class}>설치비 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-10 gap-2 mt-4">
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원 여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtAmt"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="text"
|
||||
readOnly={readonly || isUnknown}
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
disabled={instlCstSprtYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={formH2Class}>녹색건축물 인증</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => {
|
||||
const isUnknown =
|
||||
field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증년도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="2024"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? "")}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
if (e.target.value === "확인불가") {
|
||||
field.onChange("0000");
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={grntchBdstCertYn !== "Y"}
|
||||
max={4}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 ">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertNo"
|
||||
render={({ field }) => {
|
||||
const isUnknown =
|
||||
field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? "")}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-4">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.rainyObj.filtrTrtmfctPrs"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === "-"; // 또는 Number(value) === -1
|
||||
|
||||
if (e.target.value === "확인불가") {
|
||||
field.onChange("");
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={grntchBdstCertYn !== "Y"}
|
||||
return (
|
||||
<div className="flex items-center gap-2">
|
||||
<FormUi label="처리공정">
|
||||
<Input
|
||||
className={" h-full !text-xl col-span-4"}
|
||||
placeholder="처리공정 입력"
|
||||
type="text"
|
||||
value={field.value ?? ""}
|
||||
onChange={field.onChange}
|
||||
readOnly={readonly}
|
||||
disabled={filtrTrtmfctYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className=" my-2">
|
||||
<h1 className={formH1Class}>인센티브 정보</h1>
|
||||
</div>
|
||||
<div>
|
||||
<h2 className={formH2Class}>설치비 지원</h2>
|
||||
</div>
|
||||
<div className="grid grid-cols-10 gap-2 mt-4">
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="지원 여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-5">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.instlCstSprtAmt"
|
||||
render={({ field }) => {
|
||||
const value = field.value;
|
||||
const isUnknown = value === null || value === -1; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="지원금액(원)">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder=""
|
||||
type="text"
|
||||
readOnly={readonly || isUnknown}
|
||||
value={
|
||||
isUnknown ? "확인불가" : formatCommaNumber(value)
|
||||
}
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
handleMinusNumberChange(e, field.onChange);
|
||||
}}
|
||||
disabled={instlCstSprtYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertGrd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstGrntchClass}
|
||||
onSelectValue={readonly ? () => {} : field.onChange}
|
||||
value={field.value ?? code.bdstGrntchClass[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
<div>
|
||||
<h2 className={formH2Class}>녹색건축물 인증</h2>
|
||||
</div>
|
||||
</div>
|
||||
<BdstAdd form={form} readonly={readonly}></BdstAdd>
|
||||
<div className="grid grid-cols-6 gap-2 mt-4">
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYn"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증여부">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstIncenYn}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value ?? code.yn[0]?.val}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertYr"
|
||||
render={({ field }) => {
|
||||
const isUnknown =
|
||||
field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증년도">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="2024"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? "")}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
if (e.target.value === "확인불가") {
|
||||
field.onChange("0000");
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={grntchBdstCertYn !== "Y"}
|
||||
max={4}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3 ">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertNo"
|
||||
render={({ field }) => {
|
||||
const isUnknown =
|
||||
field.value === null || field.value === "0000"; // 또는 Number(value) === -1
|
||||
return (
|
||||
<FormUi label="인증번호">
|
||||
<Input
|
||||
className={selectClass}
|
||||
placeholder="ab1234678"
|
||||
type=""
|
||||
onFocus={() => {
|
||||
// 입력 시 자동으로 확인불가 해제
|
||||
if (isUnknown && !readonly) {
|
||||
field.onChange(""); // 초기화
|
||||
}
|
||||
}}
|
||||
value={isUnknown ? "확인불가" : (field.value ?? "")}
|
||||
onChange={(e) => {
|
||||
if (readonly) return;
|
||||
|
||||
if (e.target.value === "확인불가") {
|
||||
field.onChange("");
|
||||
} else {
|
||||
field.onChange(e.target.value);
|
||||
}
|
||||
}}
|
||||
disabled={grntchBdstCertYn !== "Y"}
|
||||
/>
|
||||
</FormUi>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-3">
|
||||
<FormField
|
||||
control={form.control}
|
||||
name="reuseBuilding.0.grntchBdstCertGrd"
|
||||
render={({ field }) => (
|
||||
<FormUi label="인증등급">
|
||||
<SelectBox
|
||||
className={""}
|
||||
selectClass={selectClass}
|
||||
label={""}
|
||||
selectArray={code.bdstGrntchClass}
|
||||
onSelectValue={readonly ? () => { } : field.onChange}
|
||||
value={field.value ?? code.bdstGrntchClass[0]?.val}
|
||||
readOnly={readonly}
|
||||
/>
|
||||
</FormUi>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<BdstAdd form={form} readonly={readonly}></BdstAdd>
|
||||
</ScrollArea>
|
||||
</form>
|
||||
</Form>
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import { formH1Class, formH2Class } from "@/components/lib/class/comClass";
|
||||
import {
|
||||
confirmToast,
|
||||
formatCommaNumber,
|
||||
handleMinusNumberChange
|
||||
} from "@/components/lib/func/commom";
|
||||
@@ -25,6 +26,7 @@ import { useForm } from "react-hook-form";
|
||||
import { z } from "zod";
|
||||
import BdstAdd from "../bdstReg/bdstAdd";
|
||||
import BdstReg from "../bdstReg/bdstReg";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
export default function RswtrRegForm({
|
||||
rswtForm,
|
||||
@@ -41,20 +43,20 @@ export default function RswtrRegForm({
|
||||
(state) => state
|
||||
);
|
||||
const [divStyle, setDivStyle] = useState("h-[53vh]");
|
||||
useEffect(()=>{
|
||||
if(isModal===true){
|
||||
useEffect(() => {
|
||||
if (isModal === true) {
|
||||
setDivStyle("h-[53vh] max-h-[37vh]")
|
||||
}else if(readonly===true){
|
||||
} else if (readonly === true) {
|
||||
setDivStyle("h-[62vh]")
|
||||
}else{
|
||||
} else {
|
||||
setDivStyle("h-[53vh]")
|
||||
}
|
||||
},[isModal,readonly]);
|
||||
// const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
}, [isModal, readonly]);
|
||||
// const defaultValues: z.infer<typeof rswtZod> = rswtZod.parse({});
|
||||
|
||||
const form = useForm<z.infer<typeof rswtZod>>({
|
||||
resolver: zodResolver(rswtZod),
|
||||
// defaultValues: defaultValues,
|
||||
// defaultValues: defaultValues,
|
||||
});
|
||||
|
||||
const [grntchBdstCertYn, instlCstSprtYn, filtrTrtmfctProcs] = form.watch([
|
||||
@@ -63,12 +65,20 @@ export default function RswtrRegForm({
|
||||
"reuseBuilding.0.rswtrObj.filtrTrtmfctProcs",
|
||||
]);
|
||||
|
||||
const { t } = useTranslation('base');
|
||||
const onSubmit = (values: z.infer<typeof rswtZod>) => {
|
||||
if (isModal) {
|
||||
rswtBdstReg(values, "41");
|
||||
if (setIsModal) setIsModal(false);
|
||||
const handleConfirm = async () => {
|
||||
rswtBdstReg(values, "41");
|
||||
if (setIsModal) setIsModal(false);
|
||||
};
|
||||
confirmToast(t('isInsertMsg'), handleConfirm);
|
||||
|
||||
} else {
|
||||
rswtBdstUpdate(values, "41");
|
||||
const handleConfirm = async () => {
|
||||
rswtBdstUpdate(values, "41");
|
||||
};
|
||||
confirmToast(t('isUpdateMsg'), handleConfirm);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -8,12 +8,16 @@
|
||||
"noChangedErrMsg": "변경사항이 없습니다.",
|
||||
"dateErrMsg": "시작년도를 종료년도 이후로 설정할 수 없습니다.",
|
||||
"fileDateErrMsg": "파일업로드 이전에 등록년도를 작성해주세요.",
|
||||
"isDeleteMsg": "선택한 정보를 삭제하시겠습니까?",
|
||||
"isUpdateMsg": "수정한 정보를 저장하시겠습니까?",
|
||||
"isInsertMsg": "등록하시겠습니까?",
|
||||
"excelDownErrMsg": "다운로드할 데이터가 없습니다.",
|
||||
|
||||
"alreadyInsertedErrMsg": "사업자번호 {{num}}(은)는 이미 등록되었습니다. 다시 등록해주세요.",
|
||||
"saveRowErrMsg": "수정을 원하는 행을 선택하고 저장버튼을 눌러주세요.",
|
||||
"costCalcErrMsg":"공사비 계산 진행 후 저장을 눌러주세요",
|
||||
"costCalcErrMsg":"공사비 계산 진행 후 저장을 눌러주세요",
|
||||
"maxYearErrMsg": "최대 {{year}}년까지 선택가능합니다.",
|
||||
"checkQtyMsg": "요구수량(M3/d)을 확인해주세요 계산할수 없습니다."
|
||||
"checkQtyMsg": "요구수량(M3/d)을 확인해주세요 계산할 수 없습니다."
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,13 @@ export function UiTable({ tableData, headlist, pageSize, total, headName, childr
|
||||
)
|
||||
))}
|
||||
</TableRow>
|
||||
)) : <></>}
|
||||
)) : (
|
||||
<TableRow>
|
||||
<TableCell colSpan={headlist.filter((item) => item.visible != false).length} className="h-24 text-center text-gray-500">
|
||||
조회된 결과가 없습니다.
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
{total <= 0 ? <></> : <UiPageNations total={total} cur={cur} pageSize={pageSize} onPageChange={handlePageChange} />}
|
||||
|
||||
Reference in New Issue
Block a user