외벽선 그리기 후 팝업 내용 수정
This commit is contained in:
parent
a24789d34f
commit
7e05602175
@ -122,40 +122,47 @@ export function usePropertiesSetting(id) {
|
||||
const handleFix = () => {
|
||||
const isClose = confirm('외벽선 속성 설정을 완료하시겠습니까?')
|
||||
if (isClose) {
|
||||
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||
|
||||
const notSetAttributes = lines.filter((line) => !line.attributes?.type)
|
||||
if (notSetAttributes.length > 0) {
|
||||
// 세팅이 하나라도 안되어있으면 초기화
|
||||
lines.forEach((line) => {
|
||||
line.set({
|
||||
stroke: '#000000',
|
||||
strokeWidth: 4,
|
||||
})
|
||||
})
|
||||
canvas.discardActiveObject()
|
||||
closePopup(id)
|
||||
return
|
||||
}
|
||||
|
||||
lines.forEach((line) => {
|
||||
line.set({
|
||||
attributes: line.attributes ? line.attributes : { offset: 0, type: LINE_TYPE.WALLLINE.WALL },
|
||||
stroke: '#000000',
|
||||
strokeWidth: 4,
|
||||
})
|
||||
|
||||
hideLine(line)
|
||||
})
|
||||
|
||||
const wall = addPolygonByLines(lines, { name: POLYGON_TYPE.WALL, fill: 'transparent', stroke: 'black' })
|
||||
|
||||
wall.lines = [...lines]
|
||||
|
||||
const roof = drawRoofPolygon(wall)
|
||||
|
||||
setPoints([])
|
||||
canvas.renderAll()
|
||||
roof.drawHelpLine()
|
||||
|
||||
closePopup(id)
|
||||
return
|
||||
} else {
|
||||
return
|
||||
}
|
||||
|
||||
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
|
||||
|
||||
const notSetAttributes = lines.filter((line) => !line.attributes?.type)
|
||||
if (notSetAttributes.length > 0) {
|
||||
alert('설정되지 않은 외벽선이 있습니다.')
|
||||
return
|
||||
}
|
||||
|
||||
lines.forEach((line) => {
|
||||
line.set({
|
||||
attributes: line.attributes ? line.attributes : { offset: 0, type: LINE_TYPE.WALLLINE.WALL },
|
||||
stroke: '#000000',
|
||||
strokeWidth: 4,
|
||||
})
|
||||
|
||||
hideLine(line)
|
||||
})
|
||||
|
||||
const wall = addPolygonByLines(lines, { name: POLYGON_TYPE.WALL, fill: 'transparent', stroke: 'black' })
|
||||
|
||||
wall.lines = [...lines]
|
||||
|
||||
const roof = drawRoofPolygon(wall)
|
||||
|
||||
setPoints([])
|
||||
canvas.renderAll()
|
||||
roof.drawHelpLine()
|
||||
closePopup(id)
|
||||
}
|
||||
|
||||
const closeModal = (fn) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user