[1105] : [【HANASYS DESIGN】混合モジュールでの回路構成について] #113
@ -16,7 +16,7 @@ import { useSwal } from '@/hooks/useSwal'
|
|||||||
import { canvasState, canvasZoomState } from '@/store/canvasAtom'
|
import { canvasState, canvasZoomState } from '@/store/canvasAtom'
|
||||||
|
|
||||||
import { useTrestle } from '@/hooks/module/useTrestle'
|
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||||
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
import { useEstimate } from '@/hooks/useEstimate'
|
import { useEstimate } from '@/hooks/useEstimate'
|
||||||
@ -60,7 +60,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
const [seletedSubOption, setSeletedSubOption] = useState(null)
|
const [seletedSubOption, setSeletedSubOption] = useState(null)
|
||||||
const { setModuleStatisticsData } = useCircuitTrestle()
|
const { setModuleStatisticsData } = useCircuitTrestle()
|
||||||
const { handleCanvasToPng } = useImgLoader()
|
const { handleCanvasToPng } = useImgLoader()
|
||||||
|
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
|
||||||
const passivityCircuitAllocationRef = useRef()
|
const passivityCircuitAllocationRef = useRef()
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
@ -340,8 +340,15 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
|
|
||||||
const target = pcsCheck.max ? moduleMaxQty : moduleStdQty
|
const target = pcsCheck.max ? moduleMaxQty : moduleStdQty
|
||||||
const placementModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
const placementModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||||
|
let moduleAmount = placementModules.reduce((acc, module) => {
|
||||||
|
if (moduleSelectionData.module.itemList.length === 1 || module.moduleInfo.itemId === moduleSelectionData.module.itemList[0].itemId) {
|
||||||
|
return acc + 1
|
||||||
|
} else {
|
||||||
|
return acc + 0.66
|
||||||
|
}
|
||||||
|
}, 0)
|
||||||
|
|
||||||
if (placementModules.length > target) {
|
if (moduleAmount > target) {
|
||||||
swalFire({
|
swalFire({
|
||||||
title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.all.power.conditional.validation.error01'),
|
title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.all.power.conditional.validation.error01'),
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
@ -371,6 +378,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
|
|
||||||
// 회로할당(승압설정) 저장 버튼 클릭 시
|
// 회로할당(승압설정) 저장 버튼 클릭 시
|
||||||
const onApply = async () => {
|
const onApply = async () => {
|
||||||
|
beforeCapture()
|
||||||
setAllModuleSurfaceIsComplete(false)
|
setAllModuleSurfaceIsComplete(false)
|
||||||
|
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
@ -380,9 +388,8 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
.map((obj) => {
|
.map((obj) => {
|
||||||
obj.pcses = getStepUpListData()
|
obj.pcses = getStepUpListData()
|
||||||
})
|
})
|
||||||
beforeCapture()
|
|
||||||
handleCanvasToPng(1)
|
handleCanvasToPng(1)
|
||||||
afterCapture()
|
|
||||||
|
|
||||||
//회로할당 저장 시 result=null인 경우에도 회로번호 텍스트 표시 유지 처리
|
//회로할당 저장 시 result=null인 경우에도 회로번호 텍스트 표시 유지 처리
|
||||||
|
|
||||||
@ -399,7 +406,6 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
const result = await getEstimateData()
|
const result = await getEstimateData()
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
beforeCapture()
|
|
||||||
handleCanvasToPng(2)
|
handleCanvasToPng(2)
|
||||||
afterCapture()
|
afterCapture()
|
||||||
// 견적서 저장
|
// 견적서 저장
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user