모듈 체크 변경시 수동 버튼 이벤트 수정
This commit is contained in:
parent
53f35a5e7c
commit
43740eb453
@ -6,12 +6,12 @@ import PitchModule from '@/components/floor-plan/modal/basic/step/pitch/PitchMod
|
||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||
import Placement from '@/components/floor-plan/modal/basic/step/Placement'
|
||||
import { useRecoilValue, useRecoilState } from 'recoil'
|
||||
import { canvasSettingState, canvasState, isManualModuleSetupState } from '@/store/canvasAtom'
|
||||
import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState } from '@/store/canvasAtom'
|
||||
import { usePopup } from '@/hooks/usePopup'
|
||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||
import { useEvent } from '@/hooks/useEvent'
|
||||
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { addedRoofsState, corridorDimensionSelector, basicSettingState } from '@/store/settingAtom'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import Swal from 'sweetalert2'
|
||||
@ -36,10 +36,12 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState)
|
||||
const [isClosePopup, setIsClosePopup] = useState({ close: false, id: 0 })
|
||||
const [checkedModules, setCheckedModules] = useRecoilState(checkedModuleState)
|
||||
|
||||
// const { initEvent } = useContext(EventContext)
|
||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting(tabNum)
|
||||
const { updateObjectDate } = useMasterController()
|
||||
|
||||
const handleBtnNextStep = () => {
|
||||
if (tabNum === 1) {
|
||||
orientationRef.current.handleNextStep()
|
||||
@ -134,6 +136,10 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
}
|
||||
}, [isManualModuleSetup, isClosePopup])
|
||||
|
||||
useEffect(() => {
|
||||
setIsManualModuleSetup(false)
|
||||
}, [checkedModules])
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={pos} className="lx-2">
|
||||
<WithDraggable.Header title={getMessage('plan.menu.module.circuit.setting.default')} onClose={() => handleClosePopup(id)} />
|
||||
|
||||
@ -546,7 +546,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
/**
|
||||
* 스냅기능
|
||||
*/
|
||||
let snapDistance = flowDirection === 'south' || flowDirection === 'north' ? 70 : 40
|
||||
let snapDistance = flowDirection === 'south' || flowDirection === 'north' ? 5 : 5
|
||||
let trestleSnapDistance = 15
|
||||
|
||||
let intvHor =
|
||||
@ -609,11 +609,11 @@ export function useModuleBasicSetting(tabNum) {
|
||||
}
|
||||
//왼쪽 -> 가운데
|
||||
if (Math.abs(smallLeft - holdCellCenterX) < snapDistance) {
|
||||
tempModule.left = holdCellCenterX
|
||||
tempModule.left = holdCellCenterX + intvHor
|
||||
}
|
||||
// 오른쪽 -> 가운데
|
||||
if (Math.abs(smallRight - holdCellCenterX) < snapDistance) {
|
||||
tempModule.left = holdCellCenterX - width
|
||||
tempModule.left = holdCellCenterX - width - intvHor
|
||||
}
|
||||
//세로 가운데 -> 가운데
|
||||
if (Math.abs(smallCenterY - holdCellCenterY) < snapDistance) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user