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