배치면초기설정 육지붕 선택 후 새로고침 시 모듈/가대설정 오류 수정
This commit is contained in:
parent
ea58549d68
commit
f3fb6c863d
@ -12,7 +12,7 @@ import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientatio
|
||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||
import { useEvent } from '@/hooks/useEvent'
|
||||
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||
import { addedRoofsState, corridorDimensionSelector } from '@/store/settingAtom'
|
||||
import { addedRoofsState, corridorDimensionSelector, basicSettingState } from '@/store/settingAtom'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import Swal from 'sweetalert2'
|
||||
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||
@ -34,7 +34,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const loginUserState = useRecoilValue(loginUserStore)
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
|
||||
const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState)
|
||||
const [isClosePopup, setIsClosePopup] = useState({ close: false, id: 0 })
|
||||
|
||||
// const { initEvent } = useContext(EventContext)
|
||||
@ -44,7 +44,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
if (tabNum === 1) {
|
||||
orientationRef.current.handleNextStep()
|
||||
} else if (tabNum === 2) {
|
||||
if (canvasSetting.roofSizeSet !== '3') {
|
||||
if (basicSetting.roofSizeSet !== '3') {
|
||||
if (!isObjectNotEmpty(moduleSelectionData.module)) {
|
||||
Swal.fire({
|
||||
title: getMessage('module.not.found'),
|
||||
@ -124,7 +124,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (canvasSetting.roofSizeSet !== '3') {
|
||||
if (basicSetting.roofSizeSet !== '3') {
|
||||
manualModuleSetup(placementRef)
|
||||
} else {
|
||||
manualFlatroofModuleSetup(placementFlatRef)
|
||||
@ -153,12 +153,12 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
</div>
|
||||
{tabNum === 1 && <Orientation ref={orientationRef} tabNum={tabNum} setTabNum={setTabNum} />}
|
||||
{/*배치면 초기설정 - 입력방법: 복시도 입력 || 실측값 입력*/}
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != '3' && tabNum === 2 && <Module setTabNum={setTabNum} />}
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != '3' && tabNum === 3 && <Placement setTabNum={setTabNum} ref={placementRef} />}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 2 && <Module setTabNum={setTabNum} />}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && tabNum === 3 && <Placement setTabNum={setTabNum} ref={placementRef} />}
|
||||
|
||||
{/*배치면 초기설정 - 입력방법: 육지붕*/}
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == '3' && tabNum === 2 && <PitchModule setTabNum={setTabNum} />}
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == '3' && tabNum === 3 && (
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 2 && <PitchModule setTabNum={setTabNum} />}
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && tabNum === 3 && (
|
||||
<PitchPlacement setTabNum={setTabNum} ref={placementFlatRef} />
|
||||
)}
|
||||
|
||||
@ -177,7 +177,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
|
||||
{tabNum === 3 && (
|
||||
<>
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet != 3 && (
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet != '3' && (
|
||||
<>
|
||||
<button className={`btn-frame modal mr5 ${isManualModuleSetup ? 'act' : ''}`} onClick={handleManualModuleSetup}>
|
||||
{getMessage('modal.module.basic.setting.passivity.placement')}
|
||||
@ -187,7 +187,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
</button>
|
||||
</>
|
||||
)}
|
||||
{canvasSetting.roofSizeSet && canvasSetting.roofSizeSet == 3 && (
|
||||
{basicSetting.roofSizeSet && basicSetting.roofSizeSet == '3' && (
|
||||
<>
|
||||
<button className={`btn-frame modal mr5 ${isManualModuleSetup ? 'act' : ''}`} onClick={handleManualModuleSetup}>
|
||||
{getMessage('modal.module.basic.setting.passivity.placement')}
|
||||
|
||||
@ -44,6 +44,7 @@ const PitchPlacement = forwardRef((props, refs) => {
|
||||
//체크된 모듈 데이터
|
||||
useEffect(() => {
|
||||
const checkedModuleIds = Object.keys(selectedItems).filter((key) => selectedItems[key])
|
||||
if (selectedModules.length < 1) return // null 오류 차단 로직 추가
|
||||
const moduleArray = selectedModules.itemList.filter((item) => {
|
||||
return checkedModuleIds.includes(item.itemId)
|
||||
})
|
||||
@ -88,6 +89,7 @@ const PitchPlacement = forwardRef((props, refs) => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!moduleSelectionData.flatModule) return // null 오류 차단 로직 추가
|
||||
if (moduleSelectionData && moduleSelectionData.flatModule.itemList.length > 0) {
|
||||
let initCheckedModule = {}
|
||||
moduleSelectionData.flatModule.itemList.forEach((obj, index) => {
|
||||
|
||||
@ -394,7 +394,6 @@ export function useCanvasSetting() {
|
||||
layout: roofsArray[i].roofLayout,
|
||||
roofSizeSet: roofsRow[i].roofSizeSet,
|
||||
roofAngleSet: roofsRow[i].roofAngleSet,
|
||||
roofDbData: roofsRow[i].roofDbData,
|
||||
pitch: roofsArray[i].roofPitch,
|
||||
angle: roofsArray[i].roofAngle,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user