Merge remote-tracking branch 'origin/qcast-pub' into feature/yj-layoutSetup
# Conflicts: # src/components/floor-plan/modal/basic/BasicSetting.jsx
This commit is contained in:
commit
51aaf342fa
@ -53,7 +53,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState)
|
||||
const [isManualModuleLayoutSetup, setIsManualModuleLayoutSetup] = useRecoilState(isManualModuleLayoutSetupState)
|
||||
|
||||
const [roofs, setRoofs] = useState(null)
|
||||
const [roofs, setRoofs] = useState(addedRoofs)
|
||||
const {
|
||||
moduleSelectionInitParams,
|
||||
selectedModules,
|
||||
|
||||
@ -18,6 +18,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
const [selectedRoof, setSelectedRoof] = useState()
|
||||
const {
|
||||
trestleState,
|
||||
trestleDetail,
|
||||
dispatch,
|
||||
raftBaseList,
|
||||
trestleList,
|
||||
@ -171,6 +172,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
snowGdPossYn,
|
||||
cvrChecked,
|
||||
snowGdChecked,
|
||||
trestleDetail,
|
||||
}
|
||||
}
|
||||
return { ...roof }
|
||||
@ -224,6 +226,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
snowGdPossYn,
|
||||
cvrChecked,
|
||||
snowGdChecked,
|
||||
trestleDetail,
|
||||
}
|
||||
}
|
||||
return { ...roof }
|
||||
@ -258,9 +261,25 @@ const Trestle = forwardRef((props, ref) => {
|
||||
setRoofs(newAddedRoofs)
|
||||
setModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
roofConstruction: {
|
||||
...newAddedRoofs,
|
||||
},
|
||||
roofConstructions: newAddedRoofs.map((roof, index) => {
|
||||
return {
|
||||
addRoof: {
|
||||
...roof.addRoof,
|
||||
...moduleSelectionData.roofConstructions[index].addRoof,
|
||||
},
|
||||
trestle: {
|
||||
...roof.trestle,
|
||||
...moduleSelectionData.roofConstructions[index].trestle,
|
||||
},
|
||||
construction: {
|
||||
...roof.construction,
|
||||
...moduleSelectionData.roofConstructions[index].construction,
|
||||
},
|
||||
trestleDetail: {
|
||||
...roof.trestleDetail,
|
||||
},
|
||||
}
|
||||
}),
|
||||
})
|
||||
trestleTrigger({
|
||||
roofConstruction: newAddedRoofs.map((roof) => {
|
||||
|
||||
@ -64,6 +64,7 @@ export function useModuleTrestle(props) {
|
||||
const [ridgeMargin, setRidgeMargin] = useState(0)
|
||||
const [kerabaMargin, setKerabaMargin] = useState(0)
|
||||
const [trestleState, dispatch] = useReducer(trestleReducer, null)
|
||||
const [trestleDetail, setTrestleDetail] = useState(null)
|
||||
|
||||
useEffect(() => {
|
||||
const raftCodeList = findCommonCode(RAFT_BASE_CODE)
|
||||
@ -90,6 +91,7 @@ export function useModuleTrestle(props) {
|
||||
setConstMthdList([])
|
||||
setRoofBaseList([])
|
||||
setConstructionList([])
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
@ -97,17 +99,20 @@ export function useModuleTrestle(props) {
|
||||
if (!trestleState.constMthdCd) {
|
||||
setRoofBaseList([])
|
||||
setConstructionList([])
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
handleSetRoofBaseList()
|
||||
if (!trestleState.roofBaseCd) {
|
||||
setConstructionList([])
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
handleSetConstructionList()
|
||||
if (!trestleState.constTp) {
|
||||
setTrestleDetail(null)
|
||||
return
|
||||
}
|
||||
|
||||
@ -193,6 +198,7 @@ export function useModuleTrestle(props) {
|
||||
setEavesMargin(res[0].data.eaveIntvl)
|
||||
setRidgeMargin(res[0].data.ridgeIntvl)
|
||||
setKerabaMargin(res[0].data.kerabaIntvl)
|
||||
setTrestleDetail(res[0].data)
|
||||
// dispatch({
|
||||
// type: 'SET_TRESTLE_DETAIL',
|
||||
// roof: {
|
||||
@ -208,6 +214,7 @@ export function useModuleTrestle(props) {
|
||||
|
||||
return {
|
||||
trestleState,
|
||||
trestleDetail,
|
||||
dispatch,
|
||||
raftBaseList,
|
||||
trestleList,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user