Compare commits
3 Commits
f323d312d7
...
8be2e3e232
| Author | SHA1 | Date | |
|---|---|---|---|
| 8be2e3e232 | |||
| 9302ba216f | |||
| 0ed1ed5623 |
@ -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)
|
||||
|
||||
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user