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 && (
-