가대 상세 api 호출 작업중
This commit is contained in:
parent
14709c2e74
commit
5ac8d7af20
@ -92,8 +92,8 @@ export default function Module({ setTabNum }) {
|
||||
<QSelectBox
|
||||
options={moduleList}
|
||||
value={moduleSelectionInitParams}
|
||||
targetKey={'moduleTpCd'}
|
||||
sourceKey={'itemTp'}
|
||||
targetKey={'moduleItemId'}
|
||||
sourceKey={'itemId'}
|
||||
showKey={'itemNm'}
|
||||
onChange={handleChangeModule}
|
||||
/>
|
||||
|
||||
@ -286,22 +286,6 @@ export default function ModuleTabContents({
|
||||
{globalPitchText})
|
||||
</div>
|
||||
<div className="eaves-keraba-table">
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">マンドンピッチ</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="grid-select">
|
||||
<QSelectBox
|
||||
options={raftCodes}
|
||||
value={addRoof}
|
||||
sourceKey={'clCode'}
|
||||
targetKey={'raftBaseCd'}
|
||||
showKey={'clCodeNm'}
|
||||
disabled={roofMaterial.raftAuth === 'R' ? true : false}
|
||||
onChange={handleChangeRaftBase}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="eaves-keraba-item">
|
||||
{roofMaterial && ['C'].includes(roofMaterial.lenAuth) && (
|
||||
<>
|
||||
|
||||
@ -2,8 +2,10 @@ import { useEffect, useState } from 'react'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||
import { canvasState } from '@/store/canvasAtom'
|
||||
|
||||
export function useModulePlace() {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터
|
||||
const [trestleDetailParams, setTrestleDetailParams] = useState([])
|
||||
const [trestleDetailList, setTrestleDetailList] = useState([])
|
||||
@ -26,22 +28,44 @@ export function useModulePlace() {
|
||||
mixMatlNo: selectedModules.mixMatlNo,
|
||||
roofPitch: selectedModules.roofPchBase ? selectedModules.roofPchBase : null,
|
||||
inclCd: String(item.addRoof.pitch),
|
||||
roofIndex: item.addRoof.roofIndex,
|
||||
roofIndex: item.addRoof.index,
|
||||
}
|
||||
})
|
||||
|
||||
setTrestleDetailParams(listParams)
|
||||
}, [moduleSelectionData])
|
||||
|
||||
const getTrestleDetailListData = async () => {
|
||||
const trestleDetailList = await getTrestleDetailList(trestleDetailParams)
|
||||
setTrestleDetailList(trestleDetailList)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (trestleDetailParams.length > 0) {
|
||||
const trestleDetailList = getTrestleDetailList(trestleDetailParams)
|
||||
setTrestleDetailList(trestleDetailList)
|
||||
getTrestleDetailListData(trestleDetailParams)
|
||||
}
|
||||
}, [trestleDetailParams])
|
||||
|
||||
useEffect(() => {
|
||||
//todo 결과값을 가지고 roofs를 돌아서
|
||||
console.log('🚀 ~ useModulePlace ~ trestleDetailList:', trestleDetailList)
|
||||
|
||||
//지붕을 가져옴
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((roof) => roof.name === 'roof')
|
||||
.forEach((roof) => {
|
||||
const roofIndex = roof.roofMaterial.index //지붕의 지붕재의 순번
|
||||
trestleDetailList.forEach((detail) => {
|
||||
console.log('detail', detail)
|
||||
console.log('roofIndex', roofIndex)
|
||||
console.log('detail.data.roofIndex', detail.data.roofIndex)
|
||||
if (Number(detail.data.roofIndex) === roofIndex) {
|
||||
roof.set({ trestleDetail: detail.data })
|
||||
}
|
||||
})
|
||||
|
||||
console.log('roof', roof)
|
||||
})
|
||||
}, [trestleDetailList])
|
||||
|
||||
return {
|
||||
|
||||
@ -92,6 +92,7 @@ export function useModuleSelection(props) {
|
||||
setModuleSelectionInitParams({
|
||||
...moduleSelectionInitParams,
|
||||
moduleTpCd: option.itemTp,
|
||||
moduleItemId: option.itemId,
|
||||
})
|
||||
}
|
||||
|
||||
@ -128,11 +129,11 @@ export function useModuleSelection(props) {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log('installHeight', installHeight)
|
||||
// console.log('installHeight', installHeight)
|
||||
}, [installHeight])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('verticalSnowCover', verticalSnowCover)
|
||||
// console.log('verticalSnowCover', verticalSnowCover)
|
||||
}, [verticalSnowCover])
|
||||
|
||||
//TODO: 설치높이, 기준적설량 debounce 적용해서 추가해야됨
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user