레이아웃 설치 작업
This commit is contained in:
parent
b88299b78d
commit
2bb1b71a0b
@ -275,7 +275,6 @@ export function useModuleBasicSetting(tabNum) {
|
||||
setSurfaceShapePattern(roof, roofDisplay.column, true, roof.roofMaterial) //패턴 변경
|
||||
// let offsetPoints = createPaddingPolygon(createRoofPolygon(roof.points), roof.lines).vertices //안쪽 offset
|
||||
let offsetPoints = null
|
||||
console.log(roof, roof.getCurrentPoints())
|
||||
const polygon = createRoofPolygon(roof.getCurrentPoints())
|
||||
const originPolygon = new QPolygon(roof.getCurrentPoints(), { fontSize: 0 })
|
||||
|
||||
@ -400,7 +399,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
canvas?.renderAll()
|
||||
selectedModuleInstSurfaceArray.push(setupSurface)
|
||||
|
||||
setCurrentObject({ name: 'moduleSetupSurface', arrayData: [...selectedModuleInstSurfaceArray] })
|
||||
setCurrentObject({ name: POLYGON_TYPE.MODULE_SETUP_SURFACE, arrayData: [...selectedModuleInstSurfaceArray] })
|
||||
} else {
|
||||
//선택후 재선택하면 선택안됨으로 변경
|
||||
setupSurface.set({
|
||||
@ -415,7 +414,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
const removeIndex = setupSurface.parentId
|
||||
const removeArrayIndex = selectedModuleInstSurfaceArray.findIndex((obj) => obj.parentId === removeIndex)
|
||||
selectedModuleInstSurfaceArray.splice(removeArrayIndex, 1)
|
||||
setCurrentObject({ name: 'moduleSetupSurface', arrayData: [...selectedModuleInstSurfaceArray] })
|
||||
setCurrentObject({ name: POLYGON_TYPE.MODULE_SETUP_SURFACE, arrayData: [...selectedModuleInstSurfaceArray] })
|
||||
}
|
||||
|
||||
canvas?.renderAll()
|
||||
@ -1295,22 +1294,19 @@ export function useModuleBasicSetting(tabNum) {
|
||||
return
|
||||
}
|
||||
|
||||
let alertMessage = ''
|
||||
let isPassed = true
|
||||
if (isMultipleModules) {
|
||||
layoutSetupRef.forEach((item, index) => {
|
||||
const moduleInfo = trestlePolygon.trestleDetail.module[index]
|
||||
if (item.row > moduleInfo.mixModuleMaxRows) {
|
||||
alertMessage = getMessage('module.layout.setup.max.count.multiple', [index + 1, moduleInfo.mixModuleMaxRows, maxCol])
|
||||
isPassed = false
|
||||
}
|
||||
// 혼합일때 모듈 개별의 row를 체크함
|
||||
const isPassedObject =
|
||||
isMultipleModules && layoutSetupRef.find((item, index) => item.row > trestlePolygon.trestleDetail.module[index].mixModuleMaxRows)
|
||||
|
||||
if (isPassedObject) {
|
||||
swalFire({
|
||||
text: getMessage('module.layout.setup.max.count.multiple', [
|
||||
layoutSetupRef.indexOf(isPassedObject) + 1,
|
||||
trestlePolygon.trestleDetail.module[layoutSetupRef.indexOf(isPassedObject)].mixModuleMaxRows,
|
||||
maxCol,
|
||||
]),
|
||||
icon: 'warning',
|
||||
})
|
||||
}
|
||||
|
||||
console.log(alertMessage)
|
||||
|
||||
if (!isPassed) {
|
||||
swalFire({ text: alertMessage, icon: 'warning' })
|
||||
return
|
||||
}
|
||||
|
||||
@ -1340,6 +1336,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
|
||||
//그려진 가이드 라인의 포인트를 기준으로 시작점을 만든다
|
||||
//남쪽에 처마방향이나 북쪽에 용마루면
|
||||
//tempModule에 좌,하 좌표를 기준으로 우측으로 위로 그림
|
||||
if ((flowDirection === 'south' && setupLocation === 'eaves') || (flowDirection === 'north' && setupLocation === 'ridge')) {
|
||||
//남
|
||||
startX = toFixedWithoutRounding(tempModule.left, 1)
|
||||
@ -1438,6 +1435,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
}
|
||||
}
|
||||
//북쪽에 처마거나 남쪽에 용마루일경우
|
||||
//tempModule에 우,상 좌표를 기준으로 좌측으로 아래로 그림
|
||||
} else if ((flowDirection === 'north' && setupLocation === 'eaves') || (flowDirection === 'south' && setupLocation === 'ridge')) {
|
||||
//북북
|
||||
startX = toFixedWithoutRounding(tempModule.left + tempModule.width, 1)
|
||||
@ -1531,6 +1529,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
}
|
||||
}
|
||||
//서쪽에 처마 또는 동쪽의 용마루일경우
|
||||
//tempModule에 좌,상 좌표를 기준으로 아래로 좌측으로 그림
|
||||
} else if ((flowDirection === 'west' && setupLocation === 'eaves') || (flowDirection === 'east' && setupLocation === 'ridge')) {
|
||||
startX = toFixedWithoutRounding(tempModule.left, 1)
|
||||
startY = toFixedWithoutRounding(tempModule.top, 1)
|
||||
@ -1623,6 +1622,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
}
|
||||
}
|
||||
//동쪽의 처마 또는 서쪽의 용마루일경우
|
||||
//tempModule에 우,하 좌표를 기준으로 위로 우측으로 그림
|
||||
} else if ((flowDirection === 'east' && setupLocation === 'eaves') || (flowDirection === 'west' && setupLocation === 'ridge')) {
|
||||
startX = toFixedWithoutRounding(tempModule.left + width, 1)
|
||||
startY = toFixedWithoutRounding(tempModule.top + height, 1)
|
||||
@ -1715,6 +1715,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
}
|
||||
}
|
||||
})
|
||||
//그림자가 있다면 무조건 그림자를 가장 앞으로 올림
|
||||
const shadowObj = canvas?.getObjects().find((obj) => obj.name === BATCH_TYPE.SHADOW)
|
||||
if (shadowObj) {
|
||||
shadowObj.bringToFront()
|
||||
@ -1751,7 +1752,6 @@ export function useModuleBasicSetting(tabNum) {
|
||||
const isChidori = moduleSetupOption.isChidori
|
||||
const setupLocation = moduleSetupOption.setupLocation
|
||||
const isMaxSetup = false
|
||||
// const isMaxSetup = placementRef.isMaxSetup.current === 'true' ? true : false
|
||||
|
||||
const moduleSetupSurfaces = moduleSetupSurface //선택 설치면
|
||||
const notSelectedTrestlePolygons = canvas
|
||||
@ -1767,24 +1767,11 @@ export function useModuleBasicSetting(tabNum) {
|
||||
|
||||
//어짜피 자동으로 누르면 선택안된데도 다 날아간다
|
||||
canvas.getObjects().forEach((obj) => {
|
||||
if (obj.name === 'module') {
|
||||
if (obj.name === POLYGON_TYPE.MODULE) {
|
||||
canvas.remove(obj)
|
||||
}
|
||||
})
|
||||
|
||||
// if (moduleIsSetup.length > 0) {
|
||||
// swalFire({ text: 'alert 아이콘 테스트입니다.', icon: 'error' })
|
||||
// }
|
||||
|
||||
// moduleSetupSurfaces.forEach((obj) => {
|
||||
// if (obj.modules) {
|
||||
// obj.modules.forEach((module) => {
|
||||
// canvas?.remove(module)
|
||||
// })
|
||||
// obj.modules = []
|
||||
// }
|
||||
// })
|
||||
|
||||
notSelectedTrestlePolygons.forEach((obj) => {
|
||||
if (obj.modules) {
|
||||
obj.modules.forEach((module) => {
|
||||
@ -1803,7 +1790,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
lockRotation: true, // 회전 잠금
|
||||
lockScalingX: true, // X 축 크기 조정 잠금
|
||||
lockScalingY: true, // Y 축 크기 조정 잠금
|
||||
name: 'module',
|
||||
name: POLYGON_TYPE.MODULE,
|
||||
}
|
||||
|
||||
//선택된 지붕안에 오브젝트(도머, 개구등)이 있는지 확인하는 로직 포함되면 배열 반환
|
||||
@ -2437,37 +2424,8 @@ export function useModuleBasicSetting(tabNum) {
|
||||
if (moduleSetupSurface.direction === 'north') {
|
||||
downFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, containsBatchObjects, false, intvHor, intvVer)
|
||||
}
|
||||
} else if (setupLocation === 'center') {
|
||||
//중가면
|
||||
if (moduleSetupSurface.direction === 'south') {
|
||||
downFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, containsBatchObjects, true, intvHor, intvVer)
|
||||
}
|
||||
if (moduleSetupSurface.direction === 'west') {
|
||||
leftFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, containsBatchObjects, true, intvHor, intvVer)
|
||||
}
|
||||
if (moduleSetupSurface.direction === 'east') {
|
||||
rightFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, containsBatchObjects, true, intvHor, intvVer)
|
||||
}
|
||||
if (moduleSetupSurface.direction === 'north') {
|
||||
topFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, containsBatchObjects, true, intvHor, intvVer)
|
||||
}
|
||||
}
|
||||
|
||||
// const setupedModules = moduleSetupArray.filter((module, index) => {
|
||||
// let disjointFromTrestle = checkModuleDisjointSurface(module.turfPoints, turfModuleSetupSurface)
|
||||
// let isDisjoint = checkModuleDisjointObjects(module.turfPoints, containsBatchObjects)
|
||||
|
||||
// if (!(disjointFromTrestle && isDisjoint)) {
|
||||
// canvas?.remove(module)
|
||||
// // module.set({ fill: 'rgba(255,190,41, 0.4)', stroke: 'black', strokeWidth: 1 })
|
||||
// return false
|
||||
// } else {
|
||||
// return module
|
||||
// }
|
||||
// })
|
||||
|
||||
// canvas?.renderAll()
|
||||
|
||||
//나간애들 제외하고 설치된 애들로 겹친애들 삭제 하기
|
||||
moduleSetupArray.forEach((module, index) => {
|
||||
if (isMaxSetup && index > 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user