From 54b69b13779ee7ec14db5eaffccb95f6b7f71c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Tue, 11 Feb 2025 13:08:53 +0900 Subject: [PATCH 1/2] =?UTF-8?q?-=20=EB=8B=A4=EA=B5=AD=EC=96=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EB=B3=B4=EC=A1=B0=EC=84=A0=20validatio?= =?UTF-8?q?n=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/auxiliary/AuxiliaryEdit.jsx | 23 ++++++++++++++----- .../floor-plan/modal/grid/GridMove.jsx | 4 ++-- src/hooks/useContextMenu.js | 6 +---- src/locales/ja.json | 3 ++- src/locales/ko.json | 3 ++- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx b/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx index e0f3522b..1da94050 100644 --- a/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx +++ b/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx @@ -21,23 +21,34 @@ export default function AuxiliaryEdit(props) { const currentObject = useRecoilValue(currentObjectState) const { swalFire } = useSwal() const handleSave = () => { - if (!horizonSize || !verticalSize || !arrow1 || !arrow2) { - swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' }) + if ((!arrow1 && !arrow2) || (+verticalSize === 0 && +horizonSize === 0)) { + swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' }) return } + + if ((verticalSize && +verticalSize === 0) || !arrow1) { + swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' }) + return + } + + if ((horizonSize && +horizonSize === 0) || !arrow2) { + swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' }) + return + } + if (type === 'copy') { if (currentObject) { copy( currentObject, - arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize), - arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize), + arrow2 ? (arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize)) : 0, + arrow1 ? (arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize)) : 0, ) } } else { move( currentObject, - arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize), - arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize), + arrow2 ? (arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize)) : 0, + arrow1 ? (arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize)) : 0, ) } diff --git a/src/components/floor-plan/modal/grid/GridMove.jsx b/src/components/floor-plan/modal/grid/GridMove.jsx index e28d8564..1713647b 100644 --- a/src/components/floor-plan/modal/grid/GridMove.jsx +++ b/src/components/floor-plan/modal/grid/GridMove.jsx @@ -38,12 +38,12 @@ export default function GridMove(props) { const handleApply = () => { if (currentObject?.direction === 'vertical') { if (!horizonSize || !arrow2) { - swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' }) + swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' }) return } } else { if (!verticalSize || !arrow1) { - swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' }) + swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' }) } } diff --git a/src/hooks/useContextMenu.js b/src/hooks/useContextMenu.js index 577d5b2e..e5006927 100644 --- a/src/hooks/useContextMenu.js +++ b/src/hooks/useContextMenu.js @@ -130,11 +130,7 @@ export function useContextMenu() { name: getMessage('contextmenu.roof.material.placement'), component: , }, - { - id: 'roofMaterialRemove', - name: getMessage('contextmenu.roof.material.remove'), - fn: () => removeRoofMaterial(), - }, + { id: 'roofMaterialRemoveAll', name: getMessage('contextmenu.roof.material.remove.all'), diff --git a/src/locales/ja.json b/src/locales/ja.json index 441cb9d7..c8246a5a 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -1014,5 +1014,6 @@ "max.select": "최대 {0}개까지 선택할 수 있습니다.(JA)", "not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.(JA)", "roof.is.not.selected": "지붕을 선택해주세요.(JA)", - "module.delete.confirm": "パネルを削除して面入力に戻ります。正しいですか?\nはい]を選択すると削除し、面入力に戻ります。\nいいえ」を選択すると、削除せずに現在の状態を維持します。" + "module.delete.confirm": "パネルを削除して面入力に戻ります。正しいですか?\nはい]を選択すると削除し、面入力に戻ります。\nいいえ」を選択すると、削除せずに現在の状態を維持します。", + "length.direction.is.required": "길이와 방향을 입력하세요.(JA)" } diff --git a/src/locales/ko.json b/src/locales/ko.json index d044217c..518f96b9 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -1015,5 +1015,6 @@ "max.select": "최대 {0}개까지 선택할 수 있습니다.", "module.delete.confirm": "패널을 삭제하고 면입력으로 돌아갑니다. 맞습니까?\n[예]를 선택하면 삭제하고, 면 입력으로 돌아갑니다.\n[아니오]를 선택하면 삭제하지 않고 현재 상태를 유지합니다.", "not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.", - "roof.is.not.selected": "지붕을 선택해주세요." + "roof.is.not.selected": "지붕을 선택해주세요.", + "length.direction.is.required": "길이와 방향을 입력하세요." } From 9c6e812b193cb487ce7174631e0b215f23618c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:32:23 +0900 Subject: [PATCH 2/2] =?UTF-8?q?-=20=ED=9A=8C=EB=A1=9C=20=EB=B2=88=ED=98=B8?= =?UTF-8?q?=20=EC=B4=88=EA=B8=B0=ED=99=94=20=EB=A1=9C=EC=A7=81=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 1 + .../modal/circuitTrestle/step/StepUp.jsx | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 5107d585..015d5173 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -364,6 +364,7 @@ export default function CircuitTrestleSetting({ id }) { circuitModules.forEach((obj) => { obj.circuit = null obj.pcsItemId = null + obj.circuitNumber = null }) if (allocationType === ALLOCATION_TYPE.PASSIVITY) { diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index e0bd7592..7ac64fde 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -392,18 +392,21 @@ export default function StepUp(props) { } } + canvas + .getObjects() + .filter((obj) => obj.name === POLYGON_TYPE.MODULE) + .forEach((module) => { + module.circuit = null + module.circuitNumber = null + module.pcsItemId = null + }) + selectedData.roofSurfaceList.forEach((roofSurface) => { const targetSurface = canvas.getObjects().filter((obj) => obj.id === roofSurface.roofSurfaceId)[0] const moduleIds = targetSurface.modules.map((module) => { return module.id }) - targetSurface.modules.map((module) => { - module.circuit = null - module.circuitNumber = null - module.pcsItemId = null - }) - // 모듈 목록 삭제 canvas .getObjects()