Merge commit 'e352a63db4faee1a1535cd41e53c838ffd6c2e3b' into iipbs/wr/dev
iipbs_wr / build (push) Waiting to run
iipbs_wr / build (push) Waiting to run
This commit is contained in:
@@ -33,9 +33,7 @@ import { writeRgtrAndMdfr } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg";
|
||||
import { useFieldArray, useForm, type FieldErrors } from "react-hook-form"; // FieldErrors 타입 추가
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { z } from "zod";
|
||||
|
||||
import { createDefaultPbnstItem } from "./utilsZod";
|
||||
import { flushSync } from "react-dom";
|
||||
|
||||
export default function PublicReuseFaciltyInsert() {
|
||||
const {
|
||||
@@ -49,7 +47,7 @@ export default function PublicReuseFaciltyInsert() {
|
||||
pbnstRuseBizUpdate,
|
||||
} = useWrStore((state) => state);
|
||||
const { pubFacHeadList, pbnstHasuRes, pbnstRes } = pbnst;
|
||||
const [currentTab, setCurrentTab] = useState<string>("mng");
|
||||
const [, setCurrentTab] = useState<string>("mng");
|
||||
const [isRuseReg, setIsRuseReg] = useState<{
|
||||
isModal: boolean;
|
||||
}>({ isModal: false });
|
||||
@@ -278,11 +276,15 @@ export default function PublicReuseFaciltyInsert() {
|
||||
<Button
|
||||
className=""
|
||||
size={"sm"}
|
||||
onClick={(e) => {
|
||||
searchTxt && searchTxt?.length > 0
|
||||
? pubHasuSearch(String(pageNation), "41", searchTxt)
|
||||
: pubHasuInit(String(pageNation), "41");
|
||||
isResetPage(true);
|
||||
onClick={() => {
|
||||
if(searchTxt && searchTxt?.length > 0) {
|
||||
pubHasuSearch(String(pageNation), "41", searchTxt)
|
||||
|
||||
}else{
|
||||
pubHasuInit(String(pageNation), "41");
|
||||
}
|
||||
isResetPage(true);
|
||||
|
||||
}}
|
||||
>
|
||||
조회
|
||||
@@ -324,7 +326,6 @@ export default function PublicReuseFaciltyInsert() {
|
||||
headName={"공공 하수처리시설 목록"}
|
||||
cellClick={cellClick}
|
||||
onPageChange={setPageNation}
|
||||
children={undefined}
|
||||
resetPageNo={resetPage}
|
||||
/>
|
||||
</ScrollArea>
|
||||
|
||||
@@ -18,7 +18,6 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { HeadMakeColSpan } from "@common/business_components/ui/table/HeadMakeColSpan";
|
||||
import type { customPbnst } from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import { excelDownload, yearOptions } from "@/components/lib/func/commom";
|
||||
import SearchInputText from "@/components/ui/searchInput/searchInput";
|
||||
import type { WaterReuseFacility } from "@/app/store/ruseFcltMng/fcltSttn/pbnstSttn/type";
|
||||
import { PbnstSttnModal } from "@/components/ui/modal/sttn/pbnstSttnModal/pbnstSttnModal";
|
||||
|
||||
@@ -29,37 +28,38 @@ export default function PbnstSttn() {
|
||||
pbnstSttnSearch,
|
||||
pbnSttnInit,
|
||||
getPbnStnDetail,
|
||||
pbnNmSearch,
|
||||
getFlcts
|
||||
getFlcts,
|
||||
} = useWrStore((state) => state);
|
||||
|
||||
const { pbnstSttnRes, fclts,pbnstSttnResCount} =pbnstSttn
|
||||
const { pbnstSttnRes, fclts, pbnstSttnResCount } = pbnstSttn;
|
||||
const ref = useRef<ReturnType>({} as ReturnType);
|
||||
const [searchYear, setSearchYear] = useState<string>(
|
||||
String(new Date().getFullYear())
|
||||
);
|
||||
const [isChHead, setIsChHead] = useState(false);
|
||||
const [bdstTable, setBdstTable] = useState<WaterReuseFacility[]>();
|
||||
const [pageNation, setPageNation] = useState(1);
|
||||
const [pbnDetaileData, setPbnDetaileData] = useState<{
|
||||
isModal: boolean;
|
||||
data: customPbnst;
|
||||
}>({ isModal: false, data: {} as customPbnst });
|
||||
const [returnType, setReturnType] = useState<ReturnType>({} as ReturnType);
|
||||
|
||||
const [pbnRuseNm, setPbnRuseNm] = useState<string>("");
|
||||
|
||||
const excelClick = useCallback(() => {
|
||||
pbnstSttnSearch(true, String(pageNation), "100000", ref.current, pbnRuseNm, searchYear,fclts );
|
||||
}, [pbnstSttnSearch,fclts,pbnRuseNm]);
|
||||
pbnstSttnSearch(
|
||||
true,
|
||||
String(1),
|
||||
"100000",
|
||||
ref.current,
|
||||
pbnRuseNm,
|
||||
searchYear,
|
||||
fclts
|
||||
);
|
||||
}, [pbnstSttnSearch, fclts, pbnRuseNm]);
|
||||
|
||||
const cellCLick = useCallback(
|
||||
(index: number | undefined) => {
|
||||
if (
|
||||
index !== undefined &&
|
||||
pbnstSttnRes &&
|
||||
pbnstSttnRes[index]
|
||||
) {
|
||||
if (index !== undefined && pbnstSttnRes && pbnstSttnRes[index]) {
|
||||
const pbnstRuseFcltPk = pbnstSttnRes[index].pbnstRuseFcltPk;
|
||||
getPbnStnDetail(pbnstRuseFcltPk);
|
||||
}
|
||||
@@ -80,21 +80,20 @@ export default function PbnstSttn() {
|
||||
}, [pbnstSttn.excelList]);
|
||||
useEffect(() => {
|
||||
if (!pbnstSttn.isInit) {
|
||||
getFlcts()
|
||||
|
||||
getFlcts();
|
||||
}
|
||||
}, [pbnstSttn.isInit, pbnSttnInit, ref.current]);
|
||||
useEffect(() => {
|
||||
if(pbnstSttnRes && pbnstSttnRes.length>0) {
|
||||
if (pbnstSttnRes && pbnstSttnRes.length > 0) {
|
||||
setBdstTable(pbnstSttnRes);
|
||||
}else{
|
||||
} else {
|
||||
setBdstTable([]);
|
||||
}
|
||||
}, [pbnstSttnRes]);
|
||||
|
||||
useEffect(() =>{
|
||||
useEffect(() => {
|
||||
pbnSttnInit("1", "15", ref.current, searchYear, pbnstSttn.fclts);
|
||||
},[fclts])
|
||||
}, [fclts]);
|
||||
|
||||
useEffect(() => {
|
||||
if (pbnstSttn.pbnstDetail.pbnstRuseFcltPk)
|
||||
@@ -156,13 +155,19 @@ export default function PbnstSttn() {
|
||||
</div>
|
||||
}
|
||||
queryClick={function (returnType: ReturnType): void {
|
||||
setReturnType(returnType);
|
||||
pbnstSttnSearch(false, "1", "15", returnType, pbnRuseNm, searchYear, fclts);
|
||||
pbnstSttnSearch(
|
||||
false,
|
||||
"1",
|
||||
"15",
|
||||
returnType,
|
||||
pbnRuseNm,
|
||||
searchYear,
|
||||
fclts
|
||||
);
|
||||
}}
|
||||
excelClick={excelClick}
|
||||
initClick={function (): void {
|
||||
setPbnRuseNm('')
|
||||
|
||||
initClick={function (): void {
|
||||
setPbnRuseNm("");
|
||||
}}
|
||||
btnClass={btnClass}
|
||||
ref={ref}
|
||||
@@ -176,13 +181,10 @@ export default function PbnstSttn() {
|
||||
<UiTable
|
||||
headName={undefined}
|
||||
tableData={bdstTable || []}
|
||||
children={
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />
|
||||
}
|
||||
headlist={pbnstSttn.pbnstSttHeadList}
|
||||
pageSize={15}
|
||||
total={pbnstSttnResCount}
|
||||
cellClick={(index: number | undefined, headId: string) => {
|
||||
cellClick={(index: number | undefined) => {
|
||||
cellCLick(index);
|
||||
}}
|
||||
onPageChange={(page: number) => {
|
||||
@@ -196,7 +198,9 @@ export default function PbnstSttn() {
|
||||
fclts
|
||||
);
|
||||
}}
|
||||
></UiTable>
|
||||
>
|
||||
<HeadMakeColSpan upHeadList={pbnstSttn.pbnstSttNodeList} />
|
||||
</UiTable>
|
||||
</ListDiv>
|
||||
</div>
|
||||
</div>
|
||||
@@ -225,7 +229,9 @@ export default function PbnstSttn() {
|
||||
bodyClass="w-[68vw] max-w-none h-[90vh]"
|
||||
open={pbnDetaileData.isModal}
|
||||
onOpenChange={(open) => {
|
||||
setPbnDetaileData({ data: {} as customPbnst, isModal: false });
|
||||
//TODO:OPEN 상태 확인필요
|
||||
if(!open)
|
||||
setPbnDetaileData({ data: {} as customPbnst, isModal: open });
|
||||
}}
|
||||
/>
|
||||
</ContentsDiv>
|
||||
|
||||
@@ -129,7 +129,6 @@ const hasuListFetch = async (
|
||||
fetchType.WR
|
||||
);
|
||||
const checkWrRegListRes = getRuseList.data;
|
||||
const count = getRuseList.count;
|
||||
|
||||
|
||||
|
||||
@@ -140,7 +139,6 @@ const hasuListFetch = async (
|
||||
fclt.bscFctCd === item.pbnstRuseFcltPk.substring(0, 11)
|
||||
);
|
||||
|
||||
console.log(' pbnList ', pbnList)
|
||||
if(findData){
|
||||
|
||||
const usage = item.prfList.reduce(
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
fcBizSchema,
|
||||
type fcBizType,
|
||||
type PbnstRegArrrayType,
|
||||
type ppInstlType,
|
||||
} from "@/app/store/ruseFcltMng/fcltReg/pbnstReg/type";
|
||||
import { selectClass } from "@/app/store/ruseFcltMng/fcltReg/rainReg";
|
||||
import {
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { rateFeeType } from "@/app/store/common/searchCode/type";
|
||||
import { UiTable } from "@common/business_components/ui";
|
||||
import { UiTable } from "@common/business_components/ui";
|
||||
import ListDiv from "@common/business_components/ui/list_div";
|
||||
import { Input, Label } from "@common/components/ui";
|
||||
import { Label } from "@common/components/ui";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function RateFeeTableModal() {
|
||||
const { coRvw, rateFeeRes } = useWrStore((state) => state);
|
||||
const { coRvw, rateFeeRes } = useWrStore((state) => state);
|
||||
const [reateFeeTable, setRateFeeTable] = useState<rateFeeType[]>([]);
|
||||
|
||||
const gubunLabelMap: Record<number, string> = {
|
||||
@@ -32,32 +32,32 @@ export function RateFeeTableModal() {
|
||||
};
|
||||
|
||||
const fetchData = async (rateFeeRes: rateFeeType[]) => {
|
||||
const data = await rateFeeRes?.filter((item: rateFeeType) => {
|
||||
return item.incExpCd !== "SS";
|
||||
})
|
||||
.reduce((acc: any, cur: rateFeeType) => {
|
||||
const key = cur.stdCost;
|
||||
let target = acc.find((item: any) => item.stdCost === key);
|
||||
if (!target) {
|
||||
target = {
|
||||
stdCost: cur.stdCost,
|
||||
BD: 0,
|
||||
SE: 0,
|
||||
CE: 0,
|
||||
};
|
||||
acc.push(target);
|
||||
}
|
||||
target[cur.incExpCd] = cur.rt;
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
const data = await rateFeeRes
|
||||
?.filter((item: rateFeeType) => {
|
||||
return item.incExpCd !== "SS";
|
||||
})
|
||||
.reduce((acc: any, cur: rateFeeType) => {
|
||||
const key = cur.stdCost;
|
||||
let target = acc.find((item: any) => item.stdCost === key);
|
||||
if (!target) {
|
||||
target = {
|
||||
stdCost: cur.stdCost,
|
||||
BD: 0,
|
||||
SE: 0,
|
||||
CE: 0,
|
||||
};
|
||||
acc.push(target);
|
||||
}
|
||||
target[cur.incExpCd] = cur.rt;
|
||||
return acc;
|
||||
}, []);
|
||||
|
||||
const dataGubun = data?.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
gubun: gubunLabelMap[item.stdCost] || item.stdCost,
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
return dataGubun?.sort((a: any, b: any) => a.stdCost - b.stdCost);
|
||||
};
|
||||
@@ -81,26 +81,20 @@ export function RateFeeTableModal() {
|
||||
|
||||
<div className="col-span-5 flex items-center">
|
||||
<Label className=" text-xl text-gray-600">기준년도</Label>
|
||||
<Input
|
||||
className="col-span-1 text-2xl text-right ml-2 w-32"
|
||||
placeholder=""
|
||||
type="text"
|
||||
onChange={(e) => {}}
|
||||
value={new Date().getFullYear() || ""}
|
||||
/>
|
||||
<span>{new Date().getFullYear() || ""}</span>
|
||||
</div>
|
||||
<div className="col-span-6 pr-6">
|
||||
<UiTable
|
||||
className="min-w-full pr-12"
|
||||
key={"rateTable" + reateFeeTable?.length}
|
||||
headName={""}
|
||||
tableData={reateFeeTable || []}
|
||||
headlist={coRvw.rateFeeHeadList}
|
||||
onPageChange={() => {}}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
/>
|
||||
<UiTable
|
||||
className="min-w-full pr-12"
|
||||
key={"rateTable" + reateFeeTable?.length}
|
||||
headName={""}
|
||||
tableData={reateFeeTable || []}
|
||||
headlist={coRvw.rateFeeHeadList}
|
||||
onPageChange={() => {}}
|
||||
pageSize={0}
|
||||
total={0}
|
||||
cellClick={undefined}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</ListDiv>
|
||||
|
||||
@@ -1,26 +1,21 @@
|
||||
"use client";
|
||||
import { headMakeprfmnc } from "@/app/ruseFcltMng/prfmncReg/chkgdnReg/TableHead";
|
||||
import { useWrStore } from "@/app/store";
|
||||
import type { TableUpperProps } from "@/app/store/common/type/header";
|
||||
import type {
|
||||
} from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn";
|
||||
import type { chHeadType } from "@/app/store/prfmncReg/chkgdnReg/rainChkgdn/headList";
|
||||
import { InputTableBody } from "@/components/lib/func/TableData";
|
||||
import {
|
||||
Input,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@common/components/ui";
|
||||
import { useEffect, useState, type Dispatch, type SetStateAction } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function GuideDetailsTable({
|
||||
chgRes,
|
||||
headList,
|
||||
upheadList,
|
||||
type,
|
||||
setChGuidData,
|
||||
}: {
|
||||
chgRes: any[];
|
||||
@@ -29,7 +24,6 @@ export function GuideDetailsTable({
|
||||
type: string;
|
||||
setChGuidData: (chgRes: any[]) => void;
|
||||
}) {
|
||||
const { code, rainChkgdn } = useWrStore((state) => state);
|
||||
const [inputData, setInputData] = useState<any[]>();
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -35,7 +35,7 @@ export default function RswtChkgdTable({
|
||||
onPageChange: (page: number) => void;
|
||||
pageCount: number;
|
||||
}) {
|
||||
const { code, rswtChkgdn, rswtChkSttn, rswtChkgdnInit, rswtChkPolAndGuide, getRswtSttnExcel } = useWrStore(
|
||||
const { code, rswtChkgdn, rswtChkSttn, rswtChkPolAndGuide, getRswtSttnExcel } = useWrStore(
|
||||
(state) => state
|
||||
);
|
||||
const [headList, setHeadList] = useState<{ headList: TableUpperProps[], upHeadList: chHeadType[] }>({ headList: [], upHeadList: [] });
|
||||
|
||||
Reference in New Issue
Block a user