From 71be077b2b4ca312851f7a2b872fe9dc4f9a40a3 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, 4 Feb 2025 15:52:46 +0900 Subject: [PATCH] =?UTF-8?q?-=ED=9A=8C=EB=A1=9C=20=EB=AF=B8=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=20=EB=AA=A8=EB=93=88=20=EC=82=AD=EC=A0=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 41 ++++--------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 109da999..40f8d7ea 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -95,6 +95,7 @@ export default function CircuitTrestleSetting({ id }) { return { ...model, id: uuidv4(), + isUsed: false, } }) const pcsVoltageChkParams = { @@ -252,36 +253,6 @@ export default function CircuitTrestleSetting({ id }) { return moduleList } - const onAutoAllocation = () => { - let moduleStdQty = 0 - let moduleMaxQty = 0 - const selectedModels = models.filter((m) => m.selected) - - if (selectedModels.length === 0) { - onAutoRecommend() - } else { - moduleStdQty = selectedModels.reduce((acc, model) => { - return acc + parseInt(model.moduleStdQty) - }, 0) - moduleMaxQty = selectedModels.reduce((acc, model) => { - return acc + parseInt(model.moduleMaxQty) - }, 0) - } - // const target = pcsCheck.max ? moduleMaxQty : moduleStdQty - // const placementModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE) - - // if (placementModules.length > target) { - // swalFire({ - // title: '배치가능 매수를 초과합니다. 파워컨디셔너를 다시 선택해 주세요.', - // type: 'alert', - // }) - // return - // } - - // setAllocationType(ALLOCATION_TYPE.AUTO) - // setTabNum(2) - } - const onPassivityAllocation = () => { if (selectedModels.length === 0) { const params = { @@ -364,10 +335,16 @@ export default function CircuitTrestleSetting({ id }) { obj.pcses = getStepUpListData() }) - console.log(canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)) + removeNotAllocationModules() apply() } + const removeNotAllocationModules = () => { + const notAllocationModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE && !obj.circuit) + canvas.remove(...notAllocationModules) + canvas.renderAll() + } + const onClickPrev = () => { setAllocationType(ALLOCATION_TYPE.AUTO) swalFire({ @@ -478,7 +455,7 @@ export default function CircuitTrestleSetting({ id }) { {tabNum === 2 && } {tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && (
-