[1237] 모듈 자동 선택 문제 #360
@ -23,7 +23,7 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
const autoSelectTimeoutRef = useRef(null)
|
const autoSelectTimeoutRef = useRef(null)
|
||||||
|
|
||||||
// 공통 타임아웃 설정 (밀리초)
|
// 공통 타임아웃 설정 (밀리초)
|
||||||
const AUTO_SELECT_TIMEOUT = 700 // API 호출 완료 대기 시간
|
const AUTO_SELECT_TIMEOUT = 500 // API 호출 완료 대기 시간
|
||||||
const {
|
const {
|
||||||
trestleState,
|
trestleState,
|
||||||
trestleDetail,
|
trestleDetail,
|
||||||
@ -66,7 +66,7 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
const [flag, setFlag] = useState(false)
|
const [flag, setFlag] = useState(false)
|
||||||
const tempModuleSelectionData = useRef(null)
|
const tempModuleSelectionData = useRef(null)
|
||||||
const [autoSelectStep, setAutoSelectStep] = useState(null) // 'raftBase', 'trestle', 'constMthd', 'roofBase', 'construction'
|
const [autoSelectStep, setAutoSelectStep] = useState(null) // 'raftBase', 'trestle', 'constMthd', 'roofBase', 'construction'
|
||||||
|
const prevHajebichiRef = useRef();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (roofs && roofs.length > 0 && !selectedRoof) {
|
if (roofs && roofs.length > 0 && !selectedRoof) {
|
||||||
@ -80,6 +80,15 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
if (selectedRoof && ["C", "R"].includes(selectedRoof.raftAuth) && roofs && roofs.length > 0) {
|
if (selectedRoof && ["C", "R"].includes(selectedRoof.raftAuth) && roofs && roofs.length > 0) {
|
||||||
onChangeRaftBase(roofs[0]);
|
onChangeRaftBase(roofs[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
selectedRoof && ["C", "R"].includes(selectedRoof.roofPchAuth) && roofs && roofs.length > 0 &&
|
||||||
|
roofs[0].hajebichi !== prevHajebichiRef.current
|
||||||
|
) {
|
||||||
|
prevHajebichiRef.current = roofs[0].hajebichi;
|
||||||
|
onChangeHajebichi(roofs[0].hajebichi);
|
||||||
|
}
|
||||||
|
|
||||||
//모듈 설치 영역 복구
|
//모듈 설치 영역 복구
|
||||||
restoreModuleInstArea()
|
restoreModuleInstArea()
|
||||||
}, [roofs, selectedRoof]) // selectedRoof 추가
|
}, [roofs, selectedRoof]) // selectedRoof 추가
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user