[1444]육지봉 TypeError: Cannot destructure property 'rackYn' of 'trestleDetail' as it is null.
This commit is contained in:
parent
331a85f998
commit
552cd7cc26
@ -124,6 +124,9 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
*/
|
||||
const validateModuleSizeForRack = (surface) => {
|
||||
const { modules, direction, trestleDetail } = surface
|
||||
if (!trestleDetail) {
|
||||
return true // 상세 정보 없음
|
||||
}
|
||||
const { rackYn, moduleIntvlHor, moduleIntvlVer } = trestleDetail
|
||||
|
||||
if (rackYn === 'N' || !modules || modules.length < 2) {
|
||||
|
||||
@ -749,7 +749,7 @@ export function useModule() {
|
||||
const copyModules = []
|
||||
const moduleSetupSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.id === activeModule.surfaceId)
|
||||
let isWarning = false
|
||||
const { moduleIntvlHor, moduleIntvlVer } = moduleSetupSurface.trestleDetail
|
||||
const { moduleIntvlHor = 0, moduleIntvlVer = 0 } = moduleSetupSurface.trestleDetail || {}
|
||||
canvas.discardActiveObject()
|
||||
targetModules.forEach((module) => {
|
||||
const { top, left } = getPosotion(module, type, moduleIntvlHor, true)
|
||||
@ -859,7 +859,7 @@ export function useModule() {
|
||||
const copyModules = []
|
||||
const moduleSetupSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.id === activeModule.surfaceId)
|
||||
let isWarning = false
|
||||
const { moduleIntvlHor, moduleIntvlVer } = moduleSetupSurface.trestleDetail
|
||||
const { moduleIntvlHor = 0, moduleIntvlVer = 0 } = moduleSetupSurface.trestleDetail || {}
|
||||
canvas.discardActiveObject()
|
||||
targetModules.forEach((module) => {
|
||||
const { top, left } = getPosotion(module, type, moduleIntvlVer, true)
|
||||
|
||||
@ -338,10 +338,27 @@ export function useModuleBasicSetting(tabNum) {
|
||||
})
|
||||
|
||||
let isNorth = false
|
||||
const defaultTrestleDetail = {
|
||||
rackYn: 'N',
|
||||
moduleIntvlHor: +roofSizeSet === 3 ? 300 : 0,
|
||||
moduleIntvlVer: +roofSizeSet === 3 ? 100 : 0,
|
||||
rack: null,
|
||||
rackQty: 0,
|
||||
rackIntvlPct: 0,
|
||||
cvrPlvrYn: 'N',
|
||||
lessSupFitIntvlPct: 0,
|
||||
lessSupFitQty: 0,
|
||||
}
|
||||
|
||||
const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id)
|
||||
const normalizedTrestleDetail = trestleDetail
|
||||
? { ...defaultTrestleDetail, ...trestleDetail }
|
||||
: isExistSurface?.trestleDetail
|
||||
? { ...defaultTrestleDetail, ...isExistSurface.trestleDetail }
|
||||
: defaultTrestleDetail
|
||||
|
||||
if (isExistSurface) {
|
||||
isExistSurface.set({ trestleDetail: normalizedTrestleDetail })
|
||||
if (canvasSetting.roofSizeSet != '3') {
|
||||
//북면이 있지만
|
||||
if (roof.directionText && roof.directionText.indexOf('北') > -1) {
|
||||
@ -424,7 +441,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
originY: 'center',
|
||||
modules: [],
|
||||
roofMaterial: roof.roofMaterial,
|
||||
trestleDetail: trestleDetail,
|
||||
trestleDetail: normalizedTrestleDetail,
|
||||
isNorth: isNorth,
|
||||
perPixelTargetFind: true,
|
||||
isSaleStoreNorthFlg: moduleSelectionData.common.saleStoreNorthFlg == '1' ? true : false, //북면설치가능점 여부
|
||||
|
||||
@ -65,6 +65,10 @@ export const useTrestle = () => {
|
||||
if (+roofSizeSet === 3) {
|
||||
return
|
||||
}
|
||||
const trestleDetail = surface.trestleDetail
|
||||
if (!trestleDetail) {
|
||||
return
|
||||
}
|
||||
const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction
|
||||
if (!construction) {
|
||||
return
|
||||
@ -76,8 +80,8 @@ export const useTrestle = () => {
|
||||
let isSnowGuard = construction.setupSnowCover
|
||||
let cvrLmtRow = construction.cvrLmtRow
|
||||
const direction = parent.direction
|
||||
const rack = surface.trestleDetail.rack
|
||||
let { rackQty, rackIntvlPct, rackYn, cvrPlvrYn, lessSupFitIntvlPct, lessSupFitQty } = surface.trestleDetail
|
||||
const rack = trestleDetail.rack
|
||||
let { rackQty, rackIntvlPct, rackYn, cvrPlvrYn, lessSupFitIntvlPct, lessSupFitQty } = trestleDetail
|
||||
|
||||
if (!rack && lessSupFitIntvlPct === 0 && lessSupFitQty === 0) {
|
||||
//25/02/06 가대없음의 경우 랙정보가 없음
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user