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