From d923b8acffdf6abbcac9acaecec66eee9088998f Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 6 Feb 2025 17:45:01 +0900 Subject: [PATCH] =?UTF-8?q?=EC=99=B8=EB=B2=BD=EC=84=A0=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=B0=20=ED=9B=84,=20=EC=A7=80=EB=B6=95=ED=98=95=EC=83=81?= =?UTF-8?q?=20=EC=88=98=EB=8F=99=20=EC=84=A4=EC=A0=95=20=EC=8B=9C=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/roofcover/useRoofAllocationSetting.js | 6 +++--- .../roofcover/useRoofShapePassivitySetting.js | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index 550ce5f5..6fda1692 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -445,9 +445,9 @@ export function useRoofAllocationSetting(id) { setCurrentRoofList(newRoofList) } - const handleChangeInput = (e, type, index) => { + const handleChangeInput = (e, type = '', index) => { const value = e.target.value - if (type === 'pitch') { + /*if (type === 'pitch') { // type이 pitch인 경우 소수점 1자리까지만 입력 가능 const reg = /^[0-9]+(\.[0-9]{0,1})?$/ @@ -481,7 +481,7 @@ export function useRoofAllocationSetting(id) { } return - } + }*/ const newRoofList = currentRoofList.map((roof, idx) => { if (idx === index) { diff --git a/src/hooks/roofcover/useRoofShapePassivitySetting.js b/src/hooks/roofcover/useRoofShapePassivitySetting.js index c51da066..33d5d953 100644 --- a/src/hooks/roofcover/useRoofShapePassivitySetting.js +++ b/src/hooks/roofcover/useRoofShapePassivitySetting.js @@ -203,6 +203,20 @@ export function useRoofShapePassivitySetting(id) { const roofBases = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) const exceptObjs = canvas.getObjects().filter((obj) => obj.name !== 'outerLine' && obj.parent?.name !== 'outerLine') const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') + + let checkedAllSetting = true + + lines.forEach((line) => { + if (!line.attributes) { + checkedAllSetting = false + } + }) + + if (!checkedAllSetting) { + swalFire({ text: '설정이 완료되지 않은 외벽선이 있습니다.', icon: 'warning' }) + return + } + exceptObjs.forEach((obj) => { canvas.remove(obj) })