dev #719
@ -7,6 +7,7 @@ import { currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
|||||||
import { roofsState } from '@/store/roofAtom'
|
import { roofsState } from '@/store/roofAtom'
|
||||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react'
|
import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useState } from 'react'
|
||||||
|
import { logger } from '@/util/logger'
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import Swal from 'sweetalert2'
|
import Swal from 'sweetalert2'
|
||||||
import { normalizeDigits } from '@/util/input-utils'
|
import { normalizeDigits } from '@/util/input-utils'
|
||||||
@ -175,6 +176,19 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
const existingConstruction = constructionList.find((construction) => construction.constTp === trestleState.constTp)
|
const existingConstruction = constructionList.find((construction) => construction.constTp === trestleState.constTp)
|
||||||
if (existingConstruction) {
|
if (existingConstruction) {
|
||||||
setSelectedConstruction(existingConstruction)
|
setSelectedConstruction(existingConstruction)
|
||||||
|
// 설치 불가능한 공법이면 강제 해제
|
||||||
|
if (existingConstruction.cvrYn !== 'Y') setCvrChecked(false)
|
||||||
|
if (existingConstruction.snowGdPossYn !== 'Y') setSnowGdChecked(false)
|
||||||
|
const resolvedCvrChecked = existingConstruction.cvrYn === 'Y' ? cvrChecked : false
|
||||||
|
const resolvedSnowGdChecked = existingConstruction.snowGdPossYn === 'Y' ? snowGdChecked : false
|
||||||
|
logger.debug('[Trestle handleConstruction] 복원', {
|
||||||
|
index: constructionList.findIndex((c) => c.constTp === existingConstruction.constTp),
|
||||||
|
constNm: existingConstruction.constNm ?? existingConstruction.constTp,
|
||||||
|
'cvrYn (설치가능여부)': existingConstruction.cvrYn,
|
||||||
|
'cvrChecked (사용자선택)': resolvedCvrChecked,
|
||||||
|
'snowGdPossYn (설치가능여부)': existingConstruction.snowGdPossYn,
|
||||||
|
'snowGdChecked (사용자선택)': resolvedSnowGdChecked,
|
||||||
|
})
|
||||||
} else if (autoSelectStep === 'construction') {
|
} else if (autoSelectStep === 'construction') {
|
||||||
// 자동 선택: 첫 번째 가능한 construction 선택
|
// 자동 선택: 첫 번째 가능한 construction 선택
|
||||||
const availableConstructions = constructionList.filter((construction) => construction.constPossYn === 'Y')
|
const availableConstructions = constructionList.filter((construction) => construction.constPossYn === 'Y')
|
||||||
@ -411,10 +425,24 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
setCvrYn(constructionList[index].cvrYn)
|
const newCvrYn = constructionList[index].cvrYn
|
||||||
setSnowGdPossYn(constructionList[index].snowGdPossYn)
|
const newCvrChecked = newCvrYn === 'Y'
|
||||||
setCvrChecked(true)
|
const newSnowGdPossYn = constructionList[index].snowGdPossYn
|
||||||
setSnowGdChecked(false)
|
const newSnowGdChecked = newSnowGdPossYn === 'Y'
|
||||||
|
|
||||||
|
setCvrYn(newCvrYn)
|
||||||
|
setSnowGdPossYn(newSnowGdPossYn)
|
||||||
|
setCvrChecked(newCvrChecked)
|
||||||
|
setSnowGdChecked(newSnowGdChecked)
|
||||||
|
|
||||||
|
logger.debug('[Trestle handleConstruction]', {
|
||||||
|
index,
|
||||||
|
constNm: constructionList[index].constNm,
|
||||||
|
'cvrYn (설치가능여부)': newCvrYn,
|
||||||
|
'cvrChecked (사용자선택)': newCvrChecked,
|
||||||
|
'snowGdPossYn (설치가능여부)': newSnowGdPossYn,
|
||||||
|
'snowGdChecked (사용자선택)': newSnowGdChecked,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,10 +470,10 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
...constructionList.find((data) => data.constTp === trestleState.constTp),
|
...constructionList.find((data) => data.constTp === trestleState.constTp),
|
||||||
cvrYn: cvrYn,
|
cvrYn: cvrYn,
|
||||||
snowGdPossYn: snowGdPossYn,
|
snowGdPossYn: snowGdPossYn,
|
||||||
cvrChecked: cvrChecked,
|
cvrChecked: cvrYn === 'Y' ? cvrChecked : false,
|
||||||
snowGdChecked: snowGdChecked,
|
snowGdChecked: snowGdPossYn === 'Y' ? snowGdChecked : false,
|
||||||
setupCover: cvrChecked ?? false,
|
setupCover: cvrYn === 'Y' ? (cvrChecked ?? false) : false,
|
||||||
setupSnowCover: snowGdChecked ?? false,
|
setupSnowCover: snowGdPossYn === 'Y' ? (snowGdChecked ?? false) : false,
|
||||||
},
|
},
|
||||||
trestleDetail: trestleDetail,
|
trestleDetail: trestleDetail,
|
||||||
}
|
}
|
||||||
@ -481,10 +509,10 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
...constructionList.find((data) => trestleState.constTp === data.constTp),
|
...constructionList.find((data) => trestleState.constTp === data.constTp),
|
||||||
cvrYn,
|
cvrYn,
|
||||||
snowGdPossYn,
|
snowGdPossYn,
|
||||||
cvrChecked,
|
cvrChecked: cvrYn === 'Y' ? cvrChecked : false,
|
||||||
snowGdChecked,
|
snowGdChecked: snowGdPossYn === 'Y' ? snowGdChecked : false,
|
||||||
setupCover: cvrChecked ?? false,
|
setupCover: cvrYn === 'Y' ? (cvrChecked ?? false) : false,
|
||||||
setupSnowCover: snowGdChecked ?? false,
|
setupSnowCover: snowGdPossYn === 'Y' ? (snowGdChecked ?? false) : false,
|
||||||
},
|
},
|
||||||
trestleDetail: trestleDetail,
|
trestleDetail: trestleDetail,
|
||||||
}
|
}
|
||||||
@ -861,7 +889,11 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
disabled={!cvrYn || cvrYn === 'N'}
|
disabled={!cvrYn || cvrYn === 'N'}
|
||||||
checked={!cvrYn || cvrYn === 'N' ? false : cvrChecked ?? true}
|
checked={!cvrYn || cvrYn === 'N' ? false : cvrChecked ?? true}
|
||||||
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, cvrChecked: !trestleState.cvrChecked } })}
|
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, cvrChecked: !trestleState.cvrChecked } })}
|
||||||
onChange={() => setCvrChecked(!cvrChecked)}
|
onChange={() => {
|
||||||
|
const next = !cvrChecked
|
||||||
|
setCvrChecked(next)
|
||||||
|
logger.debug('[처마커버 체크 변경]', { 'cvrYn (설치가능여부)': cvrYn, 'cvrChecked (사용자선택)': next })
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`ch01`}>{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
<label htmlFor={`ch01`}>{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
||||||
</div>
|
</div>
|
||||||
@ -872,7 +904,11 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
disabled={!snowGdPossYn || snowGdPossYn === 'N'}
|
disabled={!snowGdPossYn || snowGdPossYn === 'N'}
|
||||||
checked={snowGdChecked || false}
|
checked={snowGdChecked || false}
|
||||||
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, snowGdChecked: !trestleState.snowGdChecked } })}
|
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, snowGdChecked: !trestleState.snowGdChecked } })}
|
||||||
onChange={() => setSnowGdChecked(!snowGdChecked)}
|
onChange={() => {
|
||||||
|
const next = !snowGdChecked
|
||||||
|
setSnowGdChecked(next)
|
||||||
|
logger.debug('[눈막이 체크 변경]', { 'snowGdPossYn (설치가능여부)': snowGdPossYn, 'snowGdChecked (사용자선택)': next })
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`ch02`}>{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
<label htmlFor={`ch02`}>{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { useMasterController } from '@/hooks/common/useMasterController'
|
|||||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||||
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { isObjectNotEmpty, isEqualObjects } from '@/util/common-utils'
|
import { isObjectNotEmpty, isEqualObjects } from '@/util/common-utils'
|
||||||
|
import { logger } from '@/util/logger'
|
||||||
|
|
||||||
export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
||||||
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
||||||
@ -285,17 +286,58 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
|||||||
selectedConstruction.setupSnowCover = false //눈막이금구 설치 여부
|
selectedConstruction.setupSnowCover = false //눈막이금구 설치 여부
|
||||||
selectedConstruction.selectedIndex = index
|
selectedConstruction.selectedIndex = index
|
||||||
|
|
||||||
|
logger.debug('[handleConstruction] 공법 선택', {
|
||||||
|
index,
|
||||||
|
constNm: selectedConstruction.constNm,
|
||||||
|
cvrYn: selectedConstruction.cvrYn,
|
||||||
|
snowGdPossYn: selectedConstruction.snowGdPossYn,
|
||||||
|
moduleConstructionSelectionData,
|
||||||
|
})
|
||||||
|
|
||||||
setCvrYn(selectedConstruction.cvrYn)
|
setCvrYn(selectedConstruction.cvrYn)
|
||||||
setSnowGdPossYn(selectedConstruction.snowGdPossYn)
|
setSnowGdPossYn(selectedConstruction.snowGdPossYn)
|
||||||
|
|
||||||
//기존에 선택된 데이터가 있으면 체크한다
|
//기존에 선택된 데이터가 있으면 복원
|
||||||
if (moduleConstructionSelectionData && moduleConstructionSelectionData.construction) {
|
if (moduleConstructionSelectionData && moduleConstructionSelectionData.construction) {
|
||||||
selectedConstruction.setupCover = moduleConstructionSelectionData.construction.setupCover || false
|
selectedConstruction.setupCover = moduleConstructionSelectionData.construction.setupCover || false
|
||||||
selectedConstruction.setupSnowCover = moduleConstructionSelectionData.construction.setupSnowCover || false
|
selectedConstruction.setupSnowCover = moduleConstructionSelectionData.construction.setupSnowCover || false
|
||||||
setCvrChecked(selectedConstruction.setupCover)
|
setCvrChecked(selectedConstruction.setupCover)
|
||||||
setSnowGdChecked(selectedConstruction.setupSnowCover)
|
setSnowGdChecked(selectedConstruction.setupSnowCover)
|
||||||
|
logger.debug('[handleConstruction] 기존 데이터 복원', {
|
||||||
|
setupCover: selectedConstruction.setupCover,
|
||||||
|
setupSnowCover: selectedConstruction.setupSnowCover,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 최초 선택: 설치 가능하면 디폴트 체크
|
||||||
|
const defaultCvr = selectedConstruction.cvrYn === 'Y'
|
||||||
|
const defaultSnowGd = selectedConstruction.snowGdPossYn === 'Y'
|
||||||
|
selectedConstruction.setupCover = defaultCvr
|
||||||
|
selectedConstruction.setupSnowCover = defaultSnowGd
|
||||||
|
setCvrChecked(defaultCvr)
|
||||||
|
setSnowGdChecked(defaultSnowGd)
|
||||||
|
logger.debug('[handleConstruction] 최초 선택 디폴트', {
|
||||||
|
defaultCvr,
|
||||||
|
defaultSnowGd,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 설치 불가능한 공법이면 강제 해제
|
||||||
|
if (selectedConstruction.cvrYn !== 'Y') {
|
||||||
|
selectedConstruction.setupCover = false
|
||||||
|
setCvrChecked(false)
|
||||||
|
logger.debug('[handleConstruction] 처마커버 강제 해제 (cvrYn !== Y)')
|
||||||
|
}
|
||||||
|
if (selectedConstruction.snowGdPossYn !== 'Y') {
|
||||||
|
selectedConstruction.setupSnowCover = false
|
||||||
|
setSnowGdChecked(false)
|
||||||
|
logger.debug('[handleConstruction] 눈막이 강제 해제 (snowGdPossYn !== Y)')
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.debug('[handleConstruction] 최종 상태', {
|
||||||
|
setupCover: selectedConstruction.setupCover,
|
||||||
|
setupSnowCover: selectedConstruction.setupSnowCover,
|
||||||
|
})
|
||||||
|
|
||||||
setSelectedConstruction(selectedConstruction)
|
setSelectedConstruction(selectedConstruction)
|
||||||
} else {
|
} else {
|
||||||
constructionRef.current.forEach((ref) => {
|
constructionRef.current.forEach((ref) => {
|
||||||
|
|||||||
@ -315,6 +315,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
|||||||
// console.log('yInversion', yInversion) //좌우반전
|
// console.log('yInversion', yInversion) //좌우반전
|
||||||
|
|
||||||
changeSurfaceLineType(batchSurface)
|
changeSurfaceLineType(batchSurface)
|
||||||
|
setPolygonLinesActualSize(batchSurface, true)
|
||||||
|
|
||||||
if (setIsHidden) setIsHidden(false)
|
if (setIsHidden) setIsHidden(false)
|
||||||
})
|
})
|
||||||
@ -1670,6 +1671,7 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
|||||||
drawDirectionArrow(currentObject)
|
drawDirectionArrow(currentObject)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
changeSurfaceLineType(currentObject)
|
changeSurfaceLineType(currentObject)
|
||||||
|
setPolygonLinesActualSize(currentObject, true)
|
||||||
currentObject.dirty = true
|
currentObject.dirty = true
|
||||||
currentObject.setCoords()
|
currentObject.setCoords()
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user