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