가대 디테일 조회 오류 수정

This commit is contained in:
yjnoh 2025-02-03 20:23:08 +09:00
parent d0c8b10ec6
commit a2237de250
3 changed files with 15 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import { canvasState } from '@/store/canvasAtom'
import { v4 as uuidv4 } from 'uuid' import { v4 as uuidv4 } from 'uuid'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
import Distance from '@/components/floor-plan/modal/distance/Distance' import Distance from '@/components/floor-plan/modal/distance/Distance'
import { usePolygon } from '@/hooks/usePolygon'
export function useCommonUtils() { export function useCommonUtils() {
const canvas = useRecoilValue(canvasState) const canvas = useRecoilValue(canvasState)
@ -20,6 +21,7 @@ export function useCommonUtils() {
const commonTextFont = useRecoilValue(fontSelector('commonText')) const commonTextFont = useRecoilValue(fontSelector('commonText'))
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState) const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
const { addPopup } = usePopup() const { addPopup } = usePopup()
const { drawDirectionArrow } = usePolygon()
useEffect(() => { useEffect(() => {
// initEvent() // initEvent()
@ -609,6 +611,16 @@ export function useCommonUtils() {
if (clonedObj.type === 'group') clonedObj.set({ groupId: uuidv4() }) if (clonedObj.type === 'group') clonedObj.set({ groupId: uuidv4() })
initEvent() initEvent()
//배치면일 경우
if (obj.name === 'roof') {
clonedObj.setCoords()
clonedObj.fire('polygonMoved')
clonedObj.set({ direction: obj.direction, directionText: obj.directionText })
clonedObj.addLengthText()
canvas.renderAll()
drawDirectionArrow(clonedObj)
}
}) })
} }
} }

View File

@ -39,7 +39,7 @@ export function useModulePlace() {
roofBaseCd: item.trestle.roofBaseCd, roofBaseCd: item.trestle.roofBaseCd,
constTp: item.construction.constTp, constTp: item.construction.constTp,
mixMatlNo: selectedModules.mixMatlNo, mixMatlNo: selectedModules.mixMatlNo,
roofPitch: item.addRoof.roofPchBase ? item.addRoof.roofPchBase : null, roofPitch: item.addRoof.hajebichi ? item.addRoof.hajebichi : 0,
inclCd: String(item.addRoof.pitch), inclCd: String(item.addRoof.pitch),
roofIndex: item.addRoof.index, roofIndex: item.addRoof.index,
workingWidth: item.addRoof.lenBase, workingWidth: item.addRoof.lenBase,

View File

@ -343,9 +343,9 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
const handleHajebichiAndLength = (e, type) => { const handleHajebichiAndLength = (e, type) => {
if (type === 'length') { if (type === 'length') {
setLengthBase(e.target.value) setLengthBase(Number(e.target.value))
} else { } else {
setHajebichi(e.target.value) setHajebichi(Number(e.target.value))
} }
resetSelected() resetSelected()
} }