Compare commits

..

No commits in common. "f89c9e6be685b213a09cc08eb5cfce66e3d34e01" and "032fb8414fe032a6d63cf18db92b61b7122e77ce" have entirely different histories.

View File

@ -90,13 +90,9 @@ export const useTrestle = () => {
let rackInfos = [] let rackInfos = []
if (rack) { if (rack) {
console.log('Original rack data:', rack)
rackInfos = Object.keys(rack).map((key) => { rackInfos = Object.keys(rack).map((key) => {
return { key, value: rack[key] } return { key, value: rack[key] }
}) })
console.log('Processed rackInfos:', rackInfos)
} else {
console.log('Rack is null or undefined')
} }
// 모듈들의 centerPoint들을 이용해 각 모듈의 정보(가장 아랫라인 모듈, 가장 윗라인 모듈, 접면, 반접면 등 계산) // 모듈들의 centerPoint들을 이용해 각 모듈의 정보(가장 아랫라인 모듈, 가장 윗라인 모듈, 접면, 반접면 등 계산)
@ -455,16 +451,6 @@ export const useTrestle = () => {
})?.value.racks })?.value.racks
mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule) mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule)
console.log('=== Debug rackInfos ===')
console.log('rackInfos:', rackInfos)
console.log('leftRowsInfo:', leftRowsInfo)
console.log('rightRowsInfo:', rightRowsInfo)
console.log('centerRowsInfo:', centerRowsInfo)
console.log('leftRacks:', leftRacks)
console.log('rightRacks:', rightRacks)
console.log('centerRacks:', centerRacks)
console.log('rackYn:', rackYn)
console.log('========================')
if (rackYn === 'Y') { if (rackYn === 'Y') {
drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn) drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
@ -1096,19 +1082,14 @@ export const useTrestle = () => {
const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => { const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => {
const { width, height, left, top, lastX, lastY, surfaceId } = module const { width, height, left, top, lastX, lastY, surfaceId } = module
const surface = canvas.getObjects().find((obj) => obj.id === surfaceId) const surface = canvas.getObjects().find((obj) => obj.id === surfaceId)
// if (!rackInfos) {
// const maxRows = surface.trestleDetail.moduleMaxRows
// const maxCols = surface.trestleDetail.moduleMaxCols
// const msg = `段数の上限は${maxRows}段です。 上限より上の段には設置できません`
// swalFire({ title: msg, type: 'alert' })
// throw new Error('rackInfos is null')
// }
if (!rackInfos) { if (!rackInfos) {
const msg = '該当モジュールタイプに関するラック情報がありません。' const maxRows = surface.trestleDetail.moduleMaxRows
const maxCols = surface.trestleDetail.moduleMaxCols
const msg = `段数の上限は${maxRows}段です。 上限より上の段には設置できません`
swalFire({ title: msg, type: 'alert' }) swalFire({ title: msg, type: 'alert' })
return throw new Error('rackInfos is null')
} }
const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId) const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId)
const degree = getDegreeByChon(roof.roofMaterial.pitch) const degree = getDegreeByChon(roof.roofMaterial.pitch)
rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경 rackIntvlPct = rackIntvlPct === 0 ? 1 : rackIntvlPct // 0인 경우 1로 변경