Merge commit 'f592ab31d86a86ce305ce8b4a65170340d03186a' into iipbs/wr/hasuReg
iipbs_wr / build (push) Waiting to run
iipbs_wr / build (push) Waiting to run
This commit is contained in:
+255
-191
@@ -2,12 +2,11 @@ import { useWrStore } from "@/app/store";
|
||||
import { btnClass } from "@/app/store/common/code";
|
||||
import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import { excelDownload } from "@/components/lib/func/commom";
|
||||
import { Title, UiTable, UITab, ContentsDiv } from '@common/business_components';
|
||||
import { Title, UiTable, UITab } from '@common/business_components';
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import { Button } from "@common/components/ui";
|
||||
import React, { useCallback, useState, useEffect } from 'react';
|
||||
import NewWindowPortal from '@/app/map/newWindowPortal';
|
||||
import PbnstPrfmncSttnPopup from "@/app/map/pbnstPrfmncSttnPopup";
|
||||
import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
|
||||
import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
|
||||
import type { chgBuilding, customRainBdst } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
@@ -16,6 +15,7 @@ import RswtrPrfmncsSttnPopup from "@/app/map/rswtrPrfmncSttnPopup";
|
||||
import type { customRswtBdst } from "@/app/store/ruseFcltMng/fcltReg/rswtReg";
|
||||
import HtdflPrfmncSttnPopup from "@/app/map/htdflPrfmncSttnPopup";
|
||||
import type { customHtdflBdst } from "@/app/store/ruseFcltMng/fcltReg/htdflReg";
|
||||
import { getFetch } from "@/components/lib/api";
|
||||
|
||||
interface NewWindowPopupProps {
|
||||
featureData: any;
|
||||
@@ -24,13 +24,6 @@ interface NewWindowPopupProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
// 탭
|
||||
const TABS = [
|
||||
{ val: "0", text: "재이용시설1" },
|
||||
{ val: "1", text: "재이용시설2" },
|
||||
{ val: "2", text: "재이용시설n" },
|
||||
];
|
||||
|
||||
// 데이터의 속성(key)을 사용자에게 보여줄 한글 이름으로 변환하기 위한 맵
|
||||
// 실제 데이터에 맞게 이 부분을 확장해야 합니다.
|
||||
const propertyNameMap: { [key: string]: string } = {
|
||||
@@ -47,9 +40,10 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
checkedLayersData = [],
|
||||
onClose
|
||||
}) => {
|
||||
const [activeTab, setActiveTab] = useState(TABS[0]?.val ?? "0");
|
||||
const [tabData, setTabData] = useState<{ id: string; name: string; data: any }[]>([]);
|
||||
const [activeTab, setActiveTab] = useState<string>('0');
|
||||
// swcho : useState의 true, false 값 변경하여 목록, 상태 테스트 하였음
|
||||
const [showDetailView, setShowDetailView] = useState(true); // 상세정보 화면 표시 상태 추가
|
||||
const [showDetailView, setShowDetailView] = useState(false); // 상세정보 화면 표시 상태 추가
|
||||
|
||||
// onClose 함수를 useCallback으로 메모이제이션
|
||||
const memoizedOnClose = useCallback(() => {
|
||||
@@ -67,6 +61,7 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
} = useWrStore((state) => state);
|
||||
const [bdstTable, setBdstTable] = useState<WaterReuseFacility[]>();
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
const [pbnstRuseFcltPk, setPbnstRuseFcltPk] = useState<string>('');
|
||||
const [pbnDetaileData, setPbnDetaileData] = useState<{
|
||||
isModal: boolean;
|
||||
data: customPbnst;
|
||||
@@ -107,10 +102,6 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
return null;
|
||||
}
|
||||
|
||||
// 2. RuseMngTable에 필요한 tableData를 생성합니다. (단일 행 데이터)
|
||||
const tableData = [featureData];
|
||||
console.log("tableData", tableData);
|
||||
|
||||
// 물재이용시설 cellClick 이벤트 (상세정보)
|
||||
const pbnstCellClick = (index: number | undefined) => {
|
||||
if (
|
||||
@@ -118,20 +109,93 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
pbnstSttn.pbnstSttnRes &&
|
||||
pbnstSttn.pbnstSttnRes[index]
|
||||
) {
|
||||
const pbnstRuseFcltPk = pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk;
|
||||
getPbnStnDetail(pbnstRuseFcltPk);
|
||||
setPbnstRuseFcltPk(pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk);
|
||||
fetchpbnstDetail(pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk)
|
||||
setActiveTab(pbnstSttn.pbnstSttnRes[index].pbnstRuseFcltPk)
|
||||
setShowDetailView(true); // 상세정보 화면 표시 상태 변경
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setBdstTable(pbnstSttn.pbnstSttnRes);
|
||||
}, [pbnstSttn.pbnstSttnRes]);
|
||||
useEffect(() => {
|
||||
if (!pbnstSttn.isInit) {
|
||||
pbnSttnInit("1", "13",{
|
||||
partValue: "A",
|
||||
sidoValue: "0",
|
||||
sigunValue: "",
|
||||
regionValue: "",
|
||||
unitWaterShedValue: "",
|
||||
middleRegionValue: "",
|
||||
envPartValue: "",
|
||||
sidoText: "",
|
||||
sigunText: ""
|
||||
}, String(new Date().getFullYear()));
|
||||
}
|
||||
}, [pbnstSttn.isInit]);
|
||||
|
||||
useEffect(() => {
|
||||
setBdstTable(pbnstSttn.pbnstSttnRes);
|
||||
}, [pbnstSttn.pbnstSttnRes]);
|
||||
|
||||
// 재이용시설 상세정보
|
||||
const setTabDataFunc = (res:any, pk:string) => {
|
||||
setTabData((prev) => {
|
||||
if (prev.some((tab) => tab.id === pk)) {
|
||||
return prev; // 이미 존재하는 탭이면 추가하지 않음
|
||||
}
|
||||
return [...prev, { id: pk, name: `재이용시설 ${prev.length + 1}`, data: res }];
|
||||
});
|
||||
}
|
||||
// 재이용시설 조회
|
||||
const fetchpbnstDetail = async (featureCd: string) => {
|
||||
try {
|
||||
const response = await getFetch("wr", `/reuseFc/pubFc/${featureCd}`);
|
||||
// 중복 데이터 추가 방지
|
||||
setTabDataFunc(response, featureCd);
|
||||
} catch (error) {
|
||||
console.error("Error fetching data:", error);
|
||||
}
|
||||
};
|
||||
// 재이용시설 페이징처리 관련 함수
|
||||
const onPageChangeHandler = useCallback((page: number) => {
|
||||
pbnstSttnSearch(
|
||||
String(page),
|
||||
String(13),
|
||||
{
|
||||
partValue: "A",
|
||||
sidoValue: "0",
|
||||
sigunValue: "",
|
||||
regionValue: "",
|
||||
unitWaterShedValue: "",
|
||||
middleRegionValue: "",
|
||||
envPartValue: "",
|
||||
sidoText: "",
|
||||
sigunText: "",
|
||||
},
|
||||
"",
|
||||
String(new Date().getFullYear())
|
||||
);
|
||||
}, []);
|
||||
// useEffect(() => {
|
||||
// if (featureData) {
|
||||
// const selectedVal = featureData.getProperties();
|
||||
// const featureCd = selectedVal?.swtrmt_fclt_cd;
|
||||
// if (featureCd && featureCd !== pbnstRuseFcltPk) {
|
||||
// setPbnstRuseFcltPk(featureCd); // 현재 호출된 featureCd 저장
|
||||
// setActiveTab(featureCd)
|
||||
// fetchpbnstDetail(featureCd); // 상세정보 가져오기
|
||||
// }
|
||||
// }
|
||||
// }, [featureData]);
|
||||
|
||||
useEffect(() => {
|
||||
if (pbnstSttn.pbnstDetail.pbnstRuseFcltPk) setShowDetailView(true);
|
||||
if (pbnstSttn.pbnstDetail) {
|
||||
setPbnDetaileData({
|
||||
isModal: true,
|
||||
data: pbnstSttn.pbnstDetail,
|
||||
});
|
||||
}
|
||||
}, [pbnstSttn.pbnstDetail]);
|
||||
|
||||
|
||||
// 빗물재이용시설 cellClick 이벤트 (상세정보)
|
||||
const rainCellClick = (index: number | undefined, headId: string) => {
|
||||
if (
|
||||
@@ -183,7 +247,8 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
const hasWaterTreatmentLayer = checkedLayersData.some(layer =>
|
||||
layer.data?.lyrNm?.includes('하수처리') || layer.data?.lyrNm?.includes('재이용시설')
|
||||
);
|
||||
|
||||
const actTabData = tabData.find((tab) => tab.id === activeTab);
|
||||
console.log('tavbData',actTabData)
|
||||
// swcho : true, false 값 변경하여 시설 변경하여 테스트하였음
|
||||
// 재이용시설
|
||||
const isPbnst = true;
|
||||
@@ -193,182 +258,181 @@ const NewWindowPopup: React.FC<NewWindowPopupProps> = ({
|
||||
const isRswt = false;
|
||||
// 온배수시설
|
||||
const isHtdfl = false;
|
||||
|
||||
|
||||
return (
|
||||
<div className="mt-4">
|
||||
{/* 체크된 레이어가 없는 경우 (재이용시설 목록) */}
|
||||
{isPbnst && (
|
||||
if (isPbnst) {
|
||||
if (showDetailView) {
|
||||
// 재이용시설 상세
|
||||
return (
|
||||
<>
|
||||
{showDetailView ? (
|
||||
// 재이용시설 상세
|
||||
<>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title='하수재이용시설 상세정보' />
|
||||
</div>
|
||||
<div className="flex justify-between items-center mb-8">
|
||||
<UITab
|
||||
defaultValue={TABS[0]?.val}
|
||||
tabList={TABS.map((tab) => ({
|
||||
value: tab.val,
|
||||
label: tab.text,
|
||||
onClick: () => setActiveTab(tab.val),
|
||||
}))}
|
||||
children={undefined}
|
||||
/>
|
||||
</div>
|
||||
<PbnstSttnModal
|
||||
data={pbnDetaileData.data || ({} as customPbnst)}
|
||||
titleVisible={false}
|
||||
/>
|
||||
<PbnstPrfmncSttnPopup isVisible={false} />
|
||||
</>
|
||||
) : (
|
||||
// 재이용시설 목록
|
||||
<>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title='하수재이용시설 현황' />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>엑셀다운로드</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={bdstTable || []}
|
||||
children={
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />
|
||||
}
|
||||
headlist={pbnstSttn.pbnstSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
pbnstCellClick(index);
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="하수재이용시설 상세정보" />
|
||||
</div>
|
||||
<div className="flex justify-between items-center mb-8">
|
||||
<UITab
|
||||
defaultValue={activeTab}
|
||||
tabList={tabData.map((tab) => ({
|
||||
value: tab.id,
|
||||
label: tab.name,
|
||||
onClick: () => setActiveTab(tab.id),
|
||||
}))}
|
||||
children={undefined}
|
||||
/>
|
||||
</div>
|
||||
<PbnstSttnModal
|
||||
data={tabData.find((tab) => tab.id === activeTab)?.data[0] || ({} as customPbnst)}
|
||||
titleVisible={false}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{/* 빗물이용시설 */}
|
||||
{isRain && (
|
||||
);
|
||||
} else {
|
||||
// 재이용시설 목록
|
||||
return (
|
||||
<>
|
||||
{showDetailView ? (
|
||||
// 빗물이용시설 상세
|
||||
<>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title='빗물이용시설 상세정보' />
|
||||
</div>
|
||||
<RainPrfmncSttnPopup rainForm={rainDetailModal.data as customRainBdst} isModal={false} />
|
||||
{/* TODO: 지도 점검 결과 현황 추가 할 것 */}
|
||||
</>
|
||||
) : (
|
||||
// 빗물이용시설 목록
|
||||
<>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title='빗물이용시설 현황' />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>엑셀다운로드</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={rainTable || []}
|
||||
children={
|
||||
<HeadMakeColSpan upHeadList={rainSttn.rainSttNodeList} />
|
||||
}
|
||||
headlist={rainSttn.rainSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
rainCellClick(index ?? undefined, headId)
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="하수재이용시설 현황" />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>
|
||||
엑셀다운로드
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={bdstTable || []}
|
||||
children={<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />}
|
||||
headlist={pbnstSttn.pbnstSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
pbnstCellClick(index);
|
||||
}}
|
||||
onPageChange={onPageChangeHandler}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{/* 중수도시설 */}
|
||||
{isRswt && (
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isRain) {
|
||||
if (showDetailView) {
|
||||
// 빗물이용시설 상세
|
||||
return (
|
||||
<>
|
||||
{showDetailView ? (
|
||||
// 재이용시설 상세
|
||||
<>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title='중수도시설 상세정보' />
|
||||
</div>
|
||||
<RswtrPrfmncsSttnPopup rswtForm={rswtrDetailModal.data as customRswtBdst} isModal={false} />
|
||||
{/* TODO: 지도 점검 결과 현황 추가 할 것 */}
|
||||
</>
|
||||
) : (
|
||||
// 재이용시설 목록
|
||||
<>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title='중수도시설 현황' />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>엑셀다운로드</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={rswtrTable || []}
|
||||
children={
|
||||
<HeadMakeColSpan upHeadList={rswtSttn.rswtSttNodeList} />
|
||||
}
|
||||
headlist={rswtSttn.rswtSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
rswtCellClick(index, headId);
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="빗물이용시설 상세정보" />
|
||||
</div>
|
||||
<RainPrfmncSttnPopup rainForm={rainDetailModal.data as customRainBdst} isModal={false} />
|
||||
</>
|
||||
)}
|
||||
{/* 온배수시설 */}
|
||||
{isHtdfl && (
|
||||
);
|
||||
} else {
|
||||
// 빗물이용시설 목록
|
||||
return (
|
||||
<>
|
||||
{showDetailView ? (
|
||||
// 재이용시설 상세
|
||||
<>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title='온배수시설 상세정보' />
|
||||
</div>
|
||||
{/* <HtdflPrfmncSttnPopup htdflForm={htdflDetailModal.data as customHtdflBdst} isModal={false} /> */}
|
||||
<HtdflPrfmncSttnPopup htdflForm={htdflDetailModal.data as customHtdflBdst} isModal={false} />
|
||||
</>
|
||||
) : (
|
||||
// 재이용시설 목록
|
||||
<>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title='온배수시설 현황' />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>엑셀다운로드</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={bdstTable || []}
|
||||
children={
|
||||
<HeadMakeColSpan upHeadList={htdflSttn.htdflSttNodeList} />
|
||||
}
|
||||
headlist={htdflSttn.htdflSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
htdflCellClick(index ?? undefined, headId);
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="빗물이용시설 현황" />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>
|
||||
엑셀다운로드
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={rainTable || []}
|
||||
children={<HeadMakeColSpan upHeadList={rainSttn.rainSttNodeList} />}
|
||||
headlist={rainSttn.rainSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
rainCellClick(index ?? undefined, headId);
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isRswt) {
|
||||
if (showDetailView) {
|
||||
// 중수도시설 상세
|
||||
return (
|
||||
<>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="중수도시설 상세정보" />
|
||||
</div>
|
||||
<RswtrPrfmncsSttnPopup rswtForm={rswtrDetailModal.data as customRswtBdst} isModal={false} />
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
// 중수도시설 목록
|
||||
return (
|
||||
<>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="중수도시설 현황" />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>
|
||||
엑셀다운로드
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={rswtrTable || []}
|
||||
children={<HeadMakeColSpan upHeadList={rswtSttn.rswtSttNodeList} />}
|
||||
headlist={rswtSttn.rswtSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
rswtCellClick(index, headId);
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isHtdfl) {
|
||||
if (showDetailView) {
|
||||
// 온배수시설 상세
|
||||
return (
|
||||
<>
|
||||
<div className="flex justify-between items-center mb-4">
|
||||
<Title title="온배수시설 상세정보" />
|
||||
</div>
|
||||
<HtdflPrfmncSttnPopup htdflForm={htdflDetailModal.data as customHtdflBdst} isModal={false} />
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
// 온배수시설 목록
|
||||
return (
|
||||
<>
|
||||
<div className="flex justify-between items-center">
|
||||
<Title title="온배수시설 현황" />
|
||||
<div className="flex gap-2 mt-8">
|
||||
<Button className={btnClass} color="primary" onClick={excelClick}>
|
||||
엑셀다운로드
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<UiTable
|
||||
headName={[]}
|
||||
tableData={htdflTable || []}
|
||||
children={<HeadMakeColSpan upHeadList={htdflSttn.htdflSttNodeList} />}
|
||||
headlist={htdflSttn.htdflSttHeadList}
|
||||
pageSize={20}
|
||||
total={100000}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
htdflCellClick(index ?? undefined, headId);
|
||||
}}
|
||||
onPageChange={setPageNation}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null; // 조건에 맞는 콘텐츠가 없을 경우
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -315,7 +315,7 @@ export default function Page() {
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
|
||||
|
||||
|
||||
<Button
|
||||
size={"sm"}
|
||||
onClick={() => {
|
||||
@@ -344,7 +344,7 @@ export default function Page() {
|
||||
rainChkData={rainChkgdn.rainChk}
|
||||
pageNation={rainPageNation}
|
||||
onPageChange={rainPageChange}
|
||||
/>
|
||||
pageCount={rainChkgdn.rainChkCount} />
|
||||
) : (
|
||||
<RswtChkgdTable
|
||||
detaiRswtlUpdate={setUpdateRSwtDetail}
|
||||
@@ -353,6 +353,7 @@ export default function Page() {
|
||||
rswtChkData={rswtChkgdn.rswtChkRes}
|
||||
pageNation={rswtPageNation}
|
||||
onPageChange={rswtPageChange}
|
||||
pageCount={rswtChkgdn.rswtChkCount}
|
||||
/>
|
||||
)}
|
||||
</ListDiv>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { commonCd, rainPageSize } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { rswtPageSize } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
|
||||
import {
|
||||
excelDownload,
|
||||
yearOptions
|
||||
@@ -39,6 +41,8 @@ export default function Page() {
|
||||
});
|
||||
|
||||
const [selFcltDiv, setSelFcltDiv] = useState("RNB");
|
||||
const [rainPageNation, setRainPageNation] = useState(1);
|
||||
const [rswtPageNation, setRswtPageNation] = useState(1);
|
||||
const [isModal, setIsModal] = useState({
|
||||
open: false,
|
||||
data: {},
|
||||
@@ -47,29 +51,43 @@ export default function Page() {
|
||||
const cellClick = () => {
|
||||
if (searchYear) {
|
||||
if (selFcltDiv === "RNB") {
|
||||
rainChkSttnSearch(searchYear, "0");
|
||||
rainChkSttnSearch(rainPageNation, rainPageSize, searchYear, commonCd);
|
||||
} else {
|
||||
rswtChkSttnSearch(searchYear, "0");
|
||||
rswtChkSttnSearch(rswtPageNation, rswtPageSize, searchYear, commonCd);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const rainPageChange = (pageNo: number) => {
|
||||
if (pageNo > 0) {
|
||||
setRainPageNation(pageNo);
|
||||
rainChkSttnInit(pageNo, rainPageSize, searchYear, commonCd);
|
||||
}
|
||||
};
|
||||
|
||||
const rswtPageChange = (pageNo: number) => {
|
||||
if (pageNo > 0) {
|
||||
setRswtPageNation(pageNo);
|
||||
rswtChkSttnInit(pageNo, rswtPageSize, searchYear, commonCd);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!rainChkSttn.isInit) {
|
||||
isRainSttn(true)
|
||||
rainChkSttnInit(new Date().getFullYear().toString(), "0");
|
||||
rainChkSttnInit(1, rainPageSize, new Date().getFullYear().toString(), commonCd);
|
||||
setIsModal({ data: {}, open: false });
|
||||
}
|
||||
}, [rainChkSttn.isInit, rainChkSttnInit]);
|
||||
}, [rainChkSttn.isInit, rainChkSttnInit, rainPageSize]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
if (!rswtChkSttn.isInit) {
|
||||
setIsModal({ data: {}, open: false });
|
||||
rswtChkSttnInit(new Date().getFullYear().toString(), "0");
|
||||
rswtChkSttnInit(1, rswtPageSize, new Date().getFullYear().toString(), commonCd);
|
||||
isRswtSttn(true)
|
||||
}
|
||||
}, [rswtChkSttn.isInit, rswtChkSttnInit])
|
||||
}, [rswtChkSttn.isInit, rswtChkSttnInit, rswtPageSize])
|
||||
|
||||
|
||||
|
||||
const handleClick = useCallback(
|
||||
@@ -163,6 +181,9 @@ export default function Page() {
|
||||
detailUp={() => { }}
|
||||
handleClick={handleClick}
|
||||
rainChkData={rainChkSttn.rainChkRes}
|
||||
pageNation={rainPageNation}
|
||||
onPageChange={rainPageChange}
|
||||
pageCount={rainChkSttn.rainChkCount}
|
||||
/>
|
||||
) : (
|
||||
<RswtChkgdTable
|
||||
@@ -170,6 +191,9 @@ export default function Page() {
|
||||
deleteRswtData={() => { }}
|
||||
handleRswtClick={handleClick}
|
||||
rswtChkData={rswtChkSttn.rswtChkRes}
|
||||
pageNation={rswtPageNation}
|
||||
onPageChange={rswtPageChange}
|
||||
pageCount={rswtChkSttn.rswtChkCount}
|
||||
/>
|
||||
)}
|
||||
</ListDiv>
|
||||
@@ -181,7 +205,7 @@ export default function Page() {
|
||||
setIsModal({ open: !open, data: {} });
|
||||
}}
|
||||
bodyClass={"w-[80vw] max-w-none"}
|
||||
body={<ChkgdModal type={selFcltDiv} obj={isModal.data} />}
|
||||
body={<ChkgdModal type={selFcltDiv} obj={isModal.data} setIsModal={() => { }} />}
|
||||
></UiModal>
|
||||
<Toaster position="top-center" />
|
||||
</ContentsDiv>
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export const rainPageSize = 10;
|
||||
export const rainPageSize = 5;
|
||||
export const commonCd = "41";
|
||||
|
||||
export type rainChkZodType = z.infer<typeof rainChkZod>;
|
||||
@@ -132,7 +132,6 @@ const initFetch = async (
|
||||
) => {
|
||||
const currentYear = new Date().getFullYear().toString();
|
||||
|
||||
console.log("cnt ", cnt);
|
||||
const rainRes = await getCountFetch(
|
||||
"wr",
|
||||
`/reuseChk/rainy` +
|
||||
@@ -142,7 +141,6 @@ const initFetch = async (
|
||||
(sgg ? `/${sgg}` : "/0")
|
||||
);
|
||||
|
||||
console.log(" rainRes ", rainRes);
|
||||
return rainRes;
|
||||
};
|
||||
|
||||
@@ -193,7 +191,6 @@ export const rainChkgdnActionsExport: (set: any) => rainChkgdnActions = (
|
||||
toast.error("지도점검 등록이 실패되었습니다.");
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
toast.error("지도점검 등록이 실패되었습니다.");
|
||||
} finally {
|
||||
set((state: rainChkgdnType) => ({ rainChkgdn: { ...state.rainChkgdn, isLoading: false } }));
|
||||
|
||||
@@ -28,7 +28,7 @@ import { type chHeadType } from "../rainChkgdn/headList";
|
||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
import toast from "react-hot-toast";
|
||||
|
||||
export const rswtPageSize = 10;
|
||||
export const rswtPageSize = 5;
|
||||
|
||||
const rswtChkHeadList = rswtChkHeadListExport;
|
||||
const rswtDetailHeadList = rswtDetailHeadListExport;
|
||||
@@ -43,7 +43,6 @@ export type rswtChkgdnState = {
|
||||
rswtChkgdn: {
|
||||
rswtChkHeadList: TableUpperProps[];
|
||||
rswtDetailHeadList: TableUpperProps[];
|
||||
|
||||
rswtHeadNm: chHeadType[];
|
||||
excelList: SheetParameter[];
|
||||
rswtChkRes: rswtChkZodType[];
|
||||
@@ -235,7 +234,6 @@ export const rswtChkgdnActionsExport: (set: any) => rswtChkgdnActions = (
|
||||
try {
|
||||
set((state: rswtChkgdnType) => (
|
||||
{ rswtChkgdn: { ...state.rswtChkgdn, isLoading: true } }));
|
||||
console.log('excelData ', excelData)
|
||||
const res = await postFectch("/reuseChk/reuseWater", excelData);
|
||||
if (res.ok) {
|
||||
ToastFormUi({
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { rainChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import { getFetch } from "@/components/lib/api";
|
||||
import { getCountFetch, getFetch } from "@/components/lib/api";
|
||||
import type { SelectDataType } from "@common/business_components/ui";
|
||||
import { rainChkgdnHeadSttnExport, ruseSttnHeadListExport, splSttnHeadListExport } from "./headList";
|
||||
import { rainMainHeadNmExport, type chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
|
||||
import { rainMainHeadNmExport, type chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
|
||||
import { buildingExcelRainSttn } from "./excel";
|
||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
|
||||
@@ -24,20 +24,21 @@ export type rainChkSttnState = {
|
||||
rainChkRes: rainChkZodType[];
|
||||
fcltDiv: SelectDataType[];
|
||||
rainChkgdnHeadList: TableUpperProps[];
|
||||
rainHeadNm:chHeadType[];
|
||||
rainHeadNm: chHeadType[];
|
||||
ruseHeadList: TableUpperProps[];
|
||||
splHeadList: TableUpperProps[];
|
||||
sttnExcelList:[]
|
||||
sttnExcelList: []
|
||||
isInit: boolean;
|
||||
isSttn:boolean;
|
||||
isSttn: boolean;
|
||||
rainChkCount: number;
|
||||
};
|
||||
};
|
||||
|
||||
type rainChkSttnActions = {
|
||||
rainChkSttnInit: (searchTxt: string, sggCd: string) => void;
|
||||
rainChkSttnSearch: (searchTxt: string, sggCd: string) => void;
|
||||
isRainSttn:(isSttn:boolean) => void;
|
||||
getRainSttnExcel:(excelList:rainChkZodType[]) => void;
|
||||
rainChkSttnInit: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
rainChkSttnSearch: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
isRainSttn: (isSttn: boolean) => void;
|
||||
getRainSttnExcel: (excelList: rainChkZodType[]) => void;
|
||||
};
|
||||
|
||||
export type rainChkSttnType = rainChkSttnState & rainChkSttnActions;
|
||||
@@ -49,18 +50,23 @@ export const rainChkSttnStateExport: rainChkSttnState = {
|
||||
rainChkgdnHeadList: rainChkgdnHeadList,
|
||||
ruseHeadList: ruseHeadList,
|
||||
splHeadList: splHeadList,
|
||||
rainHeadNm:rainHeadNm,
|
||||
rainHeadNm: rainHeadNm,
|
||||
isInit: false,
|
||||
sttnExcelList:[],
|
||||
isSttn:false,
|
||||
sttnExcelList: [],
|
||||
isSttn: false,
|
||||
rainChkCount: 1,
|
||||
},
|
||||
};
|
||||
|
||||
const initFetch = async (txt: string | undefined, sgg: string | undefined) => {
|
||||
const initFetch = async (pageNo: number, cnt: number, txt: string | undefined, sgg: string | undefined) => {
|
||||
const currentYear = new Date().getFullYear().toString();
|
||||
const rainRes = await getFetch(
|
||||
const rainRes = await getCountFetch(
|
||||
"wr",
|
||||
`/reuseChk/rainy/` + (txt ? `${txt}` : currentYear) + (sgg ? `/${sgg}` : "/0")
|
||||
`/reuseChk/rainy` +
|
||||
(pageNo ? `/${pageNo}` : "/1") +
|
||||
(cnt ? `/${cnt}` : "/5") +
|
||||
(txt ? `/${txt}` : `/${currentYear}`) +
|
||||
(sgg ? `/${sgg}` : "/0")
|
||||
);
|
||||
return rainRes;
|
||||
};
|
||||
@@ -68,48 +74,50 @@ export const rainChkSttnActionsExport: (set: any) => rainChkSttnActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
rainChkSttnInit: async (searchTxt: string, sggCd: string) => {
|
||||
rainChkSttnInit: async (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => {
|
||||
try {
|
||||
const rainChkRes = await initFetch(searchTxt, sggCd);
|
||||
const rainChkRes = await initFetch(pageNo, cnt, searchTxt, sggCd);
|
||||
|
||||
return set((state: rainChkSttnState) => ({
|
||||
...state,
|
||||
rainChkSttn: {
|
||||
...state.rainChkSttn,
|
||||
rainChkRes:rainChkRes
|
||||
rainChkRes: rainChkRes.data,
|
||||
rainChkCount: rainChkRes.count,
|
||||
isSttn: true
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
rainChkSttnSearch: async (searchTxt: string, sggCd: string) => {
|
||||
rainChkSttnSearch: async (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => {
|
||||
try {
|
||||
const rainChkRes = await initFetch(searchTxt, sggCd);
|
||||
const rainChkRes = await initFetch(pageNo, cnt, searchTxt, sggCd);
|
||||
|
||||
return set((state: rainChkSttnState) => ({
|
||||
...state,
|
||||
rainChkSttn: {
|
||||
...state.rainChkSttn,
|
||||
rainChkRes:rainChkRes
|
||||
rainChkRes: rainChkRes
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},isRainSttn :(isSttn:boolean) =>{
|
||||
}, isRainSttn: (isSttn: boolean) => {
|
||||
try {
|
||||
return set((state: rainChkSttnState) => ({
|
||||
...state,
|
||||
rainChkSttn: {
|
||||
...state.rainChkSttn,
|
||||
isSttn:isSttn
|
||||
isSttn: isSttn
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},getRainSttnExcel: async (excelList:rainChkZodType[]) => {
|
||||
}, getRainSttnExcel: async (excelList: rainChkZodType[]) => {
|
||||
try {
|
||||
|
||||
const excelData = buildingExcelRainSttn(excelList)
|
||||
@@ -118,7 +126,7 @@ export const rainChkSttnActionsExport: (set: any) => rainChkSttnActions = (
|
||||
...state,
|
||||
rainChkSttn: {
|
||||
...state.rainChkSttn,
|
||||
sttnExcelList:excelData
|
||||
sttnExcelList: excelData
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { rswtChkSttnHeadListExport, rswtDetailSttnHeadListExport } from "./headL
|
||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
|
||||
import type { rswtChkZodType } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn";
|
||||
import { getFetch } from "@/components/lib/api";
|
||||
import { getCountFetch, getFetch } from "@/components/lib/api";
|
||||
import { buildingExcelRswtSttn } from "./excel";
|
||||
|
||||
const rswtChkHeadList = rswtChkSttnHeadListExport;
|
||||
@@ -20,14 +20,15 @@ export type rswtChkSttnState = {
|
||||
rswtChkRes: rswtChkZodType[];
|
||||
isInit: boolean;
|
||||
isSttn: boolean;
|
||||
rswtChkCount: number;
|
||||
};
|
||||
};
|
||||
|
||||
type rswtChkSttnActions = {
|
||||
rswtChkSttnInit: (searchTxt: string, sggCd: string) => void;
|
||||
rswtChkSttnInit: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
isRswtSttn: (isSttn: boolean) => void;
|
||||
getRswtSttnExcel: (excelList: rswtChkZodType[]) => void;
|
||||
rswtChkSttnSearch: (searchTxt: string, sggCd: string) => void;
|
||||
rswtChkSttnSearch: (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => void;
|
||||
};
|
||||
|
||||
export type rswtChkSttnType = rswtChkSttnState & rswtChkSttnActions;
|
||||
@@ -41,15 +42,18 @@ export const rswtChkStateExport: rswtChkSttnState = {
|
||||
rswtChkRes: [],
|
||||
isInit: false,
|
||||
isSttn: false,
|
||||
rswtChkCount: 1,
|
||||
},
|
||||
};
|
||||
|
||||
const initFetch = async (year: string | undefined, sgg: string | undefined) => {
|
||||
const initFetch = async (pageNo: number, cnt: number, year: string | undefined, sgg: string | undefined) => {
|
||||
const currentYear = new Date().getFullYear().toString();
|
||||
const rswtChkRes = await getFetch(
|
||||
const rswtChkRes = await getCountFetch(
|
||||
"wr",
|
||||
`/reuseChk/reuseWater/` +
|
||||
(year ? `${year}` : currentYear) +
|
||||
`/reuseChk/reuseWater` +
|
||||
(pageNo ? `/${pageNo}` : "/1") +
|
||||
(cnt ? `/${cnt}` : "/20") +
|
||||
(year ? `/${year}` : `/${currentYear}`) +
|
||||
(sgg ? `/${sgg}` : "/0")
|
||||
);
|
||||
return rswtChkRes;
|
||||
@@ -60,14 +64,15 @@ export const rswtChkSttnActionsExport: (set: any) => rswtChkSttnActions = (
|
||||
set: any
|
||||
) => {
|
||||
return {
|
||||
rswtChkSttnInit: async (searchTxt: string, sggCd: string) => {
|
||||
rswtChkSttnInit: async (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => {
|
||||
try {
|
||||
const rswtChkRes = await initFetch(searchTxt, sggCd);
|
||||
const rswtChkRes = await initFetch(pageNo, cnt, searchTxt, sggCd);
|
||||
return set((state: rswtChkSttnState) => ({
|
||||
...state,
|
||||
rswtChkSttn: {
|
||||
...state.rswtChkSttn,
|
||||
rswtChkRes: rswtChkRes,
|
||||
rswtChkRes: rswtChkRes.data,
|
||||
rswtChkCount: rswtChkRes.count,
|
||||
isInit: false,
|
||||
},
|
||||
}));
|
||||
@@ -104,15 +109,16 @@ export const rswtChkSttnActionsExport: (set: any) => rswtChkSttnActions = (
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
rswtChkSttnSearch: async (searchTxt: string, sggCd: string) => {
|
||||
rswtChkSttnSearch: async (pageNo: number, cnt: number, searchTxt: string, sggCd: string) => {
|
||||
try {
|
||||
const rswtChkRes = await initFetch(searchTxt, sggCd);
|
||||
const rswtChkRes = await initFetch(pageNo, cnt, searchTxt, sggCd);
|
||||
|
||||
return set((state: rswtChkSttnState) => ({
|
||||
...state,
|
||||
rswtChkSttn: {
|
||||
...state.rswtChkSttn,
|
||||
rswtChkRes: rswtChkRes
|
||||
rswtChkRes: rswtChkRes.data,
|
||||
rswtChkCount: rswtChkRes.count,
|
||||
},
|
||||
}));
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import { useWrStore } from "@/app/store";
|
||||
import { ScrollArea, Title } from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead";
|
||||
import { GuideDetailsTable } from "@/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable";
|
||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
import type { splRuseWaterType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
|
||||
import type { rswtrPolutionsZode } from "@/app/store/prfmncReg/chkgdnReg/rswrtChkgdn/headList";
|
||||
import { GuideDetailsTable } from "@/components/ui/table/chkgdTable/guideDetailTable/guideDetailTable";
|
||||
import { ScrollArea, Title } from "@common/business_components/ui";
|
||||
import { Button } from "@common/components/ui";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import type { z } from "zod";
|
||||
import React from "react";
|
||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
|
||||
export default function ChkgdModal({ type, obj ,setIsModal }: { type: string; obj: any , setIsModal:(open:boolean)=>void}) {
|
||||
export default function ChkgdModal({ type, obj, setIsModal }: { type: string; obj: any, setIsModal: (open: boolean) => void }) {
|
||||
const {
|
||||
rainChkgdn,
|
||||
rswtChkgdn,
|
||||
@@ -253,7 +251,8 @@ export default function ChkgdModal({ type, obj ,setIsModal }: { type: string; ob
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<h3 className="text-2xl font-bold text-gray-900 mt-2 ml-6">
|
||||
{`(${obj.bdstNm})`}
|
||||
{type === "RNB"
|
||||
? `(${obj.bdstNm})` : `(${obj.building.bdstNm})`}
|
||||
</h3>
|
||||
{!rainChkSttn.isSttn ? (
|
||||
<Button className="" onClick={allDataUpdate}>
|
||||
@@ -273,7 +272,7 @@ export default function ChkgdModal({ type, obj ,setIsModal }: { type: string; ob
|
||||
<GuideDetailsTable
|
||||
chgRes={guidData || []}
|
||||
headList={headList.splHeadList}
|
||||
upheadList={type === "RNB"? rainChkgdn.rainSplHeadNm :rswtChkgdn.rswtSplHeadNm}
|
||||
upheadList={type === "RNB" ? rainChkgdn.rainSplHeadNm : rswtChkgdn.rswtSplHeadNm}
|
||||
type={""}
|
||||
setChGuidData={(data) => {
|
||||
setChGuidData(data);
|
||||
@@ -287,7 +286,7 @@ export default function ChkgdModal({ type, obj ,setIsModal }: { type: string; ob
|
||||
<GuideDetailsTable
|
||||
chgRes={guidData || []}
|
||||
headList={headList.ruseHeadList}
|
||||
upheadList={type === "RNB"? rainChkgdn.rainRuseHeadNm :rswtChkgdn.rswtRuseHeadNm}
|
||||
upheadList={type === "RNB" ? rainChkgdn.rainRuseHeadNm : rswtChkgdn.rswtRuseHeadNm}
|
||||
type={""}
|
||||
setChGuidData={(data) => {
|
||||
setChGuidData(data);
|
||||
|
||||
@@ -25,6 +25,7 @@ export default function RainChkgdTable({
|
||||
rainChkData,
|
||||
pageNation,
|
||||
onPageChange,
|
||||
pageCount,
|
||||
}: {
|
||||
detailUp: (data: rainChkZodType[]) => void;
|
||||
handleClick?: (data: any) => void;
|
||||
@@ -32,6 +33,7 @@ export default function RainChkgdTable({
|
||||
rainChkData?: rainChkZodType[];
|
||||
pageNation: number;
|
||||
onPageChange: (page: number) => void;
|
||||
pageCount: number;
|
||||
}) {
|
||||
const { code, rainChkgdn, rainChkSttn, getRainSttnExcel } = useWrStore((state) => state);
|
||||
const [makeTableData, setMakeTableData] = useState<any[]>([]);
|
||||
@@ -74,7 +76,7 @@ export default function RainChkgdTable({
|
||||
|
||||
useEffect(() => {
|
||||
setSelectedIds([])// 셀렉트 초기화를 위한 작업
|
||||
if (rainChkData&&rainChkData.length>0) {
|
||||
if (rainChkData && rainChkData.length > 0) {
|
||||
|
||||
const rainChg = rainChkData?.map((item: any) => {
|
||||
const bud = tableData([item.building], { code });
|
||||
@@ -86,7 +88,7 @@ export default function RainChkgdTable({
|
||||
});
|
||||
|
||||
setMakeTableData(rainChkTableData(rainChg));
|
||||
}else{
|
||||
} else {
|
||||
setMakeTableData([]);
|
||||
}
|
||||
}, [rainChkData, code]);
|
||||
@@ -170,14 +172,8 @@ export default function RainChkgdTable({
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}, [rainChkSttn.isSttn, rainChkgdn.rainChkgdnHeadList, rainChkSttn.rainChkgdnHeadList]);
|
||||
|
||||
|
||||
useEffect(() =>{
|
||||
console.log('rainChkgdn.count ', rainChkgdn.rainChkCount)
|
||||
},[rainChkgdn.rainChkCount])
|
||||
|
||||
return (
|
||||
<>
|
||||
<LoadingOverlay isLoading={rainChkgdn.isLoading}></LoadingOverlay>
|
||||
@@ -202,7 +198,7 @@ export default function RainChkgdTable({
|
||||
</TableBody>
|
||||
</Table>
|
||||
<UiPageNations
|
||||
total={rainChkgdn.rainChkCount||20}
|
||||
total={pageCount}
|
||||
cur={pageNation}
|
||||
pageSize={rainPageSize}
|
||||
onPageChange={onPageChange}
|
||||
|
||||
@@ -25,6 +25,7 @@ export default function RswtChkgdTable({
|
||||
rswtChkData,
|
||||
pageNation,
|
||||
onPageChange,
|
||||
pageCount,
|
||||
}: {
|
||||
detaiRswtlUpdate: (data: rswtrChkDetailsZodType[]) => void;
|
||||
handleRswtClick?: (data: any) => void;
|
||||
@@ -32,6 +33,7 @@ export default function RswtChkgdTable({
|
||||
rswtChkData: rswtChkZodType[];
|
||||
pageNation: number;
|
||||
onPageChange: (page: number) => void;
|
||||
pageCount: number;
|
||||
}) {
|
||||
const { code, rswtChkgdn, rswtChkSttn, rswtChkgdnInit, rswtChkPolAndGuide, getRswtSttnExcel } = useWrStore(
|
||||
(state) => state
|
||||
@@ -152,7 +154,7 @@ export default function RswtChkgdTable({
|
||||
</TableBody>
|
||||
</Table>
|
||||
<UiPageNations
|
||||
total={rswtChkgdn.rswtChkCount}
|
||||
total={pageCount}
|
||||
cur={pageNation}
|
||||
pageSize={rswtPageSize}
|
||||
onPageChange={onPageChange}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Reference in New Issue
Block a user