모듈 선택 공법 선택 화면 작업중
This commit is contained in:
parent
b3568a9bcc
commit
adc0edbab3
@ -9,6 +9,7 @@ import ModuleTabContents from './ModuleTabContents'
|
||||
import { useDebounceValue } from 'usehooks-ts'
|
||||
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
|
||||
export default function Module({ setTabNum }) {
|
||||
const { getMessage } = useMessage()
|
||||
@ -56,7 +57,14 @@ export default function Module({ setTabNum }) {
|
||||
useEffect(() => {
|
||||
if (tempModuleSelectionData) {
|
||||
setModuleSelectionData(tempModuleSelectionData)
|
||||
// moduleSelectedDataTrigger(tempModuleSelectionData)
|
||||
|
||||
if (
|
||||
tempModuleSelectionData.common.moduleItemId &&
|
||||
isObjectNotEmpty(tempModuleSelectionData.module) &&
|
||||
tempModuleSelectionData.roofConstructions.length > 0
|
||||
) {
|
||||
moduleSelectedDataTrigger(tempModuleSelectionData)
|
||||
}
|
||||
}
|
||||
}, [tempModuleSelectionData])
|
||||
|
||||
@ -89,7 +97,7 @@ export default function Module({ setTabNum }) {
|
||||
setRoofTab(tab)
|
||||
}
|
||||
|
||||
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
||||
const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@ -90,7 +90,9 @@ export default function ModuleTabContents({ addRoof, setAddedRoofs, roofTab, tem
|
||||
}, [hajebichi])
|
||||
|
||||
useEffect(() => {
|
||||
setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab])
|
||||
if (moduleSelectionData.roofConstructions.length > 0) {
|
||||
setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab])
|
||||
}
|
||||
}, [moduleSelectionData])
|
||||
|
||||
//서까래간격 변경
|
||||
@ -261,11 +263,13 @@ export default function ModuleTabContents({ addRoof, setAddedRoofs, roofTab, tem
|
||||
}, [selectedRoofBase])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('moduleConstructionSelectionData', moduleConstructionSelectionData)
|
||||
|
||||
if (
|
||||
isExistData &&
|
||||
constructionList.length > 0 &&
|
||||
isObjectNotEmpty(moduleConstructionSelectionData.construction) &&
|
||||
moduleConstructionSelectionData.construction.hasOwnProperty('constPossYn') ///키가 있으면
|
||||
isObjectNotEmpty(moduleConstructionSelectionData?.construction) &&
|
||||
moduleConstructionSelectionData?.construction.hasOwnProperty('constPossYn') ///키가 있으면
|
||||
) {
|
||||
const selectedIndex = moduleConstructionSelectionData.construction.selectedIndex
|
||||
const construction = constructionList[selectedIndex]
|
||||
@ -275,6 +279,12 @@ export default function ModuleTabContents({ addRoof, setAddedRoofs, roofTab, tem
|
||||
}
|
||||
}, [constructionList])
|
||||
|
||||
useEffect(() => {
|
||||
if (isObjectNotEmpty(moduleSelectionData) && isObjectNotEmpty(moduleSelectionData.module)) {
|
||||
setSelectedModules(moduleSelectionData.module)
|
||||
}
|
||||
}, [moduleSelectionData])
|
||||
|
||||
useEffect(() => {
|
||||
// 202600 경사도
|
||||
const raftCodeList = findCommonCode('203800')
|
||||
|
||||
@ -8,7 +8,7 @@ import { useModulePlace } from '@/hooks/module/useModulePlace'
|
||||
|
||||
const Placement = forwardRef((props, refs) => {
|
||||
const { getMessage } = useMessage()
|
||||
const [isChidori, setIsChidori] = useState(false)
|
||||
const [isChidori, setIsChidori] = useState('false')
|
||||
const [isChidoriNotAble, setIsChidoriNotAble] = useState(false)
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
|
||||
@ -52,10 +52,15 @@ const Placement = forwardRef((props, refs) => {
|
||||
}
|
||||
|
||||
const handleChangeChidori = (e) => {
|
||||
setIsChidori(e.target.value)
|
||||
const bool = e.target.value === 'true' ? true : false
|
||||
setIsChidori(bool)
|
||||
refs.isChidori.current = e.target.value
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log('isChidori', isChidori)
|
||||
}, [isChidori])
|
||||
|
||||
const handleSetupLocation = (e) => {
|
||||
setSetupLocation(e.target.value)
|
||||
refs.setupLocation.current = e.target.value
|
||||
@ -140,13 +145,13 @@ const Placement = forwardRef((props, refs) => {
|
||||
id="ra01"
|
||||
checked={isChidori}
|
||||
disabled={isChidoriNotAble}
|
||||
value={true}
|
||||
onChange={handleChangeChidori}
|
||||
value={'true'}
|
||||
onChange={(e) => handleChangeChidori(e)}
|
||||
/>
|
||||
<label htmlFor="ra01">{getMessage('modal.module.basic.setting.module.placement.do')}</label>
|
||||
</div>
|
||||
<div className="d-check-radio pop">
|
||||
<input type="radio" name="radio02" id="ra02" value={false} checked={isChidori === false} onChange={handleChangeChidori} />
|
||||
<input type="radio" name="radio02" id="ra02" checked={!isChidori} value={'false'} onChange={(e) => handleChangeChidori(e)} />
|
||||
<label htmlFor="ra02">{getMessage('modal.module.basic.setting.module.placement.do.not')}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user