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/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index be4653c0..66f1646a 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -368,6 +368,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() 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 3ab2c566..fcac9947 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 dee68fff..d01eaba6 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 7315ce2c..89934a71 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": "길이와 방향을 입력하세요." }