dev #170

Merged
ysCha merged 3 commits from dev into prd-deploy 2025-07-03 15:14:58 +09:00
2 changed files with 26 additions and 21 deletions
Showing only changes of commit c4c773f929 - Show all commits

View File

@ -199,9 +199,9 @@ export function useModuleBasicSetting(tabNum) {
const calculateHeightRate = 1 / Math.cos((degree * Math.PI) / 180)
const calculateValue = calculateHeightRate / calculateExpression(degree)
const eavesResult = +roofSizeSet === 1 ? (data.eavesMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.eavesMargin / 10
const ridgeResult = +roofSizeSet === 1 ? (data.ridgeMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.ridgeMargin / 10
const kerabaMargin = +roofSizeSet === 1 && isDiagonal ? data.kerabaMargin / calculateValue / 10 : data.kerabaMargin / 10
const eavesResult = from === 'roofCover' ? (data.eavesMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.eavesMargin / 10
const ridgeResult = from === 'roofCover' ? (data.ridgeMargin * Math.cos((degree * Math.PI) / 180)) / 10 : data.ridgeMargin / 10
const kerabaMargin = from === 'roofCover' && isDiagonal ? data.kerabaMargin / calculateValue / 10 : data.kerabaMargin / 10
switch (line.attributes.type) {
case LINE_TYPE.WALLLINE.EAVES:
@ -359,6 +359,7 @@ export function useModuleBasicSetting(tabNum) {
perPixelTargetFind: true,
isSaleStoreNorthFlg: moduleSelectionData.common.saleStoreNorthFlg == '1' ? true : false, //북면설치가능점 여부
// angle: -compasDeg,
from: roof.from ?? '',
})
setupSurface.setViewLengthText(false)
@ -532,6 +533,7 @@ export function useModuleBasicSetting(tabNum) {
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
//배치면이 여러개 일때 옮겨가면서 동작해야함
const moduleSetupSurface = moduleSetupSurfaces[i]
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i])
trestlePolygon = moduleSetupSurfaces[i]
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
@ -543,7 +545,7 @@ export function useModuleBasicSetting(tabNum) {
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
let { width, height } =
canvasSetting.roofSizeSet == '1'
moduleSetupSurface.from === 'roofCover'
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
: { width: tmpWidth, height: tmpHeight }
@ -923,6 +925,7 @@ export function useModuleBasicSetting(tabNum) {
}
}
//단 열수 지정배치
const manualModuleLayoutSetup = (layoutSetupRef) => {
const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴
@ -1023,6 +1026,7 @@ export function useModuleBasicSetting(tabNum) {
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
//배치면이 여러개 일때 옮겨가면서 동작해야함
const moduleSetupSurface = moduleSetupSurfaces[i]
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i])
trestlePolygon = moduleSetupSurfaces[i]
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
@ -1036,11 +1040,11 @@ export function useModuleBasicSetting(tabNum) {
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
width =
canvasSetting.roofSizeSet == '1'
moduleSetupSurface.from === 'roofCover'
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection).width
: tmpWidth
height =
canvasSetting.roofSizeSet == '1'
moduleSetupSurface.from === 'roofCover'
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection).height
: tmpHeight
@ -1363,11 +1367,11 @@ export function useModuleBasicSetting(tabNum) {
//복시도, 실치수에 따른 모듈 높이 조정
width =
canvasSetting.roofSizeSet == '1'
trestlePolygon.from === 'roofCover'
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(trestlePolygon.roofMaterial.pitch), flowDirection).width
: tmpWidth
height =
canvasSetting.roofSizeSet == '1'
trestlePolygon.from === 'roofCover'
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(trestlePolygon.roofMaterial.pitch), flowDirection).height
: tmpHeight
@ -3230,6 +3234,7 @@ export function useModuleBasicSetting(tabNum) {
const mousePoint = canvas.getPointer(e.e)
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
const moduleSetupSurface = moduleSetupSurfaces[i]
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i], true)
trestlePolygon = moduleSetupSurfaces[i]
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
@ -3242,7 +3247,7 @@ export function useModuleBasicSetting(tabNum) {
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
let { width, height } =
canvasSetting.roofSizeSet == '1'
moduleSetupSurface.from === 'roofCover'
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
: { width: tmpWidth, height: tmpHeight }
@ -3960,7 +3965,7 @@ export function useModuleBasicSetting(tabNum) {
10
}
return canvasSetting.roofSizeSet == '1'
return moduleSetupSurface.from === 'roofCover'
? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurface.roofMaterial.pitch), moduleSetupSurface.direction)
: { width: tmpWidth, height: tmpHeight }
}

View File

@ -1156,12 +1156,12 @@ export const useTrestle = () => {
case 'south': {
rackInfos.forEach((rackInfo) => {
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
let rackLength = getTrestleLength(rackLen, degree) / 10
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
if (smartRackYn === 'Y') {
let smartRackId = uuidv4()
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
name: TRESTLE_MATERIAL.SMART_RACK,
@ -1230,11 +1230,11 @@ export const useTrestle = () => {
rackInfos.forEach((rackInfo) => {
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
let rackLength = getTrestleLength(rackLen, degree) / 10
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
if (smartRackYn === 'Y') {
let smartRackId = uuidv4()
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
name: TRESTLE_MATERIAL.SMART_RACK,
@ -1302,11 +1302,11 @@ export const useTrestle = () => {
case 'west': {
rackInfos.forEach((rackInfo) => {
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
let rackLength = getTrestleLength(rackLen, degree) / 10
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
if (smartRackYn === 'Y') {
let smartRackId = uuidv4()
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
name: TRESTLE_MATERIAL.SMART_RACK,
@ -1372,11 +1372,11 @@ export const useTrestle = () => {
case 'north': {
rackInfos.forEach((rackInfo) => {
const { rackLen, itemId, supFitQty, supFitIntvlPct, rackRowsCd, smartRack, smartRackYn } = rackInfo
let rackLength = getTrestleLength(rackLen, degree) / 10
let rackLength = getTrestleLength(rackLen, degree, surface) / 10
if (smartRackYn === 'Y') {
let smartRackId = uuidv4()
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
rackLength = getTrestleLength(setRackTpLen, degree) / 10
rackLength = getTrestleLength(setRackTpLen, degree, surface) / 10
if (setRackTpCd === 'RACK') {
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
name: TRESTLE_MATERIAL.SMART_RACK,
@ -2478,9 +2478,9 @@ export const useTrestle = () => {
}
// 각도에 따른 길이 반환
function getTrestleLength(length, degree) {
if (+roofSizeSet !== 1) {
// 복시도 입력이 아닌경우 그냥 길이 return
function getTrestleLength(length, degree, surface) {
if (surface.from !== 'roofCover') {
// 지붕덮개로부터 온게 아니면 그냥 length 리턴
return length
}
const radians = (degree * Math.PI) / 180