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, // 강우자료