- 미할당 모듈 있을때 승압 설정 못가게 수정

This commit is contained in:
김민식 2025-02-08 21:50:31 +09:00
parent f7ed2dca75
commit da2a53206e
5 changed files with 24 additions and 13 deletions

View File

@ -93,13 +93,6 @@ export default function CircuitTrestleSetting({ id }) {
}, []) }, [])
// //
useEffect(() => {
if (allocationType === ALLOCATION_TYPE.PASSIVITY && tabNum === 2) {
const notAllocationModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE && !obj.circuit)
canvas.remove(...notAllocationModules)
canvas.renderAll()
}
}, [tabNum])
// PCS // PCS
const onAutoRecommend = () => { const onAutoRecommend = () => {
@ -459,6 +452,21 @@ export default function CircuitTrestleSetting({ id }) {
}) })
} }
const handleStepUp = () => {
const notAllocationModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE && !obj.circuit)
if (notAllocationModules.length > 0) {
swalFire({
title: getMessage('not.allocation.exist.module'),
type: 'alert',
confirmFn: () => {},
})
return
// canvas.remove(...notAllocationModules)
// canvas.renderAll()
}
setTabNum(2)
}
// //
const handleClose = () => { const handleClose = () => {
// // // //
@ -514,7 +522,7 @@ export default function CircuitTrestleSetting({ id }) {
<button className="btn-frame modal mr5 " onClick={() => onClickPrev()}> <button className="btn-frame modal mr5 " onClick={() => onClickPrev()}>
{getMessage('modal.common.prev')} {getMessage('modal.common.prev')}
</button> </button>
<button className="btn-frame modal act" onClick={() => setTabNum(2)}> <button className="btn-frame modal act" onClick={() => handleStepUp()}>
{getMessage('modal.circuit.trestle.setting.circuit.allocation')}({getMessage('modal.circuit.trestle.setting.step.up.allocation')}) {getMessage('modal.circuit.trestle.setting.circuit.allocation')}({getMessage('modal.circuit.trestle.setting.step.up.allocation')})
</button> </button>
</div> </div>

View File

@ -36,7 +36,7 @@ export default function PanelEdit(props) {
const { moduleMove, moduleCopy, moduleMultiMove, moduleMultiCopy, moduleMoveAll, moduleCopyAll } = useModule() const { moduleMove, moduleCopy, moduleMultiMove, moduleMultiCopy, moduleMoveAll, moduleCopyAll } = useModule()
useEffect(() => { useEffect(() => {
if (canvas) { if (!canvas) {
const isSetupModules = canvas.getObjects().filter((obj) => obj.name === 'module') // selectedObj const isSetupModules = canvas.getObjects().filter((obj) => obj.name === 'module') // selectedObj
isSetupModules.forEach((obj) => obj.set({ lockMovementX: false, lockMovementY: false })) isSetupModules.forEach((obj) => obj.set({ lockMovementX: false, lockMovementY: false }))
} }
@ -52,8 +52,8 @@ export default function PanelEdit(props) {
}) })
return return
} }
debugger
const completeSurfaces = canvas.getObject().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.isComplete) const completeSurfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.isComplete)
if (completeSurfaces.length > 0) { if (completeSurfaces.length > 0) {
swalFire({ swalFire({

View File

@ -47,6 +47,7 @@ export function useModule() {
canvas.discardActiveObject() //선택해제 canvas.discardActiveObject() //선택해제
debugger
const isSetupModules = getOtherModules(selectedObj) const isSetupModules = getOtherModules(selectedObj)
const selectedModules = canvas.getObjects().filter((obj) => selectedIds.includes(obj.id) && obj.name === 'module') //선택했던 객체들만 가져옴 const selectedModules = canvas.getObjects().filter((obj) => selectedIds.includes(obj.id) && obj.name === 'module') //선택했던 객체들만 가져옴
const setupSurface = canvas const setupSurface = canvas

View File

@ -1010,5 +1010,6 @@
"batch.object.outside.roof": "オブジェクトは屋根に設置する必要があります。", "batch.object.outside.roof": "オブジェクトは屋根に設置する必要があります。",
"batch.object.notinstall.cross": "オブジェクトは重複してインストールできません。", "batch.object.notinstall.cross": "オブジェクトは重複してインストールできません。",
"module.not.batch.north": "북쪽에는 모듈을 배치할 수 없습니다.", "module.not.batch.north": "북쪽에는 모듈을 배치할 수 없습니다.",
"max.select": "최대 {0}개까지 선택할 수 있습니다.(JA)" "max.select": "최대 {0}개까지 선택할 수 있습니다.(JA)",
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.(JA)"
} }

View File

@ -1012,5 +1012,6 @@
"batch.object.notinstall.cross": "오브젝트는 겹쳐서 설치 할 수 없습니다.", "batch.object.notinstall.cross": "오브젝트는 겹쳐서 설치 할 수 없습니다.",
"module.not.batch.north": "북쪽에는 모듈을 배치할 수 없습니다.", "module.not.batch.north": "북쪽에는 모듈을 배치할 수 없습니다.",
"module.trestleDetail.not.exist": "가대 상세 정보가 없습니다.", "module.trestleDetail.not.exist": "가대 상세 정보가 없습니다.",
"max.select": "최대 {0}개까지 선택할 수 있습니다." "max.select": "최대 {0}개까지 선택할 수 있습니다.",
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다."
} }