재이용실적현황 테이블 초기화 수정 완료
This commit is contained in:
@@ -91,6 +91,7 @@ export default function PbnstPrfmncSttn() {
|
||||
|
||||
const prfFilter = prfList?.filter((e) => e.ym.slice(0, 4) === year)
|
||||
if (prfList && prfFilter.length > 0) {
|
||||
|
||||
prfList?.forEach((prfItem) => {
|
||||
const month = Number(prfItem?.ym?.slice(4)); // "MM"
|
||||
const monthKey = `${month}월`;
|
||||
@@ -194,11 +195,13 @@ export default function PbnstPrfmncSttn() {
|
||||
const dnOutData: dnChartForm[] = [];
|
||||
|
||||
if (rawData) {
|
||||
prfTableData([], year)
|
||||
rawData.forEach((item) => {
|
||||
// 실적 테이블 데이터
|
||||
if (chartId){
|
||||
if(item.prfList?.[0]?.ym.slice(0, 4) === year && item.prfList?.[0]?.pbnstRuseFcltFk === chartId)
|
||||
prfTableData(item.prfList, year);
|
||||
if(item.prfList?.[0]?.ym.slice(0, 4) === year && item.prfList?.[0]?.pbnstRuseFcltFk === chartId){
|
||||
prfTableData(item.prfList, year);
|
||||
}
|
||||
item.prfList.filter((e) => e.ym.slice(0, 4) === year && e.pbnstRuseFcltFk === chartId).forEach((element) => {
|
||||
// 누적
|
||||
wshwtr += element.wshwtr;
|
||||
@@ -463,6 +466,7 @@ export default function PbnstPrfmncSttn() {
|
||||
|
||||
useEffect(() => {
|
||||
setbdstTable(prfmncRes);
|
||||
if(prfmncRes?.[0]?.pbnstRuseFcltPk) setChartId(prfmncRes[0].pbnstRuseFcltPk)
|
||||
}, [prfmncRes]);
|
||||
|
||||
|
||||
@@ -525,21 +529,21 @@ export default function PbnstPrfmncSttn() {
|
||||
setPbnRuseNm(searchNm || "");
|
||||
}}
|
||||
setRtnData={function (rtnData: any[]): void {
|
||||
setbdstTable(rtnData);
|
||||
// setbdstTable(rtnData);
|
||||
}}
|
||||
searchList={pbnstSttn.pbnstSearchData || []}
|
||||
></SearchInputText>
|
||||
<SelectBox
|
||||
{/* <SelectBox
|
||||
className="h-full text-2xl"
|
||||
label="재이용시설명"
|
||||
selectClass={""}
|
||||
selectArray={[]}
|
||||
value={""}
|
||||
onSelectValue={() => { }} />
|
||||
onSelectValue={() => { }} /> */}
|
||||
</div>
|
||||
</div>}
|
||||
queryClick={function (returnType: ReturnType): void {
|
||||
pbnstPrfmncSearch(returnType, swtrmtFcltNm ?? "", fromDate, toDate);
|
||||
pbnstPrfmncSearch(returnType, pbnRuseNm ?? "", fromDate, toDate);
|
||||
if (fromDate && toDate) {
|
||||
const fromNum = Number(fromDate);
|
||||
const toNum = Number(toDate);
|
||||
@@ -573,7 +577,9 @@ export default function PbnstPrfmncSttn() {
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
cellClick(index ?? undefined, headId);
|
||||
}}
|
||||
onPageChange={() => { }}
|
||||
onPageChange={() => { }
|
||||
}
|
||||
index={0}
|
||||
/>
|
||||
|
||||
<hr />
|
||||
|
||||
@@ -152,7 +152,7 @@ export const pbnstPrfmncSttnActionsExport: (set: any) => pbnstPrfmncSttnActions
|
||||
res.data.forEach((item) => {
|
||||
if (item.prfList.length === 0) {
|
||||
const year = ""; // 연도 정보가 없으면 빈 문자열, 필요시 item에서 추출
|
||||
const yearVal = { year: year, pbnstRuseFcltPk: item.pbnstRuseFcltPk ?? "" };
|
||||
const yearVal = { year: year, pbnstRuseFcltPk: item.pbnstRuseFcltPk ?? "", ruseUtztnFcltNm : item.ruseUtztnFcltNm ?? "" };
|
||||
yearVal[year + "inUsage"] = 0;
|
||||
yearVal[year + "outUsage"] = 0;
|
||||
yearVal[year + "total"] = 0;
|
||||
@@ -188,7 +188,7 @@ export const pbnstPrfmncSttnActionsExport: (set: any) => pbnstPrfmncSttnActions
|
||||
yearData[year + "outUsage"] += outUsageSum;
|
||||
yearData[year + "total"] += (inUsageSum + outUsageSum);
|
||||
} else {
|
||||
const yearVal = { year: year, pbnstRuseFcltPk: acc.pbnstRuseFcltFk };
|
||||
const yearVal = { year: year, pbnstRuseFcltPk: acc.pbnstRuseFcltFk, ruseUtztnFcltNm : item.ruseUtztnFcltNm ?? "" };
|
||||
yearVal[year + "inUsage"] = inUsageSum;
|
||||
yearVal[year + "outUsage"] = outUsageSum;
|
||||
yearVal[year + "total"] = inUsageSum + outUsageSum;
|
||||
|
||||
Reference in New Issue
Block a user