@@ -8,7 +8,9 @@ import axios from "axios";
import { type HttpResponse , Upload } from "tus-js-client" ;
import { AUTH_USER_ID , CLAIM_NAME , ENDPOINT , PROXY_HOST } from "@/shared/config" ;
import { getCookie , setCookie } from "@/shared/lib" ;
import { deleteAttachment } from "@/shared/lib/attach " ;
import { getCookie , setCookie , useAlertStore , useUserStore } from "@/shared/lib" ;
import type { AcntgSeMngTreeDto } from "@/entities/acntg" ;
import { acntgService } from "@/entities/acntg" ;
import type { CklstTreeNode } from "@/entities/cklst" ;
@@ -27,6 +29,7 @@ import {
type InstlSncnBzScaleSaveDto ,
type InstlSncnMng ,
} from "@/entities/instl-sncn" ;
import { Button , Input } from "@common/components" ;
import "./cnfm-page.css" ;
@@ -88,6 +91,9 @@ const ReadCell = ({ value }: { value: string | number }) => (
/* ------------------------------------------------------------------ */
function CnfmRegistPage() {
const router = useRouter ( ) ;
const userInfo = useUserStore ( ( state ) = > state . userInfo ) ;
const alert = useAlertStore ( ( state ) = > state . setMessage ) ;
const [ docSeComCd ] = useState ( "INSTL" ) ;
const [ taskSeComCdNm , setTaskSeComCdNm ] = useState ( "재이용수" ) ;
const [ taskSeComCd , setTaskSeComCd ] = useState ( "RE" ) ;
@@ -231,6 +237,28 @@ function CnfmRegistPage() {
upload . start ( ) ;
} ;
/** 기타첨부파일 삭제 핸들러: 백엔드에 DELETE 요청을 보내 소프트삭제 처리 후 상태 갱신 */
const handleDeleteEtcFile = async ( fileId : string , atflId : string ) = > {
try {
if ( atflId ) {
await deleteAttachment ( atflId ) ;
}
} catch ( error ) {
console . error ( "기타 첨부파일 삭제 실패" , error ) ;
alert ( "파일 삭제 중 오류가 발생했습니다." ) ;
return ;
}
setEtcFiles ( ( prev ) = > {
const next = prev . filter ( ( x ) = > x . id !== fileId ) ;
if ( next . length === 0 ) {
setEtcFileGroupId ( "" ) ;
etcFileGroupIdRef . current = "" ;
}
return next ;
} ) ;
} ;
const handleRequiredFileChange = ( key : RequiredAttachKey , e : React.ChangeEvent < HTMLInputElement > ) = > {
const file = e . target . files ? . [ 0 ] ;
if ( ! file ) return ;
@@ -281,7 +309,7 @@ function CnfmRegistPage() {
name : file.name ,
ext ,
size : toFileSizeText ( file . size ) ,
uploader : "(로그인 사용자) ",
uploader : userInfo?.userName ? ? "알 수 없음 ",
atflCd : uploadedAtflCd ,
atflId : uploadedAtflId ,
} ) ;
@@ -742,10 +770,10 @@ function CnfmRegistPage() {
< table className = "cnfm-form-table" >
< tbody >
< tr >
< th >
< th style = { { textAlign : "center" } } >
< span className = "text-red-500" > * < / span > 사 업 명
< / th >
< td colSpan = { 3 } >
< td >
< div className = "flex gap-2" >
< Input
placeholder = "사업명을 입력하거나 사업찾기를 이용하세요"
@@ -756,12 +784,10 @@ function CnfmRegistPage() {
< button className = "cnfm-btn-search whitespace-nowrap" > 🔍 사 업 찾 기 < / button >
< / div >
< / td >
< / tr >
< tr >
< th >
< th style = { { textAlign : "center" } } >
< span className = "text-red-500" > * < / span > 사 업 기 간
< / th >
< td colSpan = { 3 } >
< td >
< div className = "flex items-center gap-2" >
< Input
placeholder = "시작연도(YYYY)"
@@ -780,7 +806,7 @@ function CnfmRegistPage() {
< / td >
< / tr >
< tr >
< th >
< th style = { { textAlign : "center" } } >
< span className = "text-red-500" > * < / span > 사 업 내 용
< / th >
< td colSpan = { 3 } >
@@ -793,19 +819,21 @@ function CnfmRegistPage() {
< / td >
< / tr >
< tr >
< th > 구 분 < / th >
< th style = { { textAlign : "center" } } > 구 분 < / th >
< td >
< div className = "flex gap-4 text-[1.3rem]" > { taskSeComCdNm } < / div >
< input type = "hidden" name = "taskSeComCd" value = { taskSeComCd } / >
< / td >
< th > 신 청 지 자 체 < / th >
< th style = { { textAlign : "center" } } > 신 청 지 자 체 < / th >
< td >
< span className = "text-[1.3rem] text-gray-500" > ( 로 그 인 정 보 자 동 세 팅 ) < / span >
< span className = "inline-block min-w-[16rem] whitespace-nowrap text-[1.3rem] text-gray-500" >
{ userInfo ? . enoNm ? ? "\u00A0" }
< / span >
< / td >
< / tr >
< tr >
< th > 사 업 구 분 < / th >
< td >
< th style = { { textAlign : "center" } } > < span className = "text-red-500" > * < / span > 사 업 구 분 < / th >
< td colSpan = { 3 } >
< div className = "flex gap-4 text-[1.3rem]" >
{ [
[ "CNFM" , "설치인가" ] ,
@@ -836,27 +864,31 @@ function CnfmRegistPage() {
< table className = "cnfm-form-table" >
< tbody >
< tr >
< th > 신 청 자 이 름 < / th >
< th rowSpan = { 2 } style = { { textAlign : "center" } } className = "text-center align-middle w-[6.5rem]" > 신 청 자 < / th >
< th style = { { textAlign : "center" } } > 이 름 < / th >
< td >
< span className = "text-[1.3rem] text-gray-500" > ( 로 그 인 사 용 자 자 동 세 팅 ) < / span >
< span className = "inline-block min-w-[16rem] whitespace-nowrap text-[1.3rem] text-gray-500" > { userInfo ? . userName ? ? "\u00A0" } < / span >
< / td >
< th > 전 화 번 호 < / th >
< th style = { { textAlign : "center" } } > 전 화 번 호 < / th >
< td >
< span className = "text-[1.3rem] text-gray-500" > ( 로 그 인 사 용 자 자 동 세 팅 ) < / span >
< span className = "inline-block min-w-[16rem] whitespace-nowrap text-[1.3rem] text-gray-500" > { userInfo ? . mphn ? ? userInfo ? . telno ? ? "\u00A0" } < / span >
< / td >
< / tr >
< tr >
< th > 부 서 < / th >
< th style = { { textAlign : "center" } } > 부 서 < / th >
< td >
< span className = "text-[1.3rem] text-gray-500" > ( 로 그 인 사 용 자 자 동 세 팅 ) < / span >
< span className = "text-[1.3rem] text-gray-500" > { userInfo ? . instSeNm ? ? "\u00A0" } < / span >
< / td >
< th > 이 메 일 < / th >
< th style = { { textAlign : "center" } } > 이 메 일 < / th >
< td >
< span className = "text-[1.3rem] text-gray-500" > ( 로 그 인 사 용 자 자 동 세 팅 ) < / span >
< span className = "text-[1.3rem] text-gray-500" > { userInfo ? . email ? ? "\u00A0" } < / span >
< / td >
< / tr >
< tr >
< th > 설 계 자 이 름 < / th >
< th rowSpan = { 2 } style = { { textAlign : "center" } } > 설 계 자 < / th >
< th style = { { textAlign : "center" } } > 이 름 < / th >
< td >
< Input
placeholder = "설계자 성명"
@@ -865,7 +897,7 @@ function CnfmRegistPage() {
onChange = { ( e ) = > setDsgnrNm ( e . target . value ) }
/ >
< / td >
< th > 전 화 번 호 < / th >
< th style = { { textAlign : "center" } } > 전 화 번 호 < / th >
< td >
< Input
placeholder = "설계자 전화번호"
@@ -876,16 +908,17 @@ function CnfmRegistPage() {
< / td >
< / tr >
< tr >
< th > 소 속 ( 용 역 사 ) < / th >
< th style = { { textAlign : "center" } } > 소 속 < / th >
< td >
< Input
placeholder = "용역사 명"
placeholder = "소속 명"
className = "!text-[1.3rem]"
value = { dsgnrPsitn }
onChange = { ( e ) = > setDsgnrPsitn ( e . target . value ) }
/ >
< / td >
< th > 이 메 일 < / th >
< th style = { { textAlign : "center" } } > 이 메 일 < / th >
< td >
< Input
placeholder = "설계자 이메일"
@@ -902,19 +935,37 @@ function CnfmRegistPage() {
{ /* ── 개인정보 동의 ── */ }
< div className = "cnfm-card p-4" >
< h3 className = "mb-3 border-b pb-2 text-[1.5rem] font-bold text-gray-700" > 개 인 정 보 동 의 < / h3 >
< div className = "mb-3 rounded border bg-gray-50 p-3 text-[1.25rem] leading-relaxed text-gray-600" >
< p className = "mb-1 font-semibold" > [ 개 인 정 보 수 집 · 이 용 목 적 ] < / p >
< ul className = "ml-4 list-disc space-y-1" >
< li > 수집 항목 : 소속기관 , 성 명 , 전 화 번 호 , 이 메 일 , IP Address , 접 속 기 기 정 보 < / li >
< li > 수집목적 : 하수도 시 설 물 설 치 인 가 신 청 및 처 리 목 적 < / li >
< li > 보유기간 : 관련 법 령 에 따 른 의 무 보 유 기 간 준 수 < / li >
< / ul >
< p className = "mt-2 text-[1.2rem] text-gray-500" >
※ 개 인 정 보 제 공 에 동 의 하 지 않 을 수 있 으 나 , 미 동 의 시 서 비 스 이 용 이 제 한 될 수 있 습 니 다 .
< / p >
< div className = "mb-3 rounded border bg-gray-50 p-3 text-[1.25rem] leading-relaxed text-gray-600 max-h-80 overflow-auto whitespace-pre-wrap pr-2 " >
< p className = "mb-1 font-semibold" > [ 개 인 정 보 수 집 항 목 ] < / p >
< div >
* 필수 항목 : 소속기관 , 소 속 부 서 , 담 당 자 , 직 급 , 사 무 실 번 호 , FAX 번 호 < br / >
․ 선택항목 : 휴대폰 번 호 , 이 메 일 주 소 < br / >
․ 기타항목 : IP Address , 쿠 키 , 시 스 템 접 속 및 이 용 기 록 < br / >
※ 시 스 템 이 용 과 정 에 서 기 타 항 목 의 정 보 들 이 자 동 으 로 생 성 되 어 수 집 될 수 있 습 니 다 .
< / div >
< p className = "mt-4 font-semibold" > [ 개 인 정 보 이 용 목 적 ] < / p >
< div >
․ 국 가 하 수 도 정 보 시 스 템 웹 서 비 스 이 용 에 따 른 본 인 확 인 절 차 에 이 용 < br / >
․ 국 가 하 수 도 정 보 시 스 템 사 용 에 필 요 한 권 한 부 여 < br / >
․ 사 용 자 별 맞 춤 컨 텐 츠 ( 처 리 시 설 의 운 영 데 이 터 조 회 , 수 질 현 황 데 이 터 조 회 , 예 산 편 성 / 예 산 편 성 등 ) 제 공 에 이 용
< / div >
< div className = "tit mt-4" > ● 개 인 정 보 의 보 유 및 이 용 기 간 < / div >
< div >
․ 수 집 된 고 객 의 개 인 정 보 는 2 년 동 안 보 유 하 며 그 이 후 에 는 문 서 를 파 쇄 합 니 다 . < br / >
․ 정 보 제 공 자 가 개 인 정 보 파 쇄 를 요 청 할 경 우 즉 시 파 쇄 합 니 다 .
< / div >
< br / >
< div className = "tit" > ● 개 인 정 보 제 공 거 부 에 따 른 제 한 사 항 < / div >
< div >
․ 귀 하 는 개 인 정 보 제 공 동 의 를 거 부 할 권 리 가 있 으 나 , 동 의 거 부 시 국 가 하 수 도 정 보 시 스 템 이 용 서 비 스 에 제 한 이 있 을 수 있 습 니 다 .
< / div >
< / div >
< div className = "flex gap-6 text-[1.3rem]" >
< label className = "flex cursor-pointer items-center gap-2 font-semibold text-blue-600 " >
< label className = "flex cursor-pointer items-center gap-2 font-semibold" >
< input
type = "radio"
name = "privacyAgree"
@@ -1351,16 +1402,7 @@ function CnfmRegistPage() {
< button
type = "button"
className = "text-[1.2rem] text-red-500 hover:text-red-700"
onClick = { ( ) = >
setEtcFiles ( ( prev ) = > {
const next = prev . filter ( ( x ) = > x . id !== f . id ) ;
if ( next . length === 0 ) {
setEtcFileGroupId ( "" ) ;
etcFileGroupIdRef . current = "" ;
}
return next ;
} )
}
onClick = { ( ) = > void handleDeleteEtcFile ( f . id , f . atflId ) }
>
✕
< / button >