Merge branch 'qcast-pub' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
# Conflicts: # src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
This commit is contained in:
commit
2013dd0e18
@ -43,29 +43,6 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
|
||||
const selectedModules = useRecoilValue(selectedModuleState)
|
||||
const { getPcsAutoRecommendList } = useMasterController()
|
||||
const powerConditionalSelectProps = {
|
||||
tabNum,
|
||||
setTabNum,
|
||||
makers,
|
||||
setMakers,
|
||||
selectedMaker,
|
||||
setSelectedMaker,
|
||||
series,
|
||||
setSeries,
|
||||
models,
|
||||
setModels,
|
||||
selectedModels,
|
||||
setSelectedModels,
|
||||
managementState,
|
||||
}
|
||||
|
||||
const passivityProps = {
|
||||
tabNum,
|
||||
setTabNum,
|
||||
pcsCheck,
|
||||
selectedModels,
|
||||
setSelectedModels,
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (!managementState) {
|
||||
@ -120,6 +97,40 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
})
|
||||
}
|
||||
|
||||
const getSelectModelList = () => {
|
||||
return selectedModels.map((model) => {
|
||||
return {
|
||||
pcsMkrCd: model.pcsMkrCd,
|
||||
pcsSerCd: model.pcsSerCd,
|
||||
itemId: model.itemId,
|
||||
itemNm: model.itemNm,
|
||||
goodsNo: model.goodsNo,
|
||||
serQtyList: [
|
||||
{
|
||||
serQty: 0,
|
||||
paralQty: 0,
|
||||
rmdYn: 'Y',
|
||||
usePossYn: 'Y',
|
||||
roofSurfaceList: [
|
||||
{
|
||||
roofSurfaceId: '',
|
||||
roofSurface: '',
|
||||
roofSurfaceIncl: '',
|
||||
moduleList: [
|
||||
{
|
||||
itemId: '',
|
||||
circuit: '',
|
||||
pcsItemId: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getUseModuleItemList = () => {
|
||||
return selectedModules.itemList.map((m) => {
|
||||
return {
|
||||
@ -210,6 +221,35 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
setAllocationType(ALLOCATION_TYPE.PASSIVITY)
|
||||
}
|
||||
|
||||
const powerConditionalSelectProps = {
|
||||
tabNum,
|
||||
setTabNum,
|
||||
makers,
|
||||
setMakers,
|
||||
selectedMaker,
|
||||
setSelectedMaker,
|
||||
series,
|
||||
setSeries,
|
||||
models,
|
||||
setModels,
|
||||
selectedModels,
|
||||
setSelectedModels,
|
||||
managementState,
|
||||
}
|
||||
|
||||
const passivityProps = {
|
||||
tabNum,
|
||||
setTabNum,
|
||||
pcsCheck,
|
||||
selectedModels,
|
||||
setSelectedModels,
|
||||
getApiProps,
|
||||
getSelectedModuleList,
|
||||
getSelectModelList,
|
||||
getRoofSurfaceList,
|
||||
getModelList,
|
||||
}
|
||||
|
||||
const stepUpProps = {
|
||||
tabNum,
|
||||
setTabNum,
|
||||
@ -223,8 +263,6 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
getPcsItemList, // PCS 아이템 목록
|
||||
}
|
||||
|
||||
console.log('🚀 ~ stepUpProps ~ stepUpProps:', stepUpProps)
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={{ x: 50, y: 230 }}>
|
||||
<div className={`modal-pop-wrap l-2`}>
|
||||
|
||||
@ -2,6 +2,7 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||
import { POLYGON_TYPE } from '@/common/common'
|
||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
import { canvasState } from '@/store/canvasAtom'
|
||||
import { moduleStatisticsState } from '@/store/circuitTrestleAtom'
|
||||
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
@ -9,7 +10,8 @@ import { useContext, useEffect, useState } from 'react'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
|
||||
export default function PassivityCircuitAllocation(props) {
|
||||
const { tabNum, setTabNum, selectedModels, pcsCheck } = props
|
||||
const { tabNum, setTabNum, selectedModels, getApiProps, getSelectedModuleList, getSelectModelList, getRoofSurfaceList, getModelList } = props
|
||||
const { swalFire } = useSwal()
|
||||
const { getMessage } = useMessage()
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
|
||||
@ -23,11 +25,15 @@ export default function PassivityCircuitAllocation(props) {
|
||||
const [footer, setFooter] = useState(['합계'])
|
||||
const [circuitNumber, setCircuitNumber] = useState(1)
|
||||
const [targetModules, setTargetModules] = useState([])
|
||||
const { pcsMaualConfChk } = useMasterController()
|
||||
const { getPcsManualConfChk } = useMasterController()
|
||||
|
||||
useEffect(() => {
|
||||
console.log('🚀 ~ PassivityCircuitAllocation ~ targetModules:', targetModules)
|
||||
}, [targetModules])
|
||||
console.log('🚀 ~ PassivityCircuitAllocation ~ selectedModels:', selectedModels)
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('🚀 ~ PassivityCircuitAllocation ~ selectedPcs:', selectedPcs)
|
||||
}, [selectedPcs])
|
||||
|
||||
const handleTargetModules = (obj) => {
|
||||
if (!Array.isArray(targetModules)) {
|
||||
@ -146,794 +152,120 @@ export default function PassivityCircuitAllocation(props) {
|
||||
}
|
||||
|
||||
const handleCircuitNumberFix = () => {
|
||||
console.log('🚀 ~ handleCircuitNumberFix ~ circuitNumber:', circuitNumber)
|
||||
console.log('🚀 ~ handleCircuitNumberFix ~ selectedPcs:', selectedPcs)
|
||||
// const params = {
|
||||
// maxConnYn: pcsCheck.max ? 'Y' : 'N',
|
||||
// smpCirYn: 'Y',
|
||||
// coldZoneYn: 'Y',
|
||||
// useModuleItemList: [{ itemId: '107077', mixMatlNo: '0' }],
|
||||
// pcsItemList: [
|
||||
// {
|
||||
// pcsMkrCd: 'MKR001',
|
||||
// pcsSerCd: 'SER001',
|
||||
// itemId: '106857',
|
||||
// itemNm: 'HQJP-KA55-5 パワーコンディショナ5.5kW屋内',
|
||||
// goodsNo: 'HQJP-KA55-5',
|
||||
// serQtyList: [
|
||||
// {
|
||||
// serQty: 5,
|
||||
// paralQty: 3,
|
||||
// rmdYn: 'Y',
|
||||
// usePossYn: 'Y',
|
||||
// roofSurfaceList: [
|
||||
// {
|
||||
// roofSurfaceId: '1',
|
||||
// roofSurface: '남서',
|
||||
// roofSurfaceIncl: '5',
|
||||
// moduleList: [
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// ],
|
||||
// cirLastIdx: 5,
|
||||
// isCirLastDupCircuit: true,
|
||||
// roofSurfacePossibleModuleCnt: 0,
|
||||
// totCirModuleWpOut: 0,
|
||||
// roofSurfaceCirModuleWpOut: 3960,
|
||||
// },
|
||||
// {
|
||||
// roofSurfaceId: '2',
|
||||
// roofSurface: '남서',
|
||||
// roofSurfaceIncl: '5',
|
||||
// moduleList: [
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: null,
|
||||
// pcsItemId: null,
|
||||
// },
|
||||
// ],
|
||||
// cirLastIdx: 3,
|
||||
// isCirLastDupCircuit: true,
|
||||
// roofSurfacePossibleModuleCnt: 1,
|
||||
// totCirModuleWpOut: 0,
|
||||
// roofSurfaceCirModuleWpOut: 2200,
|
||||
// },
|
||||
// {
|
||||
// roofSurfaceId: '3',
|
||||
// roofSurface: '남',
|
||||
// roofSurfaceIncl: '3',
|
||||
// moduleList: [
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// ],
|
||||
// cirLastIdx: 6,
|
||||
// isCirLastDupCircuit: true,
|
||||
// roofSurfacePossibleModuleCnt: 0,
|
||||
// totCirModuleWpOut: 0,
|
||||
// roofSurfaceCirModuleWpOut: 3960,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: 'MKR001',
|
||||
// pcsSerCd: 'SER001',
|
||||
// itemId: '106856',
|
||||
// itemNm: 'HQJP-KA40-5 パワーコンディショナ4.0kW屋内',
|
||||
// goodsNo: 'HQJP-KA40-5',
|
||||
// circuitCfg: '4, 4',
|
||||
// serQtyList: [
|
||||
// {
|
||||
// pcsTpCd: 'INDFCS',
|
||||
// serQty: 4,
|
||||
// paralQty: 2,
|
||||
// rmdYn: 'Y',
|
||||
// usePossYn: 'Y',
|
||||
// cirModuleWpOutSum: 3520,
|
||||
// roofSurfaceList: [
|
||||
// {
|
||||
// roofSurfaceId: '1',
|
||||
// roofSurface: '남서',
|
||||
// roofSurfaceIncl: '5',
|
||||
// moduleList: [
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-1',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-4',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// ],
|
||||
// cirLastIdx: 5,
|
||||
// isCirLastDupCircuit: true,
|
||||
// roofSurfacePossibleModuleCnt: 0,
|
||||
// totCirModuleWpOut: 0,
|
||||
// roofSurfaceCirModuleWpOut: 3960,
|
||||
// },
|
||||
// {
|
||||
// roofSurfaceId: '2',
|
||||
// roofSurface: '남서',
|
||||
// roofSurfaceIncl: '5',
|
||||
// moduleList: [
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-2',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: null,
|
||||
// pcsItemId: null,
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// roofSurfaceId: '3',
|
||||
// roofSurface: '남',
|
||||
// roofSurfaceIncl: '3',
|
||||
// moduleList: [
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '1-3',
|
||||
// pcsItemId: '106857',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// {
|
||||
// pcsMkrCd: null,
|
||||
// pcsSerCd: null,
|
||||
// applySerQty: null,
|
||||
// itemId: '107077',
|
||||
// itemTp: null,
|
||||
// wpOut: 440,
|
||||
// moduleStdVol: 42,
|
||||
// moduleColdZoneVol: null,
|
||||
// mixMatlNo: null,
|
||||
// circuit: '2-5',
|
||||
// pcsItemId: '106856',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// }
|
||||
// pcsMaualConfChk()
|
||||
canvas.discardActiveObject()
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => targetModules.includes(obj.id))
|
||||
.forEach((obj) => {
|
||||
obj.set({
|
||||
circuit: circuitNumber,
|
||||
strokeWidth: 0.3,
|
||||
})
|
||||
obj.pscId = selectedPcs.id
|
||||
obj.pscIndex = selectedModels.findIndex((model) => model.itemId === selectedPcs.itemId) + 1
|
||||
canvas.add(
|
||||
new fabric.Text(getCircuitNumber(), {
|
||||
left: obj.left + obj.width / 2,
|
||||
top: obj.top + obj.height / 2,
|
||||
fill: 'red',
|
||||
fontSize: 20,
|
||||
width: obj.width,
|
||||
height: obj.height,
|
||||
textAlign: 'center',
|
||||
originX: 'center',
|
||||
originY: 'center',
|
||||
name: 'circuitNumber',
|
||||
parentId: obj.id,
|
||||
}),
|
||||
)
|
||||
canvas.renderAll()
|
||||
console.log(obj)
|
||||
if (!circuitNumber || circuitNumber === 0) {
|
||||
swalFire({
|
||||
text: '회로번호를 1 이상입력해주세요.',
|
||||
type: 'warning',
|
||||
icon: 'warning',
|
||||
})
|
||||
setTargetModules([])
|
||||
setCircuitNumber(+circuitNumber + 1)
|
||||
canvas.renderAll()
|
||||
return
|
||||
} else if (targetModules.length === 0) {
|
||||
swalFire({
|
||||
text: '모듈을 선택해주세요.',
|
||||
type: 'warning',
|
||||
icon: 'warning',
|
||||
})
|
||||
return
|
||||
}
|
||||
const params = {
|
||||
...getApiProps(),
|
||||
useModuleItemList: getSelectedModuleList(),
|
||||
pcsItemList: getSelectModelList(),
|
||||
}
|
||||
console.log(params)
|
||||
// getPcsManualConfChk(params).then((res) => {
|
||||
// console.log(res)
|
||||
//
|
||||
// })
|
||||
|
||||
// canvas.discardActiveObject()
|
||||
//
|
||||
// canvas
|
||||
// .getObjects()
|
||||
// .filter((obj) => targetModules.includes(obj.id))
|
||||
// .forEach((obj) => {
|
||||
// const moduleCircuitText = new fabric.Text(getCircuitNumber(), {
|
||||
// left: obj.left + obj.width / 2,
|
||||
// top: obj.top + obj.height / 2,
|
||||
// fill: 'black',
|
||||
// fontSize: 20,
|
||||
// width: obj.width,
|
||||
// height: obj.height,
|
||||
// textAlign: 'center',
|
||||
// originX: 'center',
|
||||
// originY: 'center',
|
||||
// name: 'circuitNumber',
|
||||
// parentId: obj.id,
|
||||
// circuitInfo: selectedPcs,
|
||||
// })
|
||||
// obj.set({
|
||||
// strokeWidth: 0.3,
|
||||
// })
|
||||
// obj.pcsItemId = selectedPcs.itemId
|
||||
|
||||
// obj.circuit = moduleCircuitText
|
||||
// canvas.add(moduleCircuitText)
|
||||
// canvas.renderAll()
|
||||
// console.log(obj)
|
||||
// })
|
||||
// setTargetModules([])
|
||||
// setCircuitNumber(+circuitNumber + 1)
|
||||
// canvas.renderAll()
|
||||
}
|
||||
|
||||
const getCircuitNumber = () => {
|
||||
if (selectedModels.length === 1) {
|
||||
return `(${circuitNumber})`
|
||||
} else {
|
||||
return `(${selectedModels.findIndex((model) => model.itemId === selectedPcs.itemId) + 1}-${circuitNumber})`
|
||||
return `(${selectedModels.findIndex((model) => model.id === selectedPcs.id) + 1}-${circuitNumber})`
|
||||
}
|
||||
}
|
||||
|
||||
const initSelectedPcsCircuitNumber = () => {
|
||||
const modules = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber' && obj.pscId === selectedPcs.id)
|
||||
canvas.remove(...modules)
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.pscIndex === selectedPcs.id)
|
||||
.forEach((obj) => {
|
||||
obj.pscId = null
|
||||
obj.pscIndex = null
|
||||
})
|
||||
console.log(
|
||||
'module',
|
||||
canvas.getObjects().filter((obj) => obj.name === 'module'),
|
||||
)
|
||||
console.log('selectedPcs', selectedPcs)
|
||||
swalFire({
|
||||
title: '선택된 파워 컨디셔너의 회로할당을 초기화합니다.',
|
||||
type: 'confirm',
|
||||
icon: 'warning',
|
||||
confirmFn: () => {
|
||||
const circuitModules = canvas.getObjects().filter((obj) => obj.name === 'module' && obj.circuit?.circuitInfo?.id === selectedPcs.id)
|
||||
canvas.remove(...circuitModules.map((module) => module.circuit))
|
||||
circuitModules.forEach((obj) => {
|
||||
obj.circuit = null
|
||||
obj.pcsItemId = null
|
||||
})
|
||||
setTargetModules([])
|
||||
|
||||
canvas.renderAll()
|
||||
canvas.renderAll()
|
||||
canvas.discardActiveObject()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const initAllPcsCircuitNumber = () => {
|
||||
canvas.discardActiveObject()
|
||||
swalFire({
|
||||
title: '회로 할당의 설정을 초기화합니다.',
|
||||
type: 'confirm',
|
||||
icon: 'warning',
|
||||
confirmFn: () => {
|
||||
const circuitModules = canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === 'module' && selectedModels.map((model) => model.id).includes(obj.circuit?.circuitInfo?.id))
|
||||
canvas.remove(...circuitModules.map((module) => module.circuit))
|
||||
circuitModules.forEach((obj) => {
|
||||
obj.circuit = null
|
||||
obj.pcsItemId = null
|
||||
})
|
||||
setTargetModules([])
|
||||
|
||||
canvas.renderAll()
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
@ -990,10 +322,11 @@ export default function PassivityCircuitAllocation(props) {
|
||||
type="radio"
|
||||
name="radio01"
|
||||
id={`ra0${index + 1}`}
|
||||
checked={selectedPcs === model}
|
||||
value={model}
|
||||
checked={selectedPcs.id === model.id}
|
||||
onChange={() => setSelectedPcs(model)}
|
||||
/>
|
||||
<label htmlFor="ra01">
|
||||
<label htmlFor={`ra0${index + 1}`}>
|
||||
{model.itemNm} (
|
||||
{getMessage(
|
||||
'modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.info',
|
||||
@ -1044,7 +377,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
<button className="btn-frame roof mr5" onClick={() => initSelectedPcsCircuitNumber()}>
|
||||
{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional.reset')}
|
||||
</button>
|
||||
<button className="btn-frame roof mr5">
|
||||
<button className="btn-frame roof mr5" onClick={() => initAllPcsCircuitNumber()}>
|
||||
{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.all.power.conditional.reset')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -163,13 +163,12 @@ export function useMasterController() {
|
||||
*/
|
||||
const getPcsAutoRecommendList = async (params = null) => {
|
||||
return await post({ url: '/api/v1/master/getPcsAutoRecommendList', data: params }).then((res) => {
|
||||
console.log('🚀🚀 ~ getPcsAutoRecommendList ~ res:', res)
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
||||
const pcsMaualConfChk = async (params = null) => {
|
||||
return await post({ url: '/api/v1/master/pcsMaualConfChk', data: params }).then((res) => {
|
||||
const getPcsManualConfChk = async (params = null) => {
|
||||
return await post({ url: '/api/v1/master/getPcsMenualConfChk', data: params }).then((res) => {
|
||||
return res
|
||||
})
|
||||
}
|
||||
@ -213,7 +212,7 @@ export function useMasterController() {
|
||||
getPcsMakerList,
|
||||
getPcsModelList,
|
||||
getPcsAutoRecommendList,
|
||||
pcsMaualConfChk,
|
||||
getPcsManualConfChk,
|
||||
getPcsVoltageStepUpList,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user