오류 수정

This commit is contained in:
yjnoh 2025-02-08 16:22:03 +09:00
parent 22c115c92d
commit 10cd2fdda5
5 changed files with 17 additions and 15 deletions

View File

@ -56,12 +56,14 @@ export default function Module({ setTabNum }) {
}, [installHeight, verticalSnowCover])
useEffect(() => {
if (tempModuleSelectionData.roofConstructions.length > 0) {
if (tempModuleSelectionData.common.moduleItemId && isObjectNotEmpty(tempModuleSelectionData.module)) {
// temp (addedRoofs)
setModuleSelectionData(tempModuleSelectionData)
if (tempModuleSelectionData.roofConstructions.length === addedRoofs.length) {
moduleSelectedDataTrigger(tempModuleSelectionData)
if (isObjectNotEmpty(tempModuleSelectionData)) {
if (tempModuleSelectionData.roofConstructions.length > 0) {
if (tempModuleSelectionData.common.moduleItemId && isObjectNotEmpty(tempModuleSelectionData.module)) {
// temp (addedRoofs)
setModuleSelectionData(tempModuleSelectionData)
if (tempModuleSelectionData.roofConstructions.length === addedRoofs.length) {
moduleSelectedDataTrigger(tempModuleSelectionData)
}
}
}
}

View File

@ -360,7 +360,7 @@ export function useModuleBasicSetting(tabNum) {
useEffect(() => {
if (canvasSetting.roofSizeSet !== '3') {
if (moduleSelectionData.common.saleStoreNorthFlg === '1') {
if (isObjectNotEmpty(moduleSelectionData) && moduleSelectionData.common.saleStoreNorthFlg === '1') {
setSaleStoreNorthFlg(true)
}
}

View File

@ -287,7 +287,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
construction: selectedConstruction,
}
const index = tempModuleSelectionData.roofConstructions.findIndex((obj) => obj.roofIndex === tabIndex)
const index = moduleSelectionData.roofConstructions.findIndex((obj) => obj.roofIndex === tabIndex)
if (index > -1) {
const newArray = [

View File

@ -476,7 +476,7 @@ export function useCanvasSetting() {
//모듈 선택 데이터 초기화
resetModuleSelectionData()
moduleSelectedDataTrigger('')
moduleSelectedDataTrigger({ common: {}, module: {}, roofConstructions: [] })
const isModuleExist = canvas.getObjects().some((obj) => obj.name === POLYGON_TYPE.MODULE)
if (!isModuleExist) {

View File

@ -193,12 +193,12 @@ export function useCircuitTrestle() {
const tempHeader = [
{ name: getMessage('simulator.table.sub1'), prop: 'name' },
{ name: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.circuit'), prop: 'circuit' },
...moduleSelectionData.module?.itemList?.map((module) => {
return {
name: module.itemNm,
prop: module.itemId,
}
}),
// ...moduleSelectionData.module?.itemList?.map((module) => {
// return {
// name: module.itemNm,
// prop: module.itemId,
// }
// }),
{ name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' },
]
const surfaceObjects = {}