상당메뉴바 지붕재 정보 selectBox 노출 수정
This commit is contained in:
parent
61fbc44ced
commit
b635aae8c9
@ -37,6 +37,7 @@ import { menuTypeState } from '@/store/menuAtom'
|
||||
import { usePopup } from '../usePopup'
|
||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||
|
||||
const defaultDotLineGridSetting = {
|
||||
INTERVAL: {
|
||||
@ -119,6 +120,10 @@ export function useCanvasSetting() {
|
||||
const resetModuleSelectionData = useResetRecoilState(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터
|
||||
const resetSelectedModules = useResetRecoilState(selectedModuleState) //선택된 모듈
|
||||
|
||||
const [raftCodes, setRaftCodes] = useState([]) // 서까래 정보
|
||||
const { findCommonCode } = useCommonCode()
|
||||
const [currentRoof, setCurrentRoof] = useState(null) // 현재 선택된 지붕재 정보
|
||||
|
||||
const SelectOptions = [
|
||||
{ id: 1, name: getMessage('modal.canvas.setting.grid.dot.line.setting.line.origin'), value: 1 },
|
||||
{ id: 2, name: '1/2', value: 1 / 2 },
|
||||
@ -133,10 +138,11 @@ export function useCanvasSetting() {
|
||||
const { closeAll } = usePopup()
|
||||
|
||||
useEffect(() => {
|
||||
console.log('correntObjectNo', correntObjectNo)
|
||||
const tempFetchRoofMaterials = !fetchRoofMaterials
|
||||
|
||||
setFetchRoofMaterials(!fetchRoofMaterials)
|
||||
if (fetchRoofMaterials) {
|
||||
//최초 1회만 실행하도록 처리
|
||||
setFetchRoofMaterials(tempFetchRoofMaterials)
|
||||
if (tempFetchRoofMaterials) {
|
||||
addRoofMaterials()
|
||||
}
|
||||
}, [])
|
||||
@ -197,6 +203,16 @@ export function useCanvasSetting() {
|
||||
}
|
||||
}, [roofMaterials, correntObjectNo])
|
||||
|
||||
//배치면 초기설정 화면이 열리지 않아도 데이터 set 하기 위해서 추가
|
||||
useEffect(() => {
|
||||
if (addedRoofs.length > 0) {
|
||||
const raftCodeList = findCommonCode('203800')
|
||||
setRaftCodes(raftCodeList)
|
||||
|
||||
setCurrentRoof({ ...addedRoofs[0] })
|
||||
}
|
||||
}, [addedRoofs])
|
||||
|
||||
useEffect(() => {
|
||||
if (!canvas) {
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user