메뉴 우상단 지붕재 정보 노출 오류 수정

This commit is contained in:
changkyu choi 2025-01-21 14:48:14 +09:00
parent 8d6a934717
commit 71abfe469d
4 changed files with 87 additions and 9 deletions

View File

@ -16,7 +16,7 @@ export default function StepUp({}) {
const [arrayLength, setArrayLength] = useState(3) //module-table-inner
const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState)
const model = useRecoilValue(modelState)
const { getPcsAutoRecommendList } = useMasterController()
const { getPcsVoltageStepUpList } = useMasterController()
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
const canvas = useRecoilValue(canvasState)
const selectedModules = useRecoilValue(selectedModuleState)
@ -64,7 +64,7 @@ export default function StepUp({}) {
roofSurfaceList: roofSurfaceList,
pscItemList: pscItemList,
}
getPcsAutoRecommendList(params)
getPcsVoltageStepUpList(null)
}, [])
useCanvasPopupStatusController(6)

View File

@ -147,7 +147,7 @@ export function useMasterController() {
],
}
return await post({ url: '/api/v1/master/getPcsSeriesItemList', data: params }).then((res) => {
return await post({ url: '/api/v1/master/getPcsSeriesItemList', data: test }).then((res) => {
return res
})
}
@ -169,6 +169,82 @@ export function useMasterController() {
})
}
/**
* PCS 승압설정 정보 조회
* @param {Max접속(과적)여부} maxConnYn
* @param {동일회로도여부} smpCirYn
* @param {한랭지여부} coldZoneYn
* @param {사용된 모듈아이템 목록} useModuleItemList
* @param {지붕면 목록} roofSurfaceList
* @param {PCS 아이템 목록} pcsItemList
* @returns
*/
const getPcsVoltageStepUpList = async (params2 = null) => {
const params = {
maxConnYn: 'N',
smpCirYn: 'Y',
coldZoneYn: 'N',
useModuleItemList: [{ itemId: '107077', mixMatlNo: '0' }],
roofSurfaceList: [
{
roofSurfaceId: '1',
roofSurface: '남서',
roofSurfaceIncl: '5',
moduleList: [
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
],
},
{
roofSurfaceId: '2',
roofSurface: '남서',
roofSurfaceIncl: '5',
moduleList: [
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
],
},
{
roofSurfaceId: '3',
roofSurface: '남',
roofSurfaceIncl: '3',
moduleList: [
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
{ itemId: '107077' },
],
},
],
pcsItemList: [
{ itemId: '106857', pcsMkrCd: 'MKR001', pcsSerCd: 'SER001' },
{ itemId: '106856', pcsMkrCd: 'MKR001', pcsSerCd: 'SER001' },
],
}
return await post({ url: '/api/v1/master/getPcsVoltageStepUpList', data: params }).then((res) => {
console.log('🚀🚀 ~ getPcsVoltageStepUpList ~ res:', res)
return res
})
}
return {
getRoofMaterialList,
getModuleTypeItemList,
@ -178,5 +254,6 @@ export function useMasterController() {
getPcsMakerList,
getPcsModelList,
getPcsAutoRecommendList,
getPcsVoltageStepUpList,
}
}

View File

@ -316,7 +316,7 @@ export function useCanvasSetting() {
roofsArray = res.map((item) => {
return {
roofApply: item.roofApply,
roofSeq: 0,
roofSeq: item.roofSeq,
roofMatlCd: item.roofMatlCd,
roofWidth: item.roofWidth,
roofHeight: item.roofHeight,
@ -381,16 +381,16 @@ export function useCanvasSetting() {
roofSizeSet: roofsRow[0].roofSizeSet,
roofAngleSet: roofsRow[0].roofAngleSet,
roofsData: roofsArray,
selectedRoofMaterial: addRoofs[0],
selectedRoofMaterial: addRoofs.find((roof) => roof.selected),
})
})
} catch (error) {
console.error('Data fetching error:', error)
}
if (!(Object.keys(canvasSetting).length === 0 && canvasSetting.constructor === Object)) {
setBasicSettings({ ...canvasSetting })
}
// if (!(Object.keys(canvasSetting).length === 0 && canvasSetting.constructor === Object)) {
// setBasicSettings({ ...canvasSetting })
// }
setCanvasSetting({ ...basicSetting })
}

View File

@ -169,6 +169,7 @@ export function useRoofAllocationSetting(id) {
roofSizeSet: res[0].roofSizeSet,
roofAngleSet: res[0].roofAngleSet,
roofsData: roofsArray,
selectedRoofMaterial: selectRoofs.find((roof) => roof.selected),
})
setBasicInfo({
roofSizeSet: '' + res[0].roofSizeSet,
@ -188,7 +189,7 @@ export function useRoofAllocationSetting(id) {
roofSizeSet: Number(basicSetting.roofSizeSet),
roofAngleSet: basicSetting.roofAngleSet,
roofAllocationList: currentRoofList.map((item, index) => ({
roofApply: item.selected === null || item.selected === undefined ? 'true' : item.selected,
roofApply: item.selected,
roofSeq: index,
roofMatlCd: item.roofMatlCd === null || item.roofMatlCd === undefined ? 'ROOF_ID_WA_53A' : item.roofMatlCd,
roofWidth: item.width === null || item.width === undefined ? 0 : Number(item.width),