feature/ysCha #23
@ -261,6 +261,15 @@ export function useRoofAllocationSetting(id) {
|
||||
* 지붕재 삭제
|
||||
*/
|
||||
const onDeleteRoofMaterial = (idx) => {
|
||||
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
|
||||
for (let i = 0; i < roofs.length; i++) {
|
||||
if (roofs[i].roofMaterial.index === idx) {
|
||||
swalFire({ type: 'alert', icon: 'error', text: getMessage('roof.material.can.not.delete') })
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const isSelected = currentRoofList[idx].selected
|
||||
const newRoofList = JSON.parse(JSON.stringify(currentRoofList)).filter((_, index) => index !== idx)
|
||||
if (isSelected) {
|
||||
@ -300,6 +309,7 @@ export function useRoofAllocationSetting(id) {
|
||||
})
|
||||
|
||||
setRoofList(newRoofList)
|
||||
setRoofMaterials(newRoofList)
|
||||
const selectedRoofMaterial = newRoofList.find((roof) => roof.selected)
|
||||
setSurfaceShapePattern(currentObject, roofDisplay.column, false, selectedRoofMaterial, true)
|
||||
drawDirectionArrow(currentObject)
|
||||
@ -308,6 +318,21 @@ export function useRoofAllocationSetting(id) {
|
||||
basicSettingSave()
|
||||
}
|
||||
|
||||
/**
|
||||
* 기존 세팅된 지붕에 지붕재 내용을 바뀐 내용으로 수정
|
||||
* @param newRoofMaterials
|
||||
*/
|
||||
const setRoofMaterials = (newRoofMaterials) => {
|
||||
const roofs = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
newRoofMaterials.forEach((roofMaterial) => {
|
||||
const index = roofMaterial.index
|
||||
const tempRoofs = roofs.filter((roof) => roof.roofMaterial?.index === index)
|
||||
tempRoofs.forEach((roof) => {
|
||||
setSurfaceShapePattern(roof, roofDisplay.column, false, roofMaterial)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 지붕면 할당
|
||||
*/
|
||||
@ -411,6 +436,8 @@ export function useRoofAllocationSetting(id) {
|
||||
drawDirectionArrow(roof)
|
||||
})
|
||||
|
||||
setRoofMaterials(newRoofList)
|
||||
|
||||
/** 외곽선 삭제 */
|
||||
const removeTargets = canvas.getObjects().filter((obj) => obj.name === 'outerLinePoint' || obj.name === 'outerLine')
|
||||
removeTargets.forEach((obj) => {
|
||||
|
||||
@ -1038,5 +1038,6 @@
|
||||
"want.to.complete.auxiliary.creation": "補助線の作成を完了しますか?",
|
||||
"modal.placement.initial.setting.plan.drawing.only.number": "(※数字は[半角]入力のみ可能です。)",
|
||||
"wall.line.not.found": "外壁がありません",
|
||||
"roof.line.not.found": "屋根形状がありません"
|
||||
"roof.line.not.found": "屋根形状がありません",
|
||||
"roof.material.can.not.delete" : "割り当てられた配置面があります。"
|
||||
}
|
||||
|
||||
@ -1038,5 +1038,6 @@
|
||||
"want.to.complete.auxiliary.creation": "보조선 작성을 완료하시겠습니까?",
|
||||
"modal.placement.initial.setting.plan.drawing.only.number": "(※ 숫자는 [반각]입력만 가능합니다.)",
|
||||
"wall.line.not.found": "외벽선이 없습니다.",
|
||||
"roof.line.not.found": "지붕형상이 없습니다."
|
||||
"roof.line.not.found": "지붕형상이 없습니다.",
|
||||
"roof.material.can.not.delete" : "할당된 배치면이 있습니다."
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user