From 61411158d1d91f8778ed3819fb0a678137080c50 Mon Sep 17 00:00:00 2001 From: swcho Date: Tue, 8 Jul 2025 11:20:48 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20-=20=EC=B9=A8=EC=9E=85=EC=88=98=20?= =?UTF-8?q?=EB=B6=84=EC=84=9D,=20RDII=20=EB=B6=84=EC=84=9D=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A1=B0=ED=9A=8C=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20-=20=EC=85=80=20=ED=81=B4=EB=A6=AD=20?= =?UTF-8?q?=EC=9C=A0=EC=A7=80=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C,=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../(with-base-layout)/oper/floodPre/page.tsx | 47 +++++++++++++++---- .../(with-base-layout)/oper/oldPp/page.tsx | 44 ++++++++++++++--- 2 files changed, 77 insertions(+), 14 deletions(-) diff --git a/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx b/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx index 6ae0b3609..3578ff967 100644 --- a/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx +++ b/apps/sn/app/(with-base-layout)/oper/floodPre/page.tsx @@ -27,16 +27,16 @@ const Page = () => { const [curPage, setCurPage] = useState(1) //현재 페이지 const [totalData, setTotalData] = useState(0) //총 데이터 수 const [isLoading, setIsLoading] = useState(true) //로딩 상태 + + // 조회 const fetchData = async () => { setIsLoading(true) - searchCmmnCd('SITEKNDCD') + // searchCmmnCd('SITEKNDCD') try { const { data, total } = await searchData('v1/sbmrgPrevnt', { fromRegDt: formatDate(fromDate), - fromMngYr: manageYear, - toMngYr: mngQu, toRegDt: formatDate(toDate), - atflNm: pjNm, + sbmrgPrevntBizNm: pjNm, rgtrNm: usr, page: curPage - 1, size: '10' @@ -45,12 +45,18 @@ const Page = () => { setTotalData(total) } catch (error) { console.error('Error fetching data:', error) } - finally { setIsLoading(false); } + finally { + setFileNm(''); + setAtflId(''); + setSbmrgPrevntBizSn(''); + setIsLoading(false); + } } useEffect(() => { setCurPage(1) fetchData() }, []) + // 파일 다운로드 const isChckFile = () => { if (fileNm === '' || fileNm === undefined) { @@ -59,6 +65,7 @@ const Page = () => { } handleDownload(`/attach-service/api/v1/download/${atflId}`, fileNm) } + // 선택 파일 삭제 const isDeleteFile = async () => { if (sbmrgPrevntBizSn === '' || sbmrgPrevntBizSn === undefined) { @@ -96,11 +103,19 @@ const Page = () => { { if (date) setFromDate(date) }} /> + onSelect={(date: Date | undefined) => { if (date) setFromDate(date) }} + modifiers={{ + disabled: { after: new Date() } + }} + /> ~ { if (date) setToDate(date) }} /> + onSelect={(date: Date | undefined) => { if (date) setToDate(date) }} + modifiers={{ + disabled: { after: new Date() } + }} + />
@@ -132,7 +147,23 @@ const Page = () => {
- { if (index != null) { const fileName = tableData[index]?.sbmrgPrevntBizNm ?? ""; setFileNm(fileName); const id = tableData[index]?.atflId ?? ''; setAtflId(id); setSbmrgPrevntBizSn(tableData[index]?.sbmrgPrevntBizSn); } }} onPageChange={async (page: number) => { setCurPage(page); await fetchData() }}> + { + if (index != null) { + const fileName = tableData[index]?.sbmrgPrevntBizNm ?? ""; + const id = tableData[index]?.atflId ?? ''; + setFileNm(fileName); + setAtflId(id); + setSbmrgPrevntBizSn(tableData[index]?.sbmrgPrevntBizSn); + } + }} + onPageChange={async (page: number) => { setCurPage(page); await fetchData() }} + /> { await registFile(file, year, quater, cd, id) }} /> diff --git a/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx b/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx index 307452e2d..c4bac35b7 100644 --- a/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx +++ b/apps/sn/app/(with-base-layout)/oper/oldPp/page.tsx @@ -25,14 +25,13 @@ const Page = () => { const [curPage, setCurPage] = useState(1) const [totalData, setTotalData] = useState(0) //총 데이터 수 const [isLoading, setIsLoading] = useState(true) //로딩 상태 + // 데이터 조회 const fetchData = async () => { setIsLoading(true) try { const { data, total } = await searchData('v1/dcrpPpl', { fromRegDt: formatDate(fromDate), - fromMngYr: manageYear, - toMngYr: mngQu, toRegDt: formatDate(toDate), dcrpPplMtncBizNm: pjNm, rgtrNm: usr, @@ -44,12 +43,18 @@ const Page = () => { console.log(data, total) } catch (error) { console.error('Error fetching data:', error) - } finally { setIsLoading(false) } + } finally { + setFileNm(''); + setAtflId(''); + setDcrpPplMtncBizSn(''); + setIsLoading(false) + } } useEffect(() => { setCurPage(1) fetchData() }, []) + // 파일 다운로드 const isChckFile = () => { if (fileNm === '' || fileNm === undefined) { @@ -59,6 +64,7 @@ const Page = () => { handleDownload(`/attach-service/api/v1/download/${atflId}`, fileNm) return true } + // 파일 삭제 const isDeleteFile = async () => { if (dcrpPplMtncBizSn === '' || dcrpPplMtncBizSn === undefined) { @@ -76,6 +82,7 @@ const Page = () => { } } } + // 파일 등록 const registFile = async (fileNm: string, year: string, quater: string, cd: string, id: string) => { const data = await postData('v1/dcrpPpl', { @@ -88,6 +95,8 @@ const Page = () => { }) if (data) { alert('파일이 등록되었습니다.'); fetchData() } } + + return ( <> @@ -98,11 +107,17 @@ const Page = () => { { if (date) setFromDate(date) }} /> + onSelect={(date: Date | undefined) => { if (date) setFromDate(date) }} + modifiers={{ + disabled: { after: new Date() } + }} /> ~ { if (date) setToDate(date) }} /> + onSelect={(date: Date | undefined) => { if (date) setToDate(date) }} + modifiers={{ + disabled: { after: new Date() } + }} />
{
- { if (index != null) { const fileName = tableData[index]?.dcrpPplMtncBizNm ?? ""; setFileNm(fileName); const id = tableData[index]?.atflId ?? ''; setAtflId(id); setDcrpPplMtncBizSn(tableData[index]?.dcrpPplMtncBizSn) } }} onPageChange={async (page: number) => { setCurPage(page); await fetchData() }}> + { + if (index != null) { + const fileName = tableData[index]?.dcrpPplMtncBizNm ?? ""; + const id = tableData[index]?.atflId ?? ''; + setFileNm(fileName); + setAtflId(id); + setDcrpPplMtncBizSn(tableData[index]?.dcrpPplMtncBizSn); + } + }} + onPageChange={async (page: number) => { setCurPage(page); await fetchData() }} + />
{ await registFile(file, year, quater, cd, id) }} />