Compare commits
No commits in common. "a9791eac625cf8b4d3fe9b868cd57cfcdf09cd2d" and "f29d3aa1479f2ba951dc70f1a3628b8ab5613ea6" have entirely different histories.
a9791eac62
...
f29d3aa147
@ -7,7 +7,6 @@ import { currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
|||||||
import { roofsState } from '@/store/roofAtom'
|
import { roofsState } from '@/store/roofAtom'
|
||||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react'
|
import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react'
|
||||||
import { logger } from '@/util/logger'
|
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import Swal from 'sweetalert2'
|
import Swal from 'sweetalert2'
|
||||||
import { normalizeDigits } from '@/util/input-utils'
|
import { normalizeDigits } from '@/util/input-utils'
|
||||||
@ -176,19 +175,6 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
const existingConstruction = constructionList.find((construction) => construction.constTp === trestleState.constTp)
|
const existingConstruction = constructionList.find((construction) => construction.constTp === trestleState.constTp)
|
||||||
if (existingConstruction) {
|
if (existingConstruction) {
|
||||||
setSelectedConstruction(existingConstruction)
|
setSelectedConstruction(existingConstruction)
|
||||||
// 설치 불가능한 공법이면 강제 해제
|
|
||||||
if (existingConstruction.cvrYn !== 'Y') setCvrChecked(false)
|
|
||||||
if (existingConstruction.snowGdPossYn !== 'Y') setSnowGdChecked(false)
|
|
||||||
const resolvedCvrChecked = existingConstruction.cvrYn === 'Y' ? cvrChecked : false
|
|
||||||
const resolvedSnowGdChecked = existingConstruction.snowGdPossYn === 'Y' ? snowGdChecked : false
|
|
||||||
logger.debug('[Trestle handleConstruction] 복원', {
|
|
||||||
index: constructionList.findIndex((c) => c.constTp === existingConstruction.constTp),
|
|
||||||
constNm: existingConstruction.constNm ?? existingConstruction.constTp,
|
|
||||||
'cvrYn (설치가능여부)': existingConstruction.cvrYn,
|
|
||||||
'cvrChecked (사용자선택)': resolvedCvrChecked,
|
|
||||||
'snowGdPossYn (설치가능여부)': existingConstruction.snowGdPossYn,
|
|
||||||
'snowGdChecked (사용자선택)': resolvedSnowGdChecked,
|
|
||||||
})
|
|
||||||
} else if (autoSelectStep === 'construction') {
|
} else if (autoSelectStep === 'construction') {
|
||||||
// 자동 선택: 첫 번째 가능한 construction 선택
|
// 자동 선택: 첫 번째 가능한 construction 선택
|
||||||
const availableConstructions = constructionList.filter((construction) => construction.constPossYn === 'Y')
|
const availableConstructions = constructionList.filter((construction) => construction.constPossYn === 'Y')
|
||||||
@ -425,24 +411,10 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const newCvrYn = constructionList[index].cvrYn
|
setCvrYn(constructionList[index].cvrYn)
|
||||||
const newCvrChecked = newCvrYn === 'Y'
|
setSnowGdPossYn(constructionList[index].snowGdPossYn)
|
||||||
const newSnowGdPossYn = constructionList[index].snowGdPossYn
|
setCvrChecked(true)
|
||||||
const newSnowGdChecked = newSnowGdPossYn === 'Y'
|
setSnowGdChecked(false)
|
||||||
|
|
||||||
setCvrYn(newCvrYn)
|
|
||||||
setSnowGdPossYn(newSnowGdPossYn)
|
|
||||||
setCvrChecked(newCvrChecked)
|
|
||||||
setSnowGdChecked(newSnowGdChecked)
|
|
||||||
|
|
||||||
logger.debug('[Trestle handleConstruction]', {
|
|
||||||
index,
|
|
||||||
constNm: constructionList[index].constNm,
|
|
||||||
'cvrYn (설치가능여부)': newCvrYn,
|
|
||||||
'cvrChecked (사용자선택)': newCvrChecked,
|
|
||||||
'snowGdPossYn (설치가능여부)': newSnowGdPossYn,
|
|
||||||
'snowGdChecked (사용자선택)': newSnowGdChecked,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,10 +442,10 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
...constructionList.find((data) => data.constTp === trestleState.constTp),
|
...constructionList.find((data) => data.constTp === trestleState.constTp),
|
||||||
cvrYn: cvrYn,
|
cvrYn: cvrYn,
|
||||||
snowGdPossYn: snowGdPossYn,
|
snowGdPossYn: snowGdPossYn,
|
||||||
cvrChecked: cvrYn === 'Y' ? cvrChecked : false,
|
cvrChecked: cvrChecked,
|
||||||
snowGdChecked: snowGdPossYn === 'Y' ? snowGdChecked : false,
|
snowGdChecked: snowGdChecked,
|
||||||
setupCover: cvrYn === 'Y' ? (cvrChecked ?? false) : false,
|
setupCover: cvrChecked ?? false,
|
||||||
setupSnowCover: snowGdPossYn === 'Y' ? (snowGdChecked ?? false) : false,
|
setupSnowCover: snowGdChecked ?? false,
|
||||||
},
|
},
|
||||||
trestleDetail: trestleDetail,
|
trestleDetail: trestleDetail,
|
||||||
}
|
}
|
||||||
@ -509,10 +481,10 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
...constructionList.find((data) => trestleState.constTp === data.constTp),
|
...constructionList.find((data) => trestleState.constTp === data.constTp),
|
||||||
cvrYn,
|
cvrYn,
|
||||||
snowGdPossYn,
|
snowGdPossYn,
|
||||||
cvrChecked: cvrYn === 'Y' ? cvrChecked : false,
|
cvrChecked,
|
||||||
snowGdChecked: snowGdPossYn === 'Y' ? snowGdChecked : false,
|
snowGdChecked,
|
||||||
setupCover: cvrYn === 'Y' ? (cvrChecked ?? false) : false,
|
setupCover: cvrChecked ?? false,
|
||||||
setupSnowCover: snowGdPossYn === 'Y' ? (snowGdChecked ?? false) : false,
|
setupSnowCover: snowGdChecked ?? false,
|
||||||
},
|
},
|
||||||
trestleDetail: trestleDetail,
|
trestleDetail: trestleDetail,
|
||||||
}
|
}
|
||||||
@ -889,11 +861,7 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
disabled={!cvrYn || cvrYn === 'N'}
|
disabled={!cvrYn || cvrYn === 'N'}
|
||||||
checked={!cvrYn || cvrYn === 'N' ? false : cvrChecked ?? true}
|
checked={!cvrYn || cvrYn === 'N' ? false : cvrChecked ?? true}
|
||||||
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, cvrChecked: !trestleState.cvrChecked } })}
|
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, cvrChecked: !trestleState.cvrChecked } })}
|
||||||
onChange={() => {
|
onChange={() => setCvrChecked(!cvrChecked)}
|
||||||
const next = !cvrChecked
|
|
||||||
setCvrChecked(next)
|
|
||||||
logger.debug('[처마커버 체크 변경]', { 'cvrYn (설치가능여부)': cvrYn, 'cvrChecked (사용자선택)': next })
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`ch01`}>{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
<label htmlFor={`ch01`}>{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -904,11 +872,7 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
disabled={!snowGdPossYn || snowGdPossYn === 'N'}
|
disabled={!snowGdPossYn || snowGdPossYn === 'N'}
|
||||||
checked={snowGdChecked || false}
|
checked={snowGdChecked || false}
|
||||||
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, snowGdChecked: !trestleState.snowGdChecked } })}
|
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, snowGdChecked: !trestleState.snowGdChecked } })}
|
||||||
onChange={() => {
|
onChange={() => setSnowGdChecked(!snowGdChecked)}
|
||||||
const next = !snowGdChecked
|
|
||||||
setSnowGdChecked(next)
|
|
||||||
logger.debug('[눈막이 체크 변경]', { 'snowGdPossYn (설치가능여부)': snowGdPossYn, 'snowGdChecked (사용자선택)': next })
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`ch02`}>{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
<label htmlFor={`ch02`}>{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import { useMasterController } from '@/hooks/common/useMasterController'
|
|||||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||||
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { isObjectNotEmpty, isEqualObjects } from '@/util/common-utils'
|
import { isObjectNotEmpty, isEqualObjects } from '@/util/common-utils'
|
||||||
import { logger } from '@/util/logger'
|
|
||||||
|
|
||||||
export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
||||||
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
||||||
@ -286,58 +285,17 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
|||||||
selectedConstruction.setupSnowCover = false //눈막이금구 설치 여부
|
selectedConstruction.setupSnowCover = false //눈막이금구 설치 여부
|
||||||
selectedConstruction.selectedIndex = index
|
selectedConstruction.selectedIndex = index
|
||||||
|
|
||||||
logger.debug('[handleConstruction] 공법 선택', {
|
|
||||||
index,
|
|
||||||
constNm: selectedConstruction.constNm,
|
|
||||||
cvrYn: selectedConstruction.cvrYn,
|
|
||||||
snowGdPossYn: selectedConstruction.snowGdPossYn,
|
|
||||||
moduleConstructionSelectionData,
|
|
||||||
})
|
|
||||||
|
|
||||||
setCvrYn(selectedConstruction.cvrYn)
|
setCvrYn(selectedConstruction.cvrYn)
|
||||||
setSnowGdPossYn(selectedConstruction.snowGdPossYn)
|
setSnowGdPossYn(selectedConstruction.snowGdPossYn)
|
||||||
|
|
||||||
//기존에 선택된 데이터가 있으면 복원
|
//기존에 선택된 데이터가 있으면 체크한다
|
||||||
if (moduleConstructionSelectionData && moduleConstructionSelectionData.construction) {
|
if (moduleConstructionSelectionData && moduleConstructionSelectionData.construction) {
|
||||||
selectedConstruction.setupCover = moduleConstructionSelectionData.construction.setupCover || false
|
selectedConstruction.setupCover = moduleConstructionSelectionData.construction.setupCover || false
|
||||||
selectedConstruction.setupSnowCover = moduleConstructionSelectionData.construction.setupSnowCover || false
|
selectedConstruction.setupSnowCover = moduleConstructionSelectionData.construction.setupSnowCover || false
|
||||||
setCvrChecked(selectedConstruction.setupCover)
|
setCvrChecked(selectedConstruction.setupCover)
|
||||||
setSnowGdChecked(selectedConstruction.setupSnowCover)
|
setSnowGdChecked(selectedConstruction.setupSnowCover)
|
||||||
logger.debug('[handleConstruction] 기존 데이터 복원', {
|
|
||||||
setupCover: selectedConstruction.setupCover,
|
|
||||||
setupSnowCover: selectedConstruction.setupSnowCover,
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// 최초 선택: 설치 가능하면 디폴트 체크
|
|
||||||
const defaultCvr = selectedConstruction.cvrYn === 'Y'
|
|
||||||
const defaultSnowGd = selectedConstruction.snowGdPossYn === 'Y'
|
|
||||||
selectedConstruction.setupCover = defaultCvr
|
|
||||||
selectedConstruction.setupSnowCover = defaultSnowGd
|
|
||||||
setCvrChecked(defaultCvr)
|
|
||||||
setSnowGdChecked(defaultSnowGd)
|
|
||||||
logger.debug('[handleConstruction] 최초 선택 디폴트', {
|
|
||||||
defaultCvr,
|
|
||||||
defaultSnowGd,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 설치 불가능한 공법이면 강제 해제
|
|
||||||
if (selectedConstruction.cvrYn !== 'Y') {
|
|
||||||
selectedConstruction.setupCover = false
|
|
||||||
setCvrChecked(false)
|
|
||||||
logger.debug('[handleConstruction] 처마커버 강제 해제 (cvrYn !== Y)')
|
|
||||||
}
|
|
||||||
if (selectedConstruction.snowGdPossYn !== 'Y') {
|
|
||||||
selectedConstruction.setupSnowCover = false
|
|
||||||
setSnowGdChecked(false)
|
|
||||||
logger.debug('[handleConstruction] 눈막이 강제 해제 (snowGdPossYn !== Y)')
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.debug('[handleConstruction] 최종 상태', {
|
|
||||||
setupCover: selectedConstruction.setupCover,
|
|
||||||
setupSnowCover: selectedConstruction.setupSnowCover,
|
|
||||||
})
|
|
||||||
|
|
||||||
setSelectedConstruction(selectedConstruction)
|
setSelectedConstruction(selectedConstruction)
|
||||||
} else {
|
} else {
|
||||||
constructionRef.current.forEach((ref) => {
|
constructionRef.current.forEach((ref) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user