PassivityCircuitAllocation에 전달하던 미사용 ref prop 제거
passivityCircuitAllocationRef (useRef) 선언 제거 원인: function component에 ref 전달 시 React warning 발생 (forwardRef 미사용) PCS 접속함 응답에 추가된 moduleTpCd 필드를 Cross Mix 식별을 위해 프론트 상태 보존 및 getQuotationItem 제출 파라미터까지 흘려보내고, dedupe 키를 (itemId, moduleTpCd) 조합으로 변경.
This commit is contained in:
parent
eaf6bcb3d3
commit
558769063b
@ -58,7 +58,6 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
const { setModuleStatisticsData } = useCircuitTrestle()
|
const { setModuleStatisticsData } = useCircuitTrestle()
|
||||||
const { handleCanvasToPng } = useImgLoader()
|
const { handleCanvasToPng } = useImgLoader()
|
||||||
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
|
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
|
||||||
const passivityCircuitAllocationRef = useRef()
|
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
const originCanvasViewPortTransform = useRef([])
|
const originCanvasViewPortTransform = useRef([])
|
||||||
@ -844,9 +843,16 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
pcsItemId: item.itemId,
|
pcsItemId: item.itemId,
|
||||||
pscOptCd: getPcsOptCd(index),
|
pscOptCd: getPcsOptCd(index),
|
||||||
paralQty: serQty.paralQty,
|
paralQty: serQty.paralQty,
|
||||||
// 접속함 중복 체크: 동일 itemId는 1개만, 다르면 각각 올림
|
// 접속함 중복 체크: (itemId, moduleTpCd) 조합 기준으로 dedupe (Cross Mix 구분)
|
||||||
connections: item.connList?.length
|
connections: item.connList?.length
|
||||||
? [...new Map(item.connList.map((conn) => [conn.itemId, { connItemId: conn.itemId, connMaxParalCnt: conn.connMaxParalCnt }])).values()]
|
? [
|
||||||
|
...new Map(
|
||||||
|
item.connList.map((conn) => [
|
||||||
|
`${conn.itemId}_${conn.moduleTpCd}`,
|
||||||
|
{ connItemId: conn.itemId, connMaxParalCnt: conn.connMaxParalCnt, moduleTpCd: conn.moduleTpCd },
|
||||||
|
]),
|
||||||
|
).values(),
|
||||||
|
]
|
||||||
: [],
|
: [],
|
||||||
})
|
})
|
||||||
// return {
|
// return {
|
||||||
@ -1041,7 +1047,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
</div>
|
</div>
|
||||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && <PowerConditionalSelect {...powerConditionalSelectProps} />}
|
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && <PowerConditionalSelect {...powerConditionalSelectProps} />}
|
||||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && (
|
{tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && (
|
||||||
<PassivityCircuitAllocation {...passivityProps} ref={passivityCircuitAllocationRef} isFold={isFold} />
|
<PassivityCircuitAllocation {...passivityProps} isFold={isFold} />
|
||||||
)}
|
)}
|
||||||
{tabNum === 2 && <StepUp {...stepUpProps} onInitialize={handleStepUpInitialize} />}
|
{tabNum === 2 && <StepUp {...stepUpProps} onInitialize={handleStepUpInitialize} />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -345,6 +345,7 @@ export default function StepUp(props) {
|
|||||||
itemId: conn.itemId ?? '',
|
itemId: conn.itemId ?? '',
|
||||||
itemNm: conn.itemNm ?? '',
|
itemNm: conn.itemNm ?? '',
|
||||||
vstuParalCnt: conn.vstuParalCnt ?? 0,
|
vstuParalCnt: conn.vstuParalCnt ?? 0,
|
||||||
|
moduleTpCd: conn.moduleTpCd,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,15 +586,16 @@ export default function StepUp(props) {
|
|||||||
pcsItemId: serQty.itemId,
|
pcsItemId: serQty.itemId,
|
||||||
pcsOptCd: seletedOption,
|
pcsOptCd: seletedOption,
|
||||||
paralQty: serQty.paralQty,
|
paralQty: serQty.paralQty,
|
||||||
// 접속함 중복 체크: 동일 itemId는 1개만, 다르면 각각 올림
|
// 접속함 중복 체크: (itemId, moduleTpCd) 조합 기준으로 dedupe
|
||||||
connections: item.connList?.length
|
connections: item.connList?.length
|
||||||
? [
|
? [
|
||||||
...new Map(
|
...new Map(
|
||||||
item.connList.map((conn) => [
|
item.connList.map((conn) => [
|
||||||
conn.itemId,
|
`${conn.itemId}_${conn.moduleTpCd}`,
|
||||||
{
|
{
|
||||||
connItemId: conn.itemId,
|
connItemId: conn.itemId,
|
||||||
connMaxParalCnt: conn.connMaxParalCnt,
|
connMaxParalCnt: conn.connMaxParalCnt,
|
||||||
|
moduleTpCd: conn.moduleTpCd,
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
).values(),
|
).values(),
|
||||||
|
|||||||
@ -264,6 +264,8 @@ export function useMasterController() {
|
|||||||
*/
|
*/
|
||||||
const getPcsAutoRecommendList = async (params = null) => {
|
const getPcsAutoRecommendList = async (params = null) => {
|
||||||
return await post({ url: '/api/v1/master/getPcsAutoRecommendList', data: params }).then((res) => {
|
return await post({ url: '/api/v1/master/getPcsAutoRecommendList', data: params }).then((res) => {
|
||||||
|
console.log('[moduleTpCd] getPcsAutoRecommendList req:', params)
|
||||||
|
console.log('[moduleTpCd] getPcsAutoRecommendList res pcsItemList:', res?.data?.pcsItemList?.map((p) => ({ itemId: p.itemId, pcsTpCd: p.pcsTpCd, connList: p.connList?.map((c) => ({ itemId: c.itemId, moduleTpCd: c.moduleTpCd })) })))
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -286,6 +288,8 @@ export function useMasterController() {
|
|||||||
*/
|
*/
|
||||||
const getPcsVoltageChk = async (params = null) => {
|
const getPcsVoltageChk = async (params = null) => {
|
||||||
return await post({ url: '/api/v1/master/getPcsVoltageChk', data: params }).then((res) => {
|
return await post({ url: '/api/v1/master/getPcsVoltageChk', data: params }).then((res) => {
|
||||||
|
console.log('[moduleTpCd] getPcsVoltageChk req:', params)
|
||||||
|
console.log('[moduleTpCd] getPcsVoltageChk res pcsItemList:', res?.data?.pcsItemList?.map((p) => ({ itemId: p.itemId, pcsTpCd: p.pcsTpCd, connList: p.connList?.map((c) => ({ itemId: c.itemId, moduleTpCd: c.moduleTpCd })) })))
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -322,11 +326,15 @@ export function useMasterController() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return await post({ url: '/api/v1/master/getPcsVoltageStepUpList', data: params }).then((res) => {
|
return await post({ url: '/api/v1/master/getPcsVoltageStepUpList', data: params }).then((res) => {
|
||||||
|
console.log('[moduleTpCd] getPcsVoltageStepUpList req:', params)
|
||||||
|
console.log('[moduleTpCd] getPcsVoltageStepUpList res pcsItemList:', res?.data?.pcsItemList?.map((p) => ({ itemId: p.itemId, pcsTpCd: p.pcsTpCd, connList: p.connList?.map((c) => ({ itemId: c.itemId, moduleTpCd: c.moduleTpCd })) })))
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getQuotationItem = async (params) => {
|
const getQuotationItem = async (params) => {
|
||||||
|
console.log('[moduleTpCd] getQuotationItem req pcses.connections:', params?.pcses?.map((p) => ({ pcsItemId: p.pcsItemId, connections: p.connections })))
|
||||||
|
console.log('[moduleTpCd] getQuotationItem full req:', params)
|
||||||
return await post({ url: '/api/v1/master/getQuotationItem', data: params })
|
return await post({ url: '/api/v1/master/getQuotationItem', data: params })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res
|
return res
|
||||||
@ -355,6 +363,8 @@ export function useMasterController() {
|
|||||||
*/
|
*/
|
||||||
const getPcsConnOptionItemList = async (params = null) => {
|
const getPcsConnOptionItemList = async (params = null) => {
|
||||||
return await post({ url: '/api/v1/master/getPcsConnOptionItemList', data: params }).then((res) => {
|
return await post({ url: '/api/v1/master/getPcsConnOptionItemList', data: params }).then((res) => {
|
||||||
|
console.log('[moduleTpCd] getPcsConnOptionItemList req:', params)
|
||||||
|
console.log('[moduleTpCd] getPcsConnOptionItemList res pcsItemList:', res?.data?.pcsItemList?.map((p) => ({ itemId: p.itemId, pcsTpCd: p.pcsTpCd, connList: p.connList?.map((c) => ({ itemId: c.itemId, moduleTpCd: c.moduleTpCd })) })))
|
||||||
return res
|
return res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user