From 20b45a02edc48d8551b5c601ae86430ba6a79182 Mon Sep 17 00:00:00 2001 From: swcho Date: Wed, 16 Jul 2025 19:49:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20-=20=EC=B9=A8=EC=9E=85=EC=88=98=20?= =?UTF-8?q?=EB=B6=84=EC=84=9D,=20RDII=20=EB=B6=84=EC=84=9D=20=EB=B6=84?= =?UTF-8?q?=EC=84=9D=EC=9E=90=20=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?-=20SearchModal=20=ED=95=98=EC=88=98=EB=A7=A8=ED=99=80=20?= =?UTF-8?q?=EC=9A=A9=EB=8F=84=EB=A1=9C=20=EC=A1=B0=ED=9A=8C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80=20-=20SearchModal=20=ED=95=98?= =?UTF-8?q?=EC=88=98=EA=B4=80=EB=A1=9C=20=EC=A1=B0=ED=9A=8C=20=EB=90=98?= =?UTF-8?q?=EA=B2=8C=EB=81=94=20=EC=88=98=EC=A0=95=20-=20table.ts=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=AF=B8=EB=B6=84=EB=A5=98=20=EC=A4=91=EB=B3=B5?= =?UTF-8?q?=EA=B0=92=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/sn/app/(map-layout)/map/SearchModal.tsx | 30 ++++++++----------- .../map/components/common/table.ts | 3 -- .../(with-base-layout)/ii/irsetting/page.tsx | 29 ++++++++++++------ .../app/(with-base-layout)/ii/rdii/page.tsx | 10 +++++++ 4 files changed, 43 insertions(+), 29 deletions(-) diff --git a/apps/sn/app/(map-layout)/map/SearchModal.tsx b/apps/sn/app/(map-layout)/map/SearchModal.tsx index 8045030d4..3b0ae20bc 100644 --- a/apps/sn/app/(map-layout)/map/SearchModal.tsx +++ b/apps/sn/app/(map-layout)/map/SearchModal.tsx @@ -12,7 +12,7 @@ import LoadingOverlay from '@/components/ui/LoadingBar'; //import { useDcTree, flattenFolders, useSggCd, useCityCd } from './components/searchModalReportApi'; import { useDcTree, flattenFolders, useSggCd, useCityCd, addFileName, getFileDownload } from './components/searchModalReportApi'; import { useCityCdStore, type SelectDataType } from './commonStore'; -import { MS_SWAGE_PPL_USE_CODES, MS_SWAGE_PPL_CODES } from '../map/components/common/table'; +import { MS_SWAGE_PPL_USE_CODES, MS_SWAGE_PPL_CODES, MS_SWAGE_MHL_USE_CODES } from '../map/components/common/table'; const API_URL = `${process.env.NEXT_PUBLIC_SEWERAGE_API_URL}`; @@ -417,8 +417,7 @@ const SearchModal: React.FC = ({ cqlFilters.push( `instl_ymd >= '${startDate}' and instl_ymd <= '${endDate}'`, ); - // if (변수1) cqlFilters.push(`경과년도='${변수1}'`); - if (변수2) cqlFilters.push(`usg_cd='${변수2}'`); + if (변수1) cqlFilters.push(`usg_cd='${변수1}'`); // 구경(mm) 범위 if (시작1 && 종료1) cqlFilters.push(`swage_mh_diam BETWEEN ${시작1} AND ${종료1}`); else if (시작1) cqlFilters.push(`swage_mh_diam >= ${시작1}`); @@ -699,7 +698,7 @@ const SearchModal: React.FC = ({ /> {/* 시설용량 */} = ({ setYearFilter({ ...yearFilter, 경과년도: val }); }} /> */} - {/* 용도코드 */} - - { - // 숫자만 입력 허용 - const val = e.target.value.replace(/[^0-9]/g, ""); - set변수1(val); + onSelectValue={(val) => { + set변수1(String(val)); }} /> {/* 하수맨홀 구경 */} @@ -875,7 +871,7 @@ const SearchModal: React.FC = ({ /> */} {/* 일일처리용량 - 오수맨홀 */} = ({ /> {/* 양수능력 - 우수맨홀 */} { + const [input1, setInput1] = useState(''); + const [input2, setInput2] = useState(''); + const [select1, setSelect1] = useState('0'); // 환경청코드 + const [select2, setSelect2] = useState('0'); // 시도코드 + const [select3, setSelect3] = useState({ val: '0', text: '전체' }); // 시군구 상태를 객체로 변경 + const [select4, setSelect4] = useState('0'); // 하수처리장코드 + const [select5, setSelect5] = useState('0'); // 하수처리구역코드 + const [formResetKey, setFormResetKey] = useState(0); // FileUploadForm 리셋을 위한 key 상태 + const [isLoadingResult, setIsLoadingResult] = useState(false); // 로딩 상태 + + const { data: userInfo } = useQuery({ + queryKey: [ENDPOINT.USER_SERVICE.USERS], + queryFn: () => getUserInfo(), + enabled: true, + }); + const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { @@ -71,15 +90,6 @@ const IrSetting = () => { const month = String(now.getMonth() + 1).padStart(2, '0'); return `${year}${month}`; }); - const [input1, setInput1] = useState(''); - const [input2, setInput2] = useState(''); - const [select1, setSelect1] = useState('0'); // 환경청코드 - const [select2, setSelect2] = useState('0'); // 시도코드 - const [select3, setSelect3] = useState({ val: '0', text: '전체' }); // 시군구 상태를 객체로 변경 - const [select4, setSelect4] = useState('0'); // 하수처리장코드 - const [select5, setSelect5] = useState('0'); // 하수처리구역코드 - const [formResetKey, setFormResetKey] = useState(0); // FileUploadForm 리셋을 위한 key 상태 - const [isLoadingResult, setIsLoadingResult] = useState(false); // 로딩 상태 // 폼 초기화 함수 const resetAllForms = () => { @@ -302,6 +312,7 @@ const IrSetting = () => { drtwSwtcRt: parseFloat(input1) || null, // 오수전환율 (숫자로 변환) anlsInfo: input2, // 분석정보 rgtr: tokenManager.getToken(AUTH_USER_ID) || null, // 등록자 (사용자 ID) + rgtrNm: userInfo?.userName, // 등록자 (사용자 ID) atflCd: file1?.atflCd, // 첨부파일CD (오수관망도) atflId: file1?.atflId, // 첨부파일ID (오수관망도) atflInpNm: file1?.file?.name, // 오수관망도 파일명 diff --git a/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx b/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx index adb5334da..08aa84e34 100644 --- a/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx +++ b/apps/sn/app/(with-base-layout)/ii/rdii/page.tsx @@ -17,6 +17,9 @@ import { validateMultipleFiles, FILE_EXTENSIONS, type FileValidationConfig } fro import { validateBasicSelectionsWithAlert } from '../../selectionValidation'; import { tokenManager } from '@/entities/auth/lib/token-manager'; import { AUTH_USER_ID } from "@/shared/config"; +import { useQuery } from "@tanstack/react-query"; +import { ENDPOINT } from "@common/components/config"; +import { getUserInfo } from "@common/components/api"; // zod 스키마 정의 @@ -117,6 +120,12 @@ export default function RTKForm() { const [select4, setSelect4] = useState('0'); // 하수처리장 (swageTmplntCd) const [select5, setSelect5] = useState('0'); // 하수처리구역 (swtrmtZoneCd) + const { data: userInfo } = useQuery({ + queryKey: [ENDPOINT.USER_SERVICE.USERS], + queryFn: () => getUserInfo(), + enabled: true, + }); + // form 인스턴스 생성 const form = useForm({ resolver: zodResolver(formSchema), @@ -331,6 +340,7 @@ export default function RTKForm() { drtwSwtcRt: parseFloat(formData.rate || "0"), // 오수전환율 anlsInfo: formData.analysisInfo, // 분석정보 rgtr: tokenManager.getToken(AUTH_USER_ID) || null, // 등록자 (사용자 ID) + rgtrNm: userInfo?.userName, // 등록자 (사용자 ID) tbSnRcptrMhlMpng: matchingResultData, // 수용가-맨홀 매칭결과 tbSnRainData: rainData, // 강우자료