diff --git a/apps/fo/app/pages/(with-layout)/dashboard/drainageEquipment/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/drainageEquipment/page.tsx index 1b7249efd..fb59cfc13 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/drainageEquipment/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/drainageEquipment/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 대시보드 - 표로보기 - 배수설비 정비현황 + * + * - 배수설비 현황을 조회하는 화면. 2차사업 때 예정인 화면으로 현재 사용되지 않음. + */ + +"use client" import { useFoStore } from '@/app/store'; import type { DrainageEquipmentListProps, TableUpperProps } from '@/app/store/dashboard'; diff --git a/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/modal/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/modal/page.tsx index c482e8b7c..850d52528 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/modal/page.tsx @@ -1,4 +1,11 @@ -"use client" +/** + * 대시보드 - 표로보기 - 시설정보 및 운영현황(모달) + * + * - 유량, 수질, 총인시설의 연간, 하절기, 동절기 단위로 값을 차트로 시각화하여 보여주는 모달화면 + * - 막대그래프로 모달을 그려준다. + */ + +"use client" import type { OperationalStatusListProps } from "@/app/store/dashboard"; import { CHART_FORM, MainChart, type ChartConfig } from "@common/business_components"; import { Button } from "@common/business_components/ui/table/lib/button"; diff --git a/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/page.tsx index fa2a97d9e..dd689f2fa 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/facilityInfo/page.tsx @@ -1,4 +1,13 @@ -"use client" +/** + * 대시보드 - 표로보기 - 시설정보 및 운영현황 + * + * - 시설정보 및 운영현황 탭의 메인 페이지 + * - 중앙상단에는 시설에 대한 요약정보가, 좌측 상단은 시설계획에 대한 정보, 좌측하단에는 물사용량에 대한 정보, + * 우측에는 조회년도 및 시설에 해당하는 유량 및 수질정보를 연간,하절기,동절기별 추출하여 데이터를 보여준다. + * - 우측 운영실태는 연간, 하절기, 동절기별로 색이 칠해져있는데 어떤항목들끼리 차트로 그려지는지 확인하기 위해서다. + */ + +"use client" import { roundNumber } from "@/app/components/common/DataForm"; import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/processFacility"; @@ -13,7 +22,12 @@ export type facilityInfoProps = { fcltyList?: { bscFctCd: string, bscFctNm: string, fcltyCpc: number | '', trtFrfNm: string, efflWqltStndrdNm: string }[]; }; -// 시설계획 table header 변경 +/** + * 시설계획 table header 변경 + * @param upHeadList + * @param planYearList + * @returns + */ const headMakeColSpanPlanFclty = (upHeadList: TableUpperProps[], planYearList: string[]) => { return ( <> { @@ -29,6 +43,12 @@ const headMakeColSpanPlanFclty = (upHeadList: TableUpperProps[], planYearList: s } // 시설계획 table header 변경 +/** + * + * @param upHeadList + * @param searchYear + * @returns + */ const headMakeColSpanOperationStatus = (upHeadList: TableUpperProps[], searchYear: string) => { return ( <> diff --git a/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx index b0759e336..82eeb4d7c 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/maingraph/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 대시보드 - 표로보기 - 주요그래프 + * + * - 시설의 조회년도에 해당하는 수질정보, 강우량, 유입량 등을 특정 항목별로 묶어서 차트로 시각화해주는 화면 + */ + +"use client" import { useFoStore } from "@/app/store"; import type { lineChartDataProps } from "@/app/store/dashboard"; import { CHART_FORM, type ChartConfig, ContentsDiv, MainChart } from "@common/business_components"; diff --git a/apps/fo/app/pages/(with-layout)/dashboard/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/page.tsx index 7a2c3d8a0..a09431598 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 대시보드 - 표로보기(메인) + * + * - 대시보드 - 표로보기 메인페이지로 상단영역의 제어 및 탭 전환 시 보여주는 페이지를 지정해준다. + */ + +"use client" import { useFoStore } from "@/app/store"; import { ContentsDiv, downloadExcel, downloadMultipleExcel, filePickedBlobArray, MainDiv, SelectBox, UITab, type SelectDataType } from "@common/business_components"; import { Button, TabsContent } from "@common/components/ui"; diff --git a/apps/fo/app/pages/(with-layout)/dashboard/rainManage/page.tsx b/apps/fo/app/pages/(with-layout)/dashboard/rainManage/page.tsx index a24230de7..e084bf04d 100644 --- a/apps/fo/app/pages/(with-layout)/dashboard/rainManage/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboard/rainManage/page.tsx @@ -1,4 +1,11 @@ -"use client" +/** + * 대시보드 - 표로보기 - 강우일 운영현황 + * + * - 시설의 강우량 구간별(3~10mm미만..10~20mm미만 등) 강우일수 및 수질정보를 표로 보여주는 화면 + * - 강우영향일 계산후 바뀌는 tobe강우일을 계산해야 한다. + */ + +"use client" import { useFoStore } from "@/app/store"; import { UiTable } from "@common/business_components/ui/table"; import { useEffect, useState } from "react"; diff --git a/apps/fo/app/pages/(with-layout)/dashboardMain/page.tsx b/apps/fo/app/pages/(with-layout)/dashboardMain/page.tsx index 12bf0763c..67e704570 100644 --- a/apps/fo/app/pages/(with-layout)/dashboardMain/page.tsx +++ b/apps/fo/app/pages/(with-layout)/dashboardMain/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 대시보드 - 표로보기 상단구역 페에지 + * + * - 대시보드 - 표로보기의 3개의 탭 상단에 조회년도, 행정정보, 시설명의 구역을 컴포넌트 + */ + +"use client" import { useFoStore } from "@/app/store"; import { useEffect, useState } from "react"; import SearchInput from "../../../components/common/SearchInput"; diff --git a/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx b/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx index 524cdc99c..e90def9b6 100644 --- a/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/facilityPrecipitation/modal/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 연간 운영현황 - 강수현황(모달) + * + * - 선택한 시설을 조회한 년도의 하루단위로 강우량 및 강우영향일 정보를 보여주는 화면. + */ + +"use client" import CalcRainEffect from "@/app/components/common/CalcRainEffect"; import { roundNumber } from "@/app/components/common/DataForm"; import { useFoStore } from "@/app/store"; diff --git a/apps/fo/app/pages/(with-layout)/facilityPrecipitation/page.tsx b/apps/fo/app/pages/(with-layout)/facilityPrecipitation/page.tsx index aaba872d7..6c5181549 100644 --- a/apps/fo/app/pages/(with-layout)/facilityPrecipitation/page.tsx +++ b/apps/fo/app/pages/(with-layout)/facilityPrecipitation/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 연간 운영현황 - 강수현황(메인) + * + * - 시설별 강수 현황을 조회조건대로 추출하여 표로 보여주는 화면. + */ + +"use client" import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common"; import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiModal, UiTable, type ReturnType } from "@common/business_components"; diff --git a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/HeadMakeColSpan.tsx b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/HeadMakeColSpan.tsx index 61076c105..aa1e36abd 100644 --- a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/HeadMakeColSpan.tsx +++ b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/HeadMakeColSpan.tsx @@ -1,3 +1,9 @@ +/** + * 처리시설 연간 운영현황 - 수질현황 + * + * - 수질현황의 헤더를 만들어주는 컴포넌트 + */ + import { TableHead, TableRow } from "@common/components/ui"; interface TableUpperProps { diff --git a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx index eedd52b37..948d05b1d 100644 --- a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/modal/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 연간 운영현황 - 수질현황 + * + * - 메인화면에서 선택한 시설의 수질정보를 하루단위로 보여주는 모달. + */ + +"use client" import { useFoStore } from "@/app/store"; import type { FacilityWaterQltyProps, modalExcelType } from "@/app/store/facilityWaterQlty"; import { downloadExcel, UITab, UiTable } from "@common/business_components/ui"; diff --git a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/page.tsx b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/page.tsx index 5367a1c22..a188f60b9 100644 --- a/apps/fo/app/pages/(with-layout)/facilityWaterQlty/page.tsx +++ b/apps/fo/app/pages/(with-layout)/facilityWaterQlty/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 연간 운영현황 - 수질현황 + * + * - 시설별 수질 현황을 조회조건대로 추출하여 표로 보여주는 화면. + */ + +"use client" import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common"; diff --git a/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx b/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx index d6166133f..9f026430a 100644 --- a/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/flowRate/modal/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 연간 운영현황 - 유량현황(모달)) + * + * - 선택한 시설의 유량 정보를 하루 단위로 표로 출력해주는 모달 + */ + +"use client" import FacilityTermModalHeader from "@/app/components/common/FacilityTermModalHeader"; import { useFoStore } from "@/app/store"; import type { FlowRateModalInterface, modalExcelType } from "@/app/store/flowRate"; diff --git a/apps/fo/app/pages/(with-layout)/flowRate/page.tsx b/apps/fo/app/pages/(with-layout)/flowRate/page.tsx index 85fcaef88..750395cbd 100644 --- a/apps/fo/app/pages/(with-layout)/flowRate/page.tsx +++ b/apps/fo/app/pages/(with-layout)/flowRate/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 연간 운영현황 - 유량현황 + * + * - 시설별 유량 현황을 조회조건대로 추출하여 표로 보여주는 화면. + */ + +"use client" import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common"; import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiModal, UiTable, type ReturnType } from "@common/business_components"; diff --git a/apps/fo/app/pages/(with-layout)/planSewage/page.tsx b/apps/fo/app/pages/(with-layout)/planSewage/page.tsx index 37fcb5b01..1f1768af5 100644 --- a/apps/fo/app/pages/(with-layout)/planSewage/page.tsx +++ b/apps/fo/app/pages/(with-layout)/planSewage/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 연간 운영현황 - 계획하수량 산정지표 현황 + * + * - 시설별 여유용량, 변동부하율, 분류식화율을 조회조건대로 추출하여 표로 보여주는 화면. + */ + +"use client" import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common"; import { downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ReturnType } from "@common/business_components"; diff --git a/apps/fo/app/pages/(with-layout)/processArea/modal/page.tsx b/apps/fo/app/pages/(with-layout)/processArea/modal/page.tsx index 06e26bac6..bc7c2651b 100644 --- a/apps/fo/app/pages/(with-layout)/processArea/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/processArea/modal/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 현황 - 처리구역정보(모달) + * + * - 선택한 시설의 계획정보를 가져와 표로 출력해주는 모달 + */ + +"use client" import { useFoStore } from "@/app/store"; import { UiTable } from "@common/business_components/ui"; import ListDiv from "@common/business_components/ui/list_div"; diff --git a/apps/fo/app/pages/(with-layout)/processArea/page.tsx b/apps/fo/app/pages/(with-layout)/processArea/page.tsx index 746f9a111..fc571c665 100644 --- a/apps/fo/app/pages/(with-layout)/processArea/page.tsx +++ b/apps/fo/app/pages/(with-layout)/processArea/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 현황 - 처리구역정보(메인) + * + * - 시설계획 정보를 조회조건대로 추출하여 표로 보여주는 화면. + */ + +"use client" import { useFoStore } from "@/app/store"; import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SelectBox, Title, UiModal, UiTable, type ReturnType } from "@common/business_components"; import ListDiv from "@common/business_components/ui/list_div"; diff --git a/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx b/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx index b27984df7..8362a46d9 100644 --- a/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/processFacility/modal/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 현황 - 처리시설 시설정보(모달)) + * + * - 선택한 시설의 정보와 시설이력정보를 보여주는 모달. + */ + +"use client" import { roundNumber } from "@/app/components/common/DataForm"; import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/dashboard"; diff --git a/apps/fo/app/pages/(with-layout)/processFacility/page.tsx b/apps/fo/app/pages/(with-layout)/processFacility/page.tsx index 7ed2802a2..0e9085cb4 100644 --- a/apps/fo/app/pages/(with-layout)/processFacility/page.tsx +++ b/apps/fo/app/pages/(with-layout)/processFacility/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 처리시설 현황 - 처리시설 시설정보(메인) + * + * - 시설별 정보를 조회조건대로 추출하여 표로 보여주는 화면. + */ + +"use client" import UnderComment from "@/app/components/common/UnderComment"; import { useFoStore } from "@/app/store"; import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiModal, UiTable, type ReturnType } from "@common/business_components"; diff --git a/apps/fo/app/pages/(with-layout)/rdi/page.tsx b/apps/fo/app/pages/(with-layout)/rdi/page.tsx index 11b1f849a..69fb49b14 100644 --- a/apps/fo/app/pages/(with-layout)/rdi/page.tsx +++ b/apps/fo/app/pages/(with-layout)/rdi/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 운영실태 - RDII 추정 + * + * - 시설별 유입량과 하절기 최저 유입 BOD 정보를 통해 RDII를 추정치를 보여주는 화면 + */ + +"use client" import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common"; import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiTable, type ReturnType } from "@common/business_components"; diff --git a/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx b/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx index f09d2f149..a2ffb386a 100644 --- a/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/sewageOccur/modal/page.tsx @@ -1,4 +1,10 @@ -"use client" +/** + * 운영실태 - 오수발생량 추정(모달) + * + * - 선택한 시설의 물사용량과 오수전환율을 가지고 오수발생량 추정 데이터를 월별로 보여주는 모달. + */ + +"use client" import { roundNumber } from "@/app/components/common/DataForm"; import { useFoStore } from "@/app/store"; import type { modalTableType } from "@/app/store/sewageOccur"; diff --git a/apps/fo/app/pages/(with-layout)/sewageOccur/page.tsx b/apps/fo/app/pages/(with-layout)/sewageOccur/page.tsx index 23f764269..6fb01efb3 100644 --- a/apps/fo/app/pages/(with-layout)/sewageOccur/page.tsx +++ b/apps/fo/app/pages/(with-layout)/sewageOccur/page.tsx @@ -1,4 +1,11 @@ -"use client" +/** + * 운영실태 - 오수발생량 추정(메인) + * + * - 조회조건대로 시설별 물 사용량과 오수전환율을 기반으로 오수발생량 추정치를 표로 보여주는 화면 + * - 현재 물사용량의 경우 연계받는 데이터가 아닌 연 하수유입량의 65%로 가정하고 계산함 + */ + +"use client" import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common"; import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiModal, UiTable, type ReturnType } from "@common/business_components"; diff --git a/apps/fo/app/pages/(with-layout)/underWaterInput/modal/page.tsx b/apps/fo/app/pages/(with-layout)/underWaterInput/modal/page.tsx index 5da9622d0..2e0f5f27e 100644 --- a/apps/fo/app/pages/(with-layout)/underWaterInput/modal/page.tsx +++ b/apps/fo/app/pages/(with-layout)/underWaterInput/modal/page.tsx @@ -1,4 +1,11 @@ -"use client" +/** + * 운영실태 - 지하수 유입량 추정(모달) + * + * - 선택한 시설의 월별 청천시 실제 하수유입량, 오수발생량으로 지하수 유입량을 보여주는 모달 + * - 청천시 실제 하수유입량 - 오수발생량으로 지하수유입량을 추정한다. + */ + +"use client" import { roundNumber } from "@/app/components/common/DataForm"; import { useFoStore } from "@/app/store"; import type { UnderWaterInputModalProps } from "@/app/store/underWaterInput/types"; diff --git a/apps/fo/app/pages/(with-layout)/underWaterInput/page.tsx b/apps/fo/app/pages/(with-layout)/underWaterInput/page.tsx index 6d8172bce..a621611b7 100644 --- a/apps/fo/app/pages/(with-layout)/underWaterInput/page.tsx +++ b/apps/fo/app/pages/(with-layout)/underWaterInput/page.tsx @@ -1,4 +1,12 @@ -"use client" +/** + * 운영실태 - 지하수 유입량 추정(메인) + * + * - 조회조건대로 시설별 연간, 하절기, 동절기 단위로 지하수 유입량 추정을 표로 보여주는 화면 + * - 청천시 실제 하수유입량 - 오수발생량으로 지하수유입량을 추정한다. + * - 연간 지하수 유입량이 하수유입량보다 20% 클 경우 초과유입으로 아닌 경우 적정으로 적정여부를 표시한다. + */ + +"use client" import { useFoStore } from "@/app/store"; import type { TableUpperProps } from "@/app/store/common"; import { ContentsDiv, downloadExcel, MainDiv, SearchBaseForm, SearchInput, SelectBox, Title, UiModal, UiTable, type ReturnType } from "@common/business_components"; diff --git a/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx b/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx index 8b3f5dfdb..472b8222f 100644 --- a/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx +++ b/apps/wr/app/(with-layout)/matMng/coMat/coMatRvw/page.tsx @@ -40,6 +40,14 @@ import { useForm, useWatch } from "react-hook-form"; import toast, { Toaster } from "react-hot-toast"; import { z } from "zod"; + +/** + * 📄 CoMatRvw 수요매칭 검토 + * Next.js App Router (app/) 기반 페이지 컴포넌트 예시 + * + * - 대민에서 신청하는 수요처의 수요등록 정보를 운영담당자가 수요 매칭 검토를 진행한다. + * - 전체적으로 form을 만들어서 form안에 데이터를 넣고 api를 호출하여 저장한다. + */ export default function CoMatRvw() { const { auth, code, coRvw, coMatRvwInit, coMatRvwSearch, coMatRvwInqua } = useWrStore((state) => state); @@ -70,6 +78,9 @@ export default function CoMatRvw() { ); const [selectionVersion, setSelectionVersion] = useState(0); + + + //수요 매칭 검색 const getSearch = ( startYear: number, endYear: number, @@ -117,7 +128,7 @@ export default function CoMatRvw() { if (coMatRvwRes && coMatRvwRes.length > 0) { const data = coMatRvwRes?.map((item) => { let flag = ""; - + // 수요처의 매칭된 정보를 확인할수 있도록 한다. flag = getdmdMatFlag(item?.demandMatching?.splyFcltFlg || undefined); return { diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx index b5b3f37f9..d5d0e9b33 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/pbnstReg/page.tsx @@ -35,6 +35,17 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { z } from "zod"; import { createDefaultPbnstItem } from "./utilsZod"; import { useTranslation } from "react-i18next"; +/** + * 재이용시설 등록 - 하수재이용 시설등록 + * + * - layout.tsx에 의해 공통 레이아웃이 적용됨 + * - with-layout 적용 + * - 하수처리시설에 하수재이용 시설을 등록 한다. + * - form으로 시설정보 및 차수별 정보의 컴포넌트 데이터를 관리한다 + * indexMng: 시설정보 + * indexBiz: 차수별 정보 + * 로 하수재이용 시설에 등록된 시설 및 차수별 정보를 관리한다. + * */ export default function PublicReuseFaciltyInsert() { const { diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/page.tsx index 629263c31..f3567210d 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rainReg/page.tsx @@ -22,6 +22,17 @@ import { Button } from "@common/components"; import { useEffect, useRef, useState } from "react"; import { Toaster } from "react-hot-toast"; + + +/** + * 밧물이용시설 등록 + * 재이용시설 등록 - 빗물시설 등록 + * - layout.tsx에 의해 공통 레이아웃이 적용됨 + * - with-layout 적용 + * 왼쪽 테이블에는 건축물 리스트 / 오른쪽 폼에는 건축물에 해당하는 빗물이용시설 데이터가 보인다. + * 신규 등록 버튼을 눌러 건축물 정보부터 입력한다. + * + * */ export default function Home() { const { auth, diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rswtReg/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rswtReg/page.tsx index 619a3d0d7..27fe7456f 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rswtReg/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltReg/rswtReg/page.tsx @@ -22,6 +22,15 @@ import { Button } from "@common/components"; import { useEffect, useRef, useState } from "react"; import { Toaster } from "react-hot-toast"; + +/** + * 중수도 시설 등록 + * 재이용시설 등록 - 중수도시설 등록 + * - layout.tsx에 의해 공통 레이아웃이 적용됨 + * - with-layout 적용 + * 왼쪽 테이블에는 건축물 리스트 / 오른쪽 폼에는 건축물에 해당하는 중수도시설 데이터가 보인다. + * 신규 등록 버튼을 눌러 건축물 정보부터 입력한다. + * */ export default function Home() { const { auth, diff --git a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx index bbab4d9ce..ca0b04f31 100644 --- a/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx +++ b/apps/wr/app/(with-layout)/ruseFcltMng/fcltSttn/pbnstSttn/page.tsx @@ -24,6 +24,15 @@ import { useCallback, useEffect, useRef, useState } from "react"; import toast, { Toaster } from "react-hot-toast"; import { useTranslation } from "react-i18next"; +/** + * 하수재이용 시설 현황 + * 재이용시설 현황 - 하수재이용시설 현황 + * - layout.tsx에 의해 공통 레이아웃이 적용됨 + * - with-layout 적용 + * 하수처리시설. 하수재이용시설 , 하수재이용시설 실적에 대한 정보를 확인한다. + * 모달 : 테이블의 헤더를 원하는대로 조절해서 볼수 있다. + * 클릭시 해당 재이용ㅇ + * */ export default function PbnstSttn() { const { code, @@ -32,7 +41,7 @@ export default function PbnstSttn() { pbnSttnInit, getPbnStnDetail, getFlcts, - resetPbnstDetail + resetPbnstDetail, } = useWrStore((state) => state); const { pbnstSttnRes, fclts, pbnstSttnResCount } = pbnstSttn; @@ -50,7 +59,7 @@ export default function PbnstSttn() { }>({ isModal: false, data: {} as customPbnst }); const isDownloadTriggered = useRef(false); const [pbnRuseNm, setPbnRuseNm] = useState(""); - const { t } = useTranslation('base'); + const { t } = useTranslation("base"); const excelClick = useCallback(() => { isDownloadTriggered.current = true; pbnstSttnSearch( @@ -79,7 +88,6 @@ export default function PbnstSttn() { } }, [pbnstSttn.isInit]); useEffect(() => { - pbnSttnInit("1", "15", ref.current, searchYear, fclts); }, [fclts]); @@ -91,7 +99,6 @@ export default function PbnstSttn() { } }, [pbnstSttnRes]); - useEffect(() => { if (!isDownloadTriggered.current) { return; @@ -105,12 +112,11 @@ export default function PbnstSttn() { 3 ); } else { - toast.error(t('excelDownErrMsg')); + toast.error(t("excelDownErrMsg")); } isDownloadTriggered.current = false; }, [pbnstSttn.excelList]); - useEffect(() => { if (pbnstSttn.pbnstDetail.pbnstRuseFcltId) setPbnDetaileData({ @@ -211,7 +217,6 @@ export default function PbnstSttn() { ); setIsReset(false); }} - resetPageNo={isReset} > diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx index e5a1f7da2..b1e0daf82 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/pbnstReg/index.tsx @@ -26,6 +26,12 @@ import { import type { TableUpperProps } from "@/app/store/common/type/header"; import toast from "react-hot-toast"; +/** + * 하수재이용시설 등록 (스토어) + * 재이용시설 등록 - 하수재이용시설 등록 + * 하수재이용시설 사용하는 api 및 타입 등을 관리한다. + * */ + const selectLabel: SelectDataType[] = [{ text: "test", val: "1" }]; const pubFacHeadList = pubFacHeadListExport; const pbnstMngUpHeadList = pbnstMngUpHeadListExport; @@ -167,6 +173,7 @@ export const writeRgtrAndMdfr = (data: customPbnst[]) => { }; export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { return { + // 하수처리시설을 조회한다(운영실태) pubHasuInit: async (page: string, sggOrCity: string) => { try { const pbnstHasuRes = await hasuListFetch(page, sggOrCity); @@ -182,6 +189,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { console.log(errorHasu); } }, + // 하수처리시설을 조회한다(운영실태) (처리시설명 포함) pubHasuSearch: async ( page: string, sggOrCity: string, @@ -201,6 +209,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { console.log(errorHasu); } }, + // 하수재이용시설을 조회한다 pbnstRegClick: async (pubHasuRes: pubHasuType) => { try { const pbnstRes = await initFetch(pubHasuRes.bscFctCd); @@ -215,6 +224,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { console.log(errorHasu); } }, + // 하수재이용시설을 등록한다. pbnstInsert: async (pbnstRes: customPbnst) => { try { const response = await postFectch(`/reuseFc/pubFc`, pbnstRes); @@ -238,6 +248,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { console.error("Error updating pbnst:", error); } }, + // 하수재이용시설을 업데이트한다.(사업제외) 다르게하는 이유는 객체가 너무커서 분활 처리하려고 pbnstRuseFcltUpdate: async (ruseRes: customPbnst[]) => { try { await putFectch(`/reuseFc/pubFc`, ruseRes); @@ -245,6 +256,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { console.error("Error pbnstRuseFcltUpdate:", error); } }, + // 하수재이용시설을 업데이트한다.(사업포함) 다르게하는 이유는 객체가 너무커서 분활 처리하려고 pbnstRuseBizUpdate: async (ruseRes: fcBizType[]) => { try { await putFectch(`/reuseFc/pubFcBiz`, ruseRes); @@ -252,6 +264,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { console.error("Error pbnstRuseFcltUpdate:", error); } }, + // 파일삭제 (attach-service) fileDelete: async (atflCd: string) => { try { const response = await deleteFectch( @@ -271,6 +284,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { console.error("Error deleting file:", error); } }, + // 파일다운로드 (attach-service) fileDownLoad: async (atflCd: string) => { try { await getFetch( @@ -282,6 +296,7 @@ export const pubFacActionsExport: (set: any) => pubFacActions = (set: any) => { throw new Error(`Error downloading file: ${error}`); } }, + //원수취수 팝업의 하수처리 시설 리스트 조회 getFcOrgwts: async (fcltPkList: string[], size: number) => { const fcOrgwtsNmList = await postFectch( `/prcsFclt/ruseInfo/1/${size}/A/0/0/1/SW`, diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx index ff263783a..565909a57 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rainReg/index.tsx @@ -1,15 +1,31 @@ import type { TableUpperProps } from "@/app/store/common/type/header"; -import { fetchType, getFetchWithCount, postFectch, putFectch } from "@/components/lib/api"; +import { + fetchType, + getFetchWithCount, + postFectch, + putFectch, +} from "@/components/lib/api"; import toast from "react-hot-toast"; import { z } from "zod"; import { makeMdfr, makeRstr } from "../bdstReg"; -import { baseReuseBuildingSchema, chgBuildingSchema, validationMessages } from "./type"; +import { + baseReuseBuildingSchema, + chgBuildingSchema, + validationMessages, +} from "./type"; +export const TEST_UUID = "2d4b151d-1828-41e0-91d9-4cd28ea1cc7e"; +export const rainRegSize = 15; -export const TEST_UUID = '2d4b151d-1828-41e0-91d9-4cd28ea1cc7e' -export const rainRegSize =15 +/** + * 밧물이용시설 등록 (스토어) + * 재이용시설 등록 - 빗물시설 등록 + * 빗물이용시설에서 사용하는 api 및 타입 등을 관리한다. + * */ const rainyObjSchema = z.object({ bdstReuseFcltFk: z.number().nullish(), - pntfColKnd: z.string().min(1, { message: validationMessages.requiredSelect("종류") }), + pntfColKnd: z + .string() + .min(1, { message: validationMessages.requiredSelect("종류") }), pntfColArea: z.number().nullish(), dtfcltCpct: z.number().default(0), filtrTrtmfctYn: z.string().default("Y"), @@ -21,10 +37,9 @@ const rainyObjSchema = z.object({ mdfr: z.string().nullish(), }); - const rainBuildingSchema = baseReuseBuildingSchema.extend({ rainyObj: rainyObjSchema, -}) +}); export const rainZod = z.object({ bdstInfoSn: z.number().optional(), @@ -34,23 +49,23 @@ export const rainZod = z.object({ bdstNm: z.string().default(""), frstArchPrmsnDt: z.date().default(() => new Date()), archChgPrmsnDt: z.coerce.date().nullish().default(null), - archArea: z.string().default(''), + archArea: z.string().default(""), archChgArea: z.number().default(0), rgtr: z.string().nullish(), mdfr: z.string().nullish(), reuseBuilding: z.array(rainBuildingSchema).default([]), - chgBuilding: z.array(chgBuildingSchema).default([]) -}) + chgBuilding: z.array(chgBuildingSchema).default([]), +}); export type chgBuilding = { - bdstInfoSn?: number | null, - archChgPrmsnDt?: Date, - archChgArea?: string, - bdstChgNm?: string + bdstInfoSn?: number | null; + archChgPrmsnDt?: Date; + archChgArea?: string; + bdstChgNm?: string; rgtr?: string | null; mdfr?: string | null; -} -export type customRainBdst = z.infer +}; +export type customRainBdst = z.infer; export const upHeadList: TableUpperProps[] = [ { id: "cityText", title: "시도" }, @@ -66,7 +81,6 @@ export const upHeadList: TableUpperProps[] = [ const rainRes: customRainBdst[] = []; - export const selectClass = "w-full h-full !text-xl"; export type rainFacState = { @@ -79,10 +93,9 @@ export type rainFacState = { type rainFacSActions = { initRain: (code: string | number) => void; getRainData: (pageNation: number, code: string | number) => void; - rainSearch: (txt: string, pageNation: number, code: string ) => void; + rainSearch: (txt: string, pageNation: number, code: string) => void; rainBdstReg: (data: customRainBdst, code: string | number) => void; rainBdstUpdate: (data: customRainBdst, code: string | number) => void; - }; export type rainFacType = rainFacState & rainFacSActions; @@ -96,16 +109,23 @@ export const rainFacStateExport: rainFacState = { }; const initFetch = async (code: string | number) => { - const rainRes = await getFetchWithCount(fetchType.WR, `/reuseFc/rainyInfoList/1/${rainRegSize}/${code}`); + const rainRes = await getFetchWithCount( + fetchType.WR, + `/reuseFc/rainyInfoList/1/${rainRegSize}/${code}` + ); return rainRes; }; export const rainFacActionsExport: (set: any) => rainFacSActions = ( set: any ) => { return { + // 빗물 이용시설 조회한다. getRainData: async (pageNation: number, code: string | number) => { try { - const rainRes = await getFetchWithCount(fetchType.WR, `/reuseFc/rainyInfoList/${pageNation}/${rainRegSize}/${code}`); + const rainRes = await getFetchWithCount( + fetchType.WR, + `/reuseFc/rainyInfoList/${pageNation}/${rainRegSize}/${code}` + ); // 여기서 상태 업데이트 return set((state: rainFacState) => ({ @@ -116,13 +136,11 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( rainResCount: rainRes.count, }, })); - } catch (e) { - console.log(e) - + console.log(e); } }, - + // 빗물 이용시설 조회한다. initRain: async (code: string | number) => { try { // 파라이터 수정 통합관리자 =0, 시관리자=시코드, 시군구 관리자= 시군구 코드 를 세번째 파라미터로 지정 / 건축물 서치가 있을경우 4번째 파라미터로 던지기 즉 1/20/42(서울시)/영현빌딩 이런식으로) @@ -140,12 +158,16 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( console.log("error", error); } }, - rainSearch: async (txt: string, pageNation: number ,code:string) => { + // 빗물 이용시설 조회한다. (건축물 이름을 포함하여) + rainSearch: async (txt: string, pageNation: number, code: string) => { try { - // const rainRes = await getFetch('wr' , `/reuseFc/rainyInfoList/${pageNation}/20/41` +(txt? `/${txt}`:'')) - const rainRes = await getFetchWithCount(fetchType.WR, `/reuseFc/rainyInfoList/${pageNation}/${rainRegSize}/${code}` + (txt ? `/${txt}` : '')) - console.log("rainRes", rainRes) + const rainRes = await getFetchWithCount( + fetchType.WR, + `/reuseFc/rainyInfoList/${pageNation}/${rainRegSize}/${code}` + + (txt ? `/${txt}` : "") + ); + console.log("rainRes", rainRes); set((state: rainFacState) => { return { rain: { @@ -154,27 +176,23 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( rainResCount: rainRes.count, }, }; - }) - } - catch (erTxt) { - console.log("error", erTxt) + }); + } catch (erTxt) { + console.log("error", erTxt); } }, + // 빗물 이용시설을 등록한다. rainBdstReg: async (data: customRainBdst, code: string | number) => { try { - const test = await makeRstr(data); const res = await postFectch("/reuseFc/rainyInfo", test); if (res.status === 200) { if (data.chgBuilding.length > 0) { - - const chPK = res?.data?.bdstInfoSn - const makeCh = res.data.chgBuilding.map((item: chgBuilding) => - ({ + const chPK = res?.data?.bdstInfoSn; + const makeCh = res.data.chgBuilding.map((item: chgBuilding) => ({ ...item, bdstInfoSn: chPK, - }) - ); + })); const chch = await postFectch("/reuseFc/chgBuilding", makeCh); if (chch.status === 200) { @@ -203,25 +221,20 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( } finally { } }, + // 빗물이용시설 시설에 대한 사항을 업데이트한다 rainBdstUpdate: async (data: customRainBdst, code: string | number) => { try { const chData = await makeMdfr(data); const res = await putFectch("/reuseFc/rainyInfo", chData); - console.log("res", res) - console.log("data", data) if (res.status === 200) { if (data.chgBuilding.length > 0) { const chPK = data?.bdstInfoSn; - console.log("chPK", chPK) - const makeCh = data.chgBuilding.map((item: chgBuilding) => - ({ + console.log("chPK", chPK); + const makeCh = data.chgBuilding.map((item: chgBuilding) => ({ ...item, bdstInfoSn: chPK, - }) - ); - console.log("makeCh", makeCh) + })); const chch = await postFectch("/reuseFc/chgBuilding", makeCh); - console.log("chch", chch) if (chch.status === 200) { toast.success("건축물 수정이 완료되었습니다."); @@ -235,10 +248,6 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( toast.error("건축물 수정이 완료되었습니다."); } - // } - // toast.success("수정이 완료되었습니다."); - - // } const rainRes = await initFetch(code); set((state: rainFacState) => ({ ...state, @@ -253,7 +262,6 @@ export const rainFacActionsExport: (set: any) => rainFacSActions = ( toast.error("수정시 오류가 발생하였습니다."); } finally { } - } - } -} - + }, + }; +}; diff --git a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx index d324f3332..7fa3595fc 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltReg/rswtReg/index.tsx @@ -8,6 +8,13 @@ import { makeMdfr, makeRstr } from "../bdstReg"; import { baseReuseBuildingSchema, chgBuildingSchema, validationMessages } from "../rainReg/type"; + + +/** + * 중수도시설 등록 (스토어) + * 재이용시설 등록 - 중수도시설 등록 + * 중수도시설에서 사용하는 api 및 타입 등을 관리한다. + * */ export const rswtRegSize =15; const rswtrObjSchema = z.object({ bdstRuseFcltSn: z.number().nullish(), @@ -87,6 +94,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( set: any ) => { return { + // 중수도 시설을 조회한다 (시설이름 포함) rswtBdstSearch: async ( txt: string, pageNation: number, @@ -112,6 +120,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( console.log("error", erTxt); } }, + // 중수도 시설을 조회한다 getRswtBdstData: async (pageNation: number, code: string | number) => { try { const rswtRes = await getFetchWithCount( @@ -132,6 +141,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( console.log(e); } }, + // 중수도 시설을 조회한다 initRswt: async (code: string | number) => { try { const rswtRes = await initFetch(code); @@ -147,6 +157,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( console.log(error); } }, + // 중수도 시설에 대한 사항을 업데이트한다 rswtBdstUpdate: async (data: customRswtBdst, code: string | number) => { try { const chData = await makeMdfr(data); @@ -189,6 +200,7 @@ export const rswtFacActionsExport: (set: any) => rswtFacSActions = ( } finally { } }, + // 중수도 시설을 등록한다. rswtBdstReg: async (data: customRswtBdst, code: string | number) => { try { const chData = await makeRstr(data); diff --git a/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/index.tsx b/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/index.tsx index f14101626..28743ab26 100644 --- a/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/index.tsx +++ b/apps/wr/app/store/ruseFcltMng/fcltSttn/pbnstSttn/index.tsx @@ -1,4 +1,7 @@ -import type { CommonTableProps, TableUpperProps } from "@/app/store/common/type/header"; +import type { + CommonTableProps, + TableUpperProps, +} from "@/app/store/common/type/header"; import type { FcPrfType } from "@/app/store/prfmncReg/pbnstPrfmncReg/type"; import { fetchType, getFetch, postFectch } from "@/components/lib/api"; import type { ReturnType } from "@common/business_components/ui"; @@ -8,9 +11,23 @@ import type { customPbnst, pubHasuType } from "../../fcltReg/pbnstReg/type"; import { controlHeadView } from "../rainSttn"; import type { sttnHeadListType } from "../rainSttn/headList"; import { excelPbnstSttnParsing } from "./excel"; -import { pbnSttHeadListExport, pbnstSttNodeListExport, ruseDmdHeadListExport, ruseFcltHeadListExport, ruseFcltNodeListExport, ruseGuranteeHeadListExport, rusePplHeadListExport, ruseSplyHeadListExport } from "./headList"; +import { + pbnSttHeadListExport, + pbnstSttNodeListExport, + ruseDmdHeadListExport, + ruseFcltHeadListExport, + ruseFcltNodeListExport, + ruseGuranteeHeadListExport, + rusePplHeadListExport, + ruseSplyHeadListExport, +} from "./headList"; import type { WaterReuseFacility } from "./type"; +/** + * 하수재이용시설 현황 (스토어) + * 하수재이용시설 등록 - 하수재이용시설 현황 + * 빗물이용시설에서 사용하는 api 및 타입 등을 관리한다. + * */ const pbnstSttHeadList = pbnSttHeadListExport; const pbnstSttNodeList = pbnstSttNodeListExport; @@ -21,15 +38,15 @@ export type pbnstSttnState = { pbnstSttHeadList: CommonTableProps[]; pbnstSttNodeList: CommonTableProps[]; pbnstDetail: customPbnst; - ruseFcltNodeList: TableUpperProps[] - ruseSplyHeadList: TableUpperProps[] - rusePplHeadList: TableUpperProps[] - ruseGuranteeHeadList: TableUpperProps[] - ruseDmdHeadList: TableUpperProps[] - ruseFcltHeadList: TableUpperProps[] + ruseFcltNodeList: TableUpperProps[]; + ruseSplyHeadList: TableUpperProps[]; + rusePplHeadList: TableUpperProps[]; + ruseGuranteeHeadList: TableUpperProps[]; + ruseDmdHeadList: TableUpperProps[]; + ruseFcltHeadList: TableUpperProps[]; pbnstSttnResCount: number; excelList: []; - fclts: string[] + fclts: string[]; isInit: boolean; }; }; @@ -97,49 +114,65 @@ export const hasuListFetch = async ( ) => { let url = ``; let filteredFclt = flcts; - const filterData = reurnValue.sigunValue !== '0' ? reurnValue.sigunValue : reurnValue.sidoValue + const filterData = + reurnValue.sigunValue !== "0" + ? reurnValue.sigunValue + : reurnValue.sidoValue; - - if(filterData !== '0') - filteredFclt= flcts.filter((fclt: string) => { - return filterData.length==2 ?fclt.slice(0, 2) === filterData:fclt.slice(0, 5) === filterData - }) + if (filterData !== "0") + filteredFclt = flcts.filter((fclt: string) => { + return filterData.length == 2 + ? fclt.slice(0, 2) === filterData + : fclt.slice(0, 5) === filterData; + }); if (reurnValue.partValue === "A") { url += `${reurnValue.partValue}/${ // reurnValue.sidoValue ? reurnValue.sidoValue : reurnValue.sigunValue - reurnValue.sigunValue !== '0' ? reurnValue.sigunValue : reurnValue.sidoValue - }/0/1/SW` - - if(filterData !== '0') - filteredFclt= flcts.filter((fclt: string) => { - return filterData.length==2 ?fclt.slice(0, 2) === filterData:fclt.slice(0, 5) === filterData - }) + reurnValue.sigunValue !== "0" + ? reurnValue.sigunValue + : reurnValue.sidoValue + }/0/1/SW`; + + if (filterData !== "0") + filteredFclt = flcts.filter((fclt: string) => { + return filterData.length == 2 + ? fclt.slice(0, 2) === filterData + : fclt.slice(0, 5) === filterData; + }); } else if (reurnValue.partValue === "R") { - url += `${reurnValue.partValue}/${reurnValue.regionValue - ? reurnValue.regionValue - : reurnValue.unitWaterShedValue - ? reurnValue.unitWaterShedValue - : reurnValue.middleRegionValue - }/0/1/SW` - } else if (reurnValue.partValue === 'G') { - url += `${reurnValue.envPartValue}/${reurnValue.sigunValue !== '0' ? reurnValue.sigunValue : reurnValue.sidoValue}/0/1/SW` - if(filterData !== '0') - filteredFclt= flcts.filter((fclt: string) => { - return filterData.length==2 ?fclt.slice(0, 2) === filterData:fclt.slice(0, 5) === filterData - }) - + url += `${reurnValue.partValue}/${ + reurnValue.regionValue + ? reurnValue.regionValue + : reurnValue.unitWaterShedValue + ? reurnValue.unitWaterShedValue + : reurnValue.middleRegionValue + }/0/1/SW`; + } else if (reurnValue.partValue === "G") { + url += `${reurnValue.envPartValue}/${reurnValue.sigunValue !== "0" ? reurnValue.sigunValue : reurnValue.sidoValue}/0/1/SW`; + if (filterData !== "0") + filteredFclt = flcts.filter((fclt: string) => { + return filterData.length == 2 + ? fclt.slice(0, 2) === filterData + : fclt.slice(0, 5) === filterData; + }); } else { - url += `A/0/0/1/SW` + url += `A/0/0/1/SW`; } if (searchNm && searchNm?.length > 0) { - url += "/" + searchNm + url += "/" + searchNm; } - const pbnList = await postFectch( `/prcsFclt/ruseInfo/1/${filteredFclt.length}/`+url, filteredFclt, fetchType.COMMON); + const pbnList = await postFectch( + `/prcsFclt/ruseInfo/1/${filteredFclt.length}/` + url, + filteredFclt, + fetchType.COMMON + ); - - const checkRuseFcltList = searchNm && searchNm?.length > 0?pbnList.data.map((item)=> item.bscFctCd ):filteredFclt + const checkRuseFcltList = + searchNm && searchNm?.length > 0 + ? pbnList.data.map((item) => item.bscFctCd) + : filteredFclt; const getRuseList = await postFectch( `/reuseFc/pubDetailList/${year}/${filterData}/${page}/${total}`, checkRuseFcltList, @@ -147,9 +180,8 @@ export const hasuListFetch = async ( ); const checkWrRegListRes = getRuseList.data; - - const data: WaterReuseFacility[] = checkWrRegListRes.map( - (item: FcPrfType) => { + const data: WaterReuseFacility[] = checkWrRegListRes + .map((item: FcPrfType) => { const findData = pbnList.data.find( (fclt: pubHasuType) => fclt.bscFctCd === item.pbnstRuseFcltId.substring(0, 11) @@ -182,57 +214,54 @@ export const hasuListFetch = async ( { total: 0, inUsage: 0, outUsage: 0 } ); return { - rvbsn: findData?.rvbsn || '-', - lgbsn: findData?.lgbsn || '-', - mdmbsn: findData?.mdmbsn || '-', - rgnNm: findData?.rgnNm || '-', - sido: findData?.sido || '-', - gugun: findData?.gugun || '-', - bscFctNm: findData?.bscFctNm || '-', - efflWqltStndrdNm: findData?.efflWqltStndrdNm || '-', + rvbsn: findData?.rvbsn || "-", + lgbsn: findData?.lgbsn || "-", + mdmbsn: findData?.mdmbsn || "-", + rgnNm: findData?.rgnNm || "-", + sido: findData?.sido || "-", + gugun: findData?.gugun || "-", + bscFctNm: findData?.bscFctNm || "-", + efflWqltStndrdNm: findData?.efflWqltStndrdNm || "-", fctCpc: Number(findData?.fctCpc) || 0, tel: findData?.tel ?? "-", - ruseUtztnFcltNm: item?.ruseUtztnFcltNm || '-', - fcltCpct: item?.fcltCpct || '-', - splyExtraCpct: item?.splyExtraCpct || '-', - ruseCpct: item?.ruseCpct || '-', - pbnstRuseFcltId: item.pbnstRuseFcltId || '-', + ruseUtztnFcltNm: item?.ruseUtztnFcltNm || "-", + fcltCpct: item?.fcltCpct || "-", + splyExtraCpct: item?.splyExtraCpct || "-", + ruseCpct: item?.ruseCpct || "-", + pbnstRuseFcltId: item.pbnstRuseFcltId || "-", usageTotal: usage?.total, inUsage: usage?.inUsage, outUsage: usage?.outUsage, - operMthd: item.operList[0]?.operMthd || '-', + operMthd: item.operList[0]?.operMthd || "-", rprtvBzenty: item.operList[0]?.rprtvBzenty, bgngDt: moment(item.operList[0]?.bgngDt).format("YYYY-MM-DD") ?? "", endDt: moment(item.operList[0]?.endDt).format("YYYY-MM-DD") ?? "", - searchNm: findData?.bscFctNm || '-', - searchPk: findData?.bscFctCd || '-', - prfList: item?.prfList ?? [] + searchNm: findData?.bscFctNm || "-", + searchPk: findData?.bscFctCd || "-", + prfList: item?.prfList ?? [], }; } + }) + .filter(Boolean); - } - ).filter(Boolean); - - - - - return {data:data, count:getRuseList.count}; + return { data: data, count: getRuseList.count }; }; export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( set: any ) => { return { + //등록된 하수재이용시설을 조회한다. getFlcts: async () => { - const fclts = await getFetch(fetchType.WR, '/reuseFc/pubFc') - + const fclts = await getFetch(fetchType.WR, "/reuseFc/pubFc"); return set((state: pbnstSttnState) => ({ pbnstSttn: { ...state.pbnstSttn, - fclts: fclts + fclts: fclts, }, })); }, + //테이블 헤드를 조정한다. pbnstChSttnHead: async ( headList: z.infer ): Promise => { @@ -246,6 +275,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( }, })); }, + //하수처리시설을 조회하여 하수재이용시설을 확인한다. pbnstSttnSearch: async ( isExcel: boolean, page: string, @@ -256,14 +286,13 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( fclts: string[] ) => { try { - const pbnstSttnRes = await hasuListFetch( page, total, reurnValue, searchNm, year, - fclts, + fclts ); // if (Number(total) > 9000) { @@ -279,14 +308,13 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( }; }); } else { - set((state: pbnstSttnState) => { return { ...state, pbnstSttn: { ...state.pbnstSttn, pbnstSttnRes: pbnstSttnRes.data, - pbnstSttnResCount: pbnstSttnRes.count + pbnstSttnResCount: pbnstSttnRes.count, // isInit: false, }, }; @@ -296,6 +324,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( console.log("error", erTxt); } }, + //하수처리시설을 조회하여 하수재이용시설을 조회한다. pbnSttnInit: async ( page: string, total: string, @@ -313,7 +342,6 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( fclts ); - set((state: pbnstSttnState) => { return { ...state, @@ -322,7 +350,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( pbnstSttnRes: pbnstSttnRes.data, pbnstSttnResCount: pbnstSttnRes.count, isInit: false, - pbnstDetail: {} as customPbnst + pbnstDetail: {} as customPbnst, }, }; }); @@ -330,22 +358,29 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( console.log("error", erTxt); } }, + // 팝업에 있는 데이터를 초기화한다. resetPbnstDetail: async () => { set((state: pbnstSttnState) => { return { ...state, pbnstSttn: { ...state.pbnstSttn, - pbnstDetail: {} as customPbnst + pbnstDetail: {} as customPbnst, }, }; - }) + }); }, + //하수처리시설을 조회하여 하수재이용시설을 조회한다. getPbnStnDetail: async (pbnstRuseFcltId: string) => { try { - let pbnstDetail = await getFetch("wr", `/reuseFc/pubFc/${pbnstRuseFcltId}`); + let pbnstDetail = await getFetch( + "wr", + `/reuseFc/pubFc/${pbnstRuseFcltId}` + ); if (pbnstDetail.length >= 0) { - pbnstDetail = pbnstDetail.find((item: customPbnst) => item.pbnstRuseFcltId === pbnstRuseFcltId) + pbnstDetail = pbnstDetail.find( + (item: customPbnst) => item.pbnstRuseFcltId === pbnstRuseFcltId + ); } set((state: pbnstSttnState) => { return { @@ -360,6 +395,7 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( console.log(errorHasu); } }, + //하수재이용시설 실적 현황 에서 사용하는 조회 pbnNmSearch: async ( page: string, total: string, @@ -369,7 +405,6 @@ export const pbnstSttnActionsExport: (set: any) => pbnstSttnActions = ( flcts: string[] ) => { try { - const pbnstSttnRes = await hasuListFetch( page, total, diff --git a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx index 1ad310465..dcb0f0b65 100644 --- a/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx +++ b/apps/wr/components/ui/form/coMat/conCostForm/conCostForm.tsx @@ -26,6 +26,13 @@ import { Button, Checkbox, Input, Label } from "@common/components/ui"; import { useCallback, useEffect, useRef, useState } from "react"; import { type UseFormReturn } from "react-hook-form"; import toast from "react-hot-toast"; +/** + * ConCostForm + * 호출: (with-layout)/matMng/coMat/coMatRvw 에서 호출 + * + * 공사비를 산정하고 + * + * */ export default function ConCostForm({ form, diff --git a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx index 91a2c5379..3e9f444f6 100644 --- a/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx +++ b/apps/wr/components/ui/form/fcltReg/bdstReg/bdstReg.tsx @@ -13,19 +13,18 @@ import { Input } from "@common/components"; import { useEffect, useState } from "react"; export default function BdstReg({ form, type }: { form: any; type?: string }) { - const { code, returnCodeText } = useWrStore((state) => { + const { code, auth, returnCodeText } = useWrStore((state) => { return state; }); - const { userSiSggCd } = code; + const { laeSeCd } = auth; + const [useCityCd, setUserCityCd] = useState([]); const [useSggCd, setUserSggCd] = useState([]); useEffect(() => { - if (userSiSggCd.length === 2 && code.cityCd.length > 0) { - const city = code.cityCd.filter((item) => item.val === userSiSggCd); - const sgg = code.sggCd.filter( - (item) => item.val.slice(0, 2) === userSiSggCd - ); + if (laeSeCd.length === 2 && code.cityCd.length > 0) { + const city = code.cityCd.filter((item) => item.val === laeSeCd); + const sgg = code.sggCd.filter((item) => item.val.slice(0, 2) === laeSeCd); sgg.unshift({ text: "전체", val: "0" }); setUserCityCd(city); // Fix: Ensure city is of type SelectDataType[] setUserSggCd(sgg); @@ -40,20 +39,20 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { }); } } else if ( - userSiSggCd.length === 5 && + laeSeCd.length === 5 && code.cityCd.length > 0 && code.sggCd.length > 0 ) { const city = code.cityCd.filter( - (item) => item.val === userSiSggCd.slice(0, 2) + (item) => item.val === laeSeCd.slice(0, 2) ); - const sgg = code.sggCd.filter((item) => item.val === userSiSggCd); + const sgg = code.sggCd.filter((item) => item.val === laeSeCd); setUserSggCd(sgg); setUserCityCd(city); form.setValue("ctpvCd", Number(city[0]?.val)); form.setValue("sggCd", Number(sgg[0]?.val)); } - }, [form, userSiSggCd, code.cityCd, code.sggCd]); + }, [form, laeSeCd, code.cityCd, code.sggCd]); useEffect(() => { const subscription = form.form?.watch((value: any) => { @@ -63,10 +62,6 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { return () => subscription?.unsubscribe(); }, [form.form]); - // useEffect(() => { - // console.log("form ", form.watch()); - // }, [form.formState]); - useEffect(() => { const bdstInfoSn = form.getValues("bdstInfoSn"); if (bdstInfoSn && bdstInfoSn > 0) form.setValue("daddr", bdstInfoSn); @@ -238,7 +233,9 @@ export default function BdstReg({ form, type }: { form: any; type?: string }) { className={""} selectClass={selectClass} label={""} - selectArray={ type ==='RNB'?code.bdstUsgCd:code.rswtBdstType} + selectArray={ + type === "RNB" ? code.bdstUsgCd : code.rswtBdstType + } onSelectValue={(val) => { field.onChange(val); }} diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx index 33dd417af..e669a85f7 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/buseReg/bugRegForm.tsx @@ -43,6 +43,21 @@ import toast from "react-hot-toast"; import { useTranslation } from "react-i18next"; //import { useTranslation } from "react-i18next"; + + +/** + * 재이용시설 등록 - 하수재이용 시설등록 + * 재이용시설 등록 - 하수재이용 시설현황 + * - layout.tsx에 의해 공통 레이아웃이 적용됨 + * - with-layout 적용 + * - 하수처리시설에 하수재이용 시설 차수별 정보를 등록한다. + * - form으로 시설정보 및 차수별 정보의 컴포넌트 데이터를 관리한다 + * indexMng: 시설정보 + * indexBiz: 차수별 정보 + * 로 하수재이용 시설에 등록된 시설 및 차수별 정보를 관리한다. + * + * MngRegFormDetail 사업현황, 사업비, 재처리시설, 농축수관리, 폐수시설 정보 에 대한 데이터를 기입하도록 한다 + * */ export function PbnstBuseForm({ indexMng = 0, indexBiz = 0, diff --git a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx index 5b4d93d94..334f9567d 100644 --- a/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx +++ b/apps/wr/components/ui/form/fcltReg/pbnstReg/mngReg/mngRegForm.tsx @@ -35,6 +35,18 @@ export type FilesType = { file: File; }; + +/** + * 재이용시설 등록 - 하수재이용 시설등록 + * 재이용시설 등록 - 하수재이용 시설현황 + * - layout.tsx에 의해 공통 레이아웃이 적용됨 + * - with-layout 적용 + * - 하수처리시설에 하수재이용 시설 시설 정보를 등록한다. + * - form으로 시설정보 및 차수별 정보의 컴포넌트 데이터를 관리한다 + * indexMng: 시설정보 + * indexBiz: 차수별 정보 + * 로 하수재이용 시설에 등록된 시설 및 차수별 정보를 관리한다. + * */ export function PbnstMngForm({ form, formType, diff --git a/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx index a692553af..6947224e1 100644 --- a/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx +++ b/apps/wr/components/ui/modal/fcltReg/bdstRegModal/bdstRegModal.tsx @@ -43,11 +43,11 @@ export function BdstReg({ setIsModal, isModal, }: BdstRegProps) { - const { code, bdst, findBdst } = useWrStore((state) => { + const { code, bdst, auth, findBdst } = useWrStore((state) => { return state; }); - const { userSiSggCd } = code; + const { laeSeCd } = auth; const [bdstTable, setBdstTable] = useState(); const [bdstForm, setBdstForm] = useState( @@ -88,29 +88,32 @@ export function BdstReg({ }, [bdst]); useEffect(() => { - if (userSiSggCd.length === 2 && code.cityCd.length > 0) { - const city = code.cityCd.filter((item) => item.val === userSiSggCd); - const sgg = code.sggCd.filter( - (item) => item.val.slice(0, 2) === userSiSggCd - ); + if (laeSeCd.length === 2 && code.cityCd.length > 0) { + const city = code.cityCd.filter((item) => item.val === laeSeCd); + const sgg = code.sggCd.filter((item) => item.val.slice(0, 2) === laeSeCd); sgg.unshift({ text: "전체", val: "0" }); setUserCityCd(city); // Fix: Ensure city is of type SelectDataType[] setObjSearch({ ...objSearch, city: String(city[0]?.val) }); setUserSggCd(sgg); } else if ( - userSiSggCd.length === 5 && + laeSeCd.length === 5 && code.cityCd.length > 0 && code.sggCd.length > 0 ) { const city = code.cityCd.filter( - (item) => item.val === userSiSggCd.slice(0, 2) + (item) => item.val === laeSeCd.slice(0, 2) ); setUserCityCd(city); - const sgg = code.sggCd.filter((item) => item.val === userSiSggCd); + const sgg = code.sggCd.filter((item) => item.val === laeSeCd); setUserSggCd(sgg); setObjSearch({ city: String(city[0]?.val), sgg: String(sgg[0]?.val) }); + } else if ( + laeSeCd === "0" && + code.cityCd.length > 0 && + code.sggCd.length > 0 + ) { } - }, [userSiSggCd, code.cityCd, code.sggCd]); + }, [laeSeCd, code.cityCd, code.sggCd]); const tableClick: (val: number | undefined, headId: string) => void = ( val @@ -197,35 +200,35 @@ export function BdstReg({
-
- {moType === "RNB" ? ( - - ) : moType === "RST" ? ( - { - if (setIsModal && open) { - setIsModal(open); - } - }} - > - ) : ( - { - if (setIsModal && open) { - setIsModal(open); - } - }} - > - )} -
+
+ {moType === "RNB" ? ( + + ) : moType === "RST" ? ( + { + if (setIsModal && open) { + setIsModal(open); + } + }} + > + ) : ( + { + if (setIsModal && open) { + setIsModal(open); + } + }} + > + )} +
diff --git a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx index 0f919a603..fb243010e 100644 --- a/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx +++ b/apps/wr/components/ui/table/pbnstReg/ruseMngTableForm/ruseMngTableForm.tsx @@ -39,6 +39,21 @@ type RuseMngTableProps = { readonly?: boolean; }; + +/** + * 재이용시설 등록 - 하수재이용 시설등록 + * 재이용시설 등록 - 하수재이용 시설현황 + * - layout.tsx에 의해 공통 레이아웃이 적용됨 + * - with-layout 적용 + * - 하수처리시설에 하수재이용 시설 시설 정보를 등록한다. + * - form으로 시설정보 및 차수별 정보의 컴포넌트 데이터를 관리한다 + * indexMng: 시설정보 + * indexBiz: 차수별 정보 + * 로 하수재이용 시설에 등록된 시설 및 차수별 정보를 관리한다. + * + * 시설정보및 차수별정보의 테이블 데이터를 만들고 생성한다. + * */ + const RuseMngTableForm = React.forwardRef( ( {