[ST] - refactor: 2-5 맨홀 지표 변경된 테이블에 맞게 수정, 일반검증 항목 입력기간일 시 등록/수정 불가
This commit is contained in:
@@ -236,12 +236,13 @@ const SearchForm = (props: SearchFormProps = {}) => {
|
||||
const sggOptions = sggList?.data ?? [];
|
||||
const isDoSelected = isDoSido(selectedSido);
|
||||
const firstConcreteSggOption = firstConcreteSgg(sggOptions);
|
||||
// 도: 빈 값일 때만 첫 시군구로 보이게. ALL은 사용자가 고른 전체 유지
|
||||
const gugunSelectValue =
|
||||
isDoSelected && isAllGugunValue(values.gugun)
|
||||
isDoSelected && !values.gugun
|
||||
? (firstConcreteSggOption?.gugun ?? undefined)
|
||||
: values.gugun || undefined;
|
||||
|
||||
// 도: 전체(ALL/"")가 아니라 그 다음 시군구. 그 외: 전체
|
||||
// 도: 초기/시도 변경(빈 값)만 첫 시군구. 전체(ALL)는 유지. 그 외: 전체
|
||||
useEffect(() => {
|
||||
if (!mergedProps.gugun) return;
|
||||
if (props.defaultRegionAll) return;
|
||||
@@ -263,7 +264,7 @@ const SearchForm = (props: SearchFormProps = {}) => {
|
||||
if (!firstConcreteSggOption) return;
|
||||
|
||||
setValues((prev) => {
|
||||
if (!isAllGugunValue(prev.gugun)) return prev;
|
||||
if (prev.gugun) return prev;
|
||||
return {
|
||||
...prev,
|
||||
gugun: firstConcreteSggOption.gugun,
|
||||
|
||||
Reference in New Issue
Block a user