Merge pull request 'dev' (#86) from dev into dev-deploy
Reviewed-on: #86
This commit is contained in:
commit
b71fb0992f
@ -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') {
|
||||
|
||||
@ -318,8 +318,10 @@ const Placement = forwardRef((props, refs) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="hide-check-guide">
|
||||
{getMessage('modal.module.basic.setting.module.placement.max.size.check')}
|
||||
<button className={`arr ${!useTab ? 'act' : ''}`} onClick={() => setUseTab(!useTab)}></button>
|
||||
<div onClick={() => setUseTab(!useTab)}>
|
||||
{getMessage('modal.module.basic.setting.module.placement.max.size.check')}
|
||||
<button className={`arr ${!useTab ? 'act' : ''}`}></button>
|
||||
</div>
|
||||
</div>
|
||||
<div className={`module-table-box mt10 ${useTab ? 'hide' : ''}`}>
|
||||
<div className="module-table-inner">
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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