diff --git a/src/app/floor-plan/FloorPlanProvider.js b/src/app/floor-plan/FloorPlanProvider.js index 5019e8a4..1e5c536d 100644 --- a/src/app/floor-plan/FloorPlanProvider.js +++ b/src/app/floor-plan/FloorPlanProvider.js @@ -45,8 +45,19 @@ const FloorPlanProvider = ({ children }) => { // const pathname = usePathname() // const setCorrentObjectNo = useSetRecoilState(correntObjectNoState) const searchParams = useSearchParams() + const path = usePathname() const objectNo = searchParams.get('objectNo') const pid = searchParams.get('pid') + + useEffect(() => { + setFloorPlanState((prev) => { + return { + ...prev, + objectNo, + pid, + } + }) + }, [path]) // useEffect(() => { // console.log('πŸš€ ~ useEffect ~ objectNo:') // if (pathname === '/floor-plan') { diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx index ffb96d83..29ea0d10 100644 --- a/src/components/floor-plan/modal/basic/step/Placement.jsx +++ b/src/components/floor-plan/modal/basic/step/Placement.jsx @@ -318,8 +318,10 @@ const Placement = forwardRef((props, refs) => {
- {getMessage('modal.module.basic.setting.module.placement.max.size.check')} - +
setUseTab(!useTab)}> + {getMessage('modal.module.basic.setting.module.placement.max.size.check')} + +
diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index d268cc21..f4972c54 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -13,7 +13,7 @@ import { useRecoilState } from 'recoil' import { makersState, modelsState, modelState, pcsCheckState, selectedMakerState, selectedModelsState, seriesState } from '@/store/circuitTrestleAtom' import { POLYGON_TYPE } from '@/common/common' import { useSwal } from '@/hooks/useSwal' -import { canvasState } from '@/store/canvasAtom' +import { canvasState, canvasZoomState } from '@/store/canvasAtom' import { useTrestle } from '@/hooks/module/useTrestle' import { selectedModuleState } from '@/store/selectedModuleOptions' @@ -37,7 +37,7 @@ export default function CircuitTrestleSetting({ id }) { const { swalFire } = useSwal() const { saveEstimate } = useEstimate() const canvas = useRecoilValue(canvasState) - + const [canvasZoom, setCanvasZoom] = useRecoilState(canvasZoomState) const [tabNum, setTabNum] = useState(1) const [allocationType, setAllocationType] = useState(ALLOCATION_TYPE.AUTO) const [circuitAllocationType, setCircuitAllocationType] = useState(1) @@ -102,6 +102,13 @@ export default function CircuitTrestleSetting({ id }) { } }, []) + const handleZoomClear = () => { + setCanvasZoom(100) + canvas.set({ zoom: 1 }) + canvas.viewportTransform = [1, 0, 0, 1, 0, 0] + canvas.renderAll() + } + // μˆ˜λ™ν• λ‹Ή μ‹œ λͺ¨λ“ˆ μ‚­μ œ // μ‹œλ¦¬μ¦ˆμ€‘ μžλ™μœΌλ‘œ μΆ”μ²œ PCS 정보 쑰회 @@ -343,6 +350,7 @@ export default function CircuitTrestleSetting({ id }) { // νšŒλ‘œν• λ‹Ή(μŠΉμ••μ„€μ •) μ €μž₯ λ²„νŠΌ 클릭 μ‹œ const onApply = async () => { + handleZoomClear() setAllModuleSurfaceIsComplete(false) setIsGlobalLoading(true) diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index a3f2eb0e..8f4a2a7e 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -661,7 +661,7 @@ export function useModuleBasicSetting(tabNum) { //κ°€μš΄λ° κ°€μš΄λ° if (Math.abs(smallCenterY - holdCellCenterY) < snapDistance) { - tempModule.top = holdCellCenterY - toFixedWithoutRounding(width / 2, 2) + tempModule.top = holdCellCenterY - toFixedWithoutRounding(height / 2, 2) } if (isChidori) { diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index d8e1c9d6..afae51c8 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -602,8 +602,10 @@ export function usePlan(params = {}) { if (pathname === '/floor-plan/estimate/5' || pathname === '/floor-plan/simulator/6') { await getCanvasByObjectNo(objectNo, planNo).then((res) => { if (res.length > 0) { - setCurrentCanvasPlan((prev) => ({ ...prev, canvasStatus: res.find((plan) => plan.planNo === planNo).canvasStatus })) - setPlans((plans) => plans.map((plan) => ({ ...plan, canvasStatus: res.find((resPlan) => resPlan.planNo === plan.planNo).canvasStatus }))) + // setCurrentCanvasPlan((prev) => ({ ...prev, canvasStatus: res.find((plan) => plan.planNo === planNo).canvasStatus })) + // setPlans((plans) => plans.map((plan) => ({ ...plan, canvasStatus: res.find((resPlan) => resPlan.planNo === plan.planNo).canvasStatus }))) + setCurrentCanvasPlan(res.find((plan) => plan.planNo === planNo)) + setPlans(res) } }) }