모듈 자동 레이아웃 설치 validate 작업중
This commit is contained in:
parent
1c7b81c99f
commit
ed27f2ed93
@ -125,6 +125,11 @@ export const TRESTLE_MATERIAL = {
|
|||||||
BRACKET: 'bracket',
|
BRACKET: 'bracket',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const MODULE_SETUP_TYPE = {
|
||||||
|
LAYOUT: 'layout',
|
||||||
|
AUTO: 'auto',
|
||||||
|
}
|
||||||
|
|
||||||
export const SAVE_KEY = [
|
export const SAVE_KEY = [
|
||||||
'selectable',
|
'selectable',
|
||||||
'name',
|
'name',
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE, MODULE_SETUP_TYPE } from '@/common/common'
|
||||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||||
@ -334,10 +334,10 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
<button className={`btn-frame modal mr5 ${isManualModuleSetup ? 'act' : ''}`} onClick={handleManualModuleSetup}>
|
<button className={`btn-frame modal mr5 ${isManualModuleSetup ? 'act' : ''}`} onClick={handleManualModuleSetup}>
|
||||||
{getMessage('modal.module.basic.setting.passivity.placement')}
|
{getMessage('modal.module.basic.setting.passivity.placement')}
|
||||||
</button>
|
</button>
|
||||||
<button className="btn-frame modal act mr5" onClick={() => autoModuleSetup('auto')}>
|
<button className="btn-frame modal act mr5" onClick={() => autoModuleSetup(MODULE_SETUP_TYPE.AUTO)}>
|
||||||
{getMessage('modal.module.basic.setting.auto.placement')}
|
{getMessage('modal.module.basic.setting.auto.placement')}
|
||||||
</button>
|
</button>
|
||||||
<button className="btn-frame modal act" onClick={() => autoModuleSetup('layout', layoutSetup)}>
|
<button className="btn-frame modal act" onClick={() => autoModuleSetup(MODULE_SETUP_TYPE.LAYOUT, layoutSetup)}>
|
||||||
{getMessage('modal.module.basic.setting.auto.row.batch')}
|
{getMessage('modal.module.basic.setting.auto.row.batch')}
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@ -64,9 +64,9 @@ const Placement = forwardRef((props, refs) => {
|
|||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
console.log('moduleRowColArray', moduleRowColArray)
|
// console.log('moduleRowColArray', moduleRowColArray)
|
||||||
}, [moduleRowColArray])
|
// }, [moduleRowColArray])
|
||||||
|
|
||||||
//최초 지입시 체크
|
//최초 지입시 체크
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import offsetPolygon, { calculateAngle, createLinesFromPolygon } from '@/util/qp
|
|||||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||||
import { moduleSetupSurfaceState } from '@/store/canvasAtom'
|
import { moduleSetupSurfaceState } from '@/store/canvasAtom'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { POLYGON_TYPE, BATCH_TYPE, LINE_TYPE } from '@/common/common'
|
import { POLYGON_TYPE, BATCH_TYPE, LINE_TYPE, MODULE_SETUP_TYPE } from '@/common/common'
|
||||||
import * as turf from '@turf/turf'
|
import * as turf from '@turf/turf'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { compasDegAtom } from '@/store/orientationAtom'
|
import { compasDegAtom } from '@/store/orientationAtom'
|
||||||
@ -1772,6 +1772,8 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
const autoModuleSetup = (type, layoutSetupRef) => {
|
const autoModuleSetup = (type, layoutSetupRef) => {
|
||||||
initEvent() //마우스 이벤트 초기화
|
initEvent() //마우스 이벤트 초기화
|
||||||
|
|
||||||
|
console.log('checkedModule', checkedModule)
|
||||||
|
|
||||||
//실패한 지붕재 배열
|
//실패한 지붕재 배열
|
||||||
let failAutoSetupRoof = []
|
let failAutoSetupRoof = []
|
||||||
|
|
||||||
@ -1780,7 +1782,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
/**
|
/**
|
||||||
* 자동 레이아웃일때 0이 있거나 혼합이 있는지 확인하는 로직
|
* 자동 레이아웃일때 0이 있거나 혼합이 있는지 확인하는 로직
|
||||||
*/
|
*/
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
checkedLayoutData = layoutSetupRef.filter((module) => module.checked)
|
checkedLayoutData = layoutSetupRef.filter((module) => module.checked)
|
||||||
const hasZeroLength = checkedLayoutData.some((module) => module.row === 0 || module.col === 0)
|
const hasZeroLength = checkedLayoutData.some((module) => module.row === 0 || module.col === 0)
|
||||||
|
|
||||||
@ -1789,15 +1791,15 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//혼합 가능 모듈과 혼합 불가능 모듈을 선택했을때 카운트를 해서 확인
|
// //혼합 가능 모듈과 혼합 불가능 모듈을 선택했을때 카운트를 해서 확인
|
||||||
const mixAsgY = checkedModule.filter((obj) => obj.mixAsgYn === 'Y')
|
// const mixAsgY = checkedModule.filter((obj) => obj.mixAsgYn === 'Y')
|
||||||
const mixAsgN = checkedModule.filter((obj) => obj.mixAsgYn === 'N')
|
// const mixAsgN = checkedModule.filter((obj) => obj.mixAsgYn === 'N')
|
||||||
|
|
||||||
//Y인 모듈과 N인 모듈이 둘다 존재하면 설치 불가
|
// //Y인 모듈과 N인 모듈이 둘다 존재하면 설치 불가
|
||||||
if (mixAsgY.length > 0 && mixAsgN.length > 0) {
|
// if (mixAsgY.length > 0 && mixAsgN.length > 0) {
|
||||||
swalFire({ text: getMessage('modal.module.basic.setting.module.placement.mix.asg.yn.error'), icon: 'warning' })
|
// swalFire({ text: getMessage('modal.module.basic.setting.module.placement.mix.asg.yn.error'), icon: 'warning' })
|
||||||
return
|
// return
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkedModule.length === 0) {
|
if (checkedModule.length === 0) {
|
||||||
@ -1805,16 +1807,6 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// //혼합 가능 모듈과 혼합 불가능 모듈을 선택했을때 카운트를 해서 확인
|
|
||||||
// const mixAsgY = checkedModule.filter((obj) => obj.mixAsgYn === 'Y')
|
|
||||||
// const mixAsgN = checkedModule.filter((obj) => obj.mixAsgYn === 'N')
|
|
||||||
|
|
||||||
// //Y인 모듈과 N인 모듈이 둘다 존재하면 설치 불가
|
|
||||||
// if (mixAsgY.length > 0 && mixAsgN.length > 0) {
|
|
||||||
// swalFire({ text: getMessage('modal.module.basic.setting.module.placement.mix.asg.yn.error') })
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
const isChidori = moduleSetupOption.isChidori
|
const isChidori = moduleSetupOption.isChidori
|
||||||
const setupLocation = moduleSetupOption.setupLocation
|
const setupLocation = moduleSetupOption.setupLocation
|
||||||
const isMaxSetup = false
|
const isMaxSetup = false
|
||||||
@ -1859,6 +1851,9 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
name: POLYGON_TYPE.MODULE,
|
name: POLYGON_TYPE.MODULE,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//체크된 모듈 중에 북면 모듈이 있는지 확인하는 로직
|
||||||
|
const isIncludeNorthModule = checkedModule.some((module) => module.northModuleYn === 'Y')
|
||||||
|
|
||||||
//선택된 지붕안에 오브젝트(도머, 개구등)이 있는지 확인하는 로직 포함되면 배열 반환
|
//선택된 지붕안에 오브젝트(도머, 개구등)이 있는지 확인하는 로직 포함되면 배열 반환
|
||||||
const objectsIncludeSurface = (turfModuleSetupSurface) => {
|
const objectsIncludeSurface = (turfModuleSetupSurface) => {
|
||||||
let containsBatchObjects = []
|
let containsBatchObjects = []
|
||||||
@ -1891,32 +1886,108 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
const checkAutoLayoutModuleSetup = (moduleSetupSurface, trestleDetailData) => {
|
const checkAutoLayoutModuleSetup = (moduleSetupSurface, trestleDetailData) => {
|
||||||
const isMultipleModules = checkedModule.length > 1 //모듈이 여러개면
|
/**
|
||||||
const maxCol = trestleDetailData.moduleMaxCols //최대 열수 -> 얘는 멀티랑 관계없음
|
* 체크된 모듈중에 북면 모듈이 있으면 북면 모듈만 따로 계산하고 아니면 전체 모듈을 계산
|
||||||
const maxRow = isMultipleModules
|
* 북면 모듈이 있고 북면이 들어오면 북면의 row를 계산한다
|
||||||
? trestleDetailData.moduleMaxRows
|
*
|
||||||
: trestleDetailData.module.find((item) => item.moduleTpCd === checkedModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
*/
|
||||||
|
|
||||||
//단수 합단수
|
//북면 모듈이 없을때
|
||||||
const sumRowCount = isMultipleModules
|
if (!isIncludeNorthModule) {
|
||||||
? layoutSetupRef.filter((item) => item.checked).reduce((acc, cur) => acc + cur.row, 0)
|
const isMultipleModules = checkedModule.length > 1 //모듈이 여러개면
|
||||||
: layoutSetupRef.find((item) => item.moduleId === checkedModule[0].itemId).row //멀티모듈이면 전체 합, 체크된 한개의 열
|
const maxCol = trestleDetailData.moduleMaxCols //최대 열수 -> 얘는 멀티랑 관계없음
|
||||||
|
const maxRow = isMultipleModules
|
||||||
|
? trestleDetailData.moduleMaxRows
|
||||||
|
: trestleDetailData.module.find((item) => item.moduleTpCd === checkedModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
||||||
|
|
||||||
//
|
//단수 합단수
|
||||||
const sumColCount = layoutSetupRef.filter((item) => item.col).some((item) => item.col > maxCol)
|
const sumRowCount = isMultipleModules
|
||||||
|
? layoutSetupRef.filter((item) => item.checked).reduce((acc, cur) => acc + cur.row, 0)
|
||||||
|
: layoutSetupRef.find((item) => item.moduleId === checkedModule[0].itemId).row //멀티모듈이면 전체 합, 체크된 한개의 열
|
||||||
|
|
||||||
if (sumRowCount > maxRow || sumColCount) {
|
//
|
||||||
failAutoSetupRoof.push(moduleSetupSurface)
|
const sumColCount = layoutSetupRef.filter((item) => item.col).some((item) => item.col > maxCol)
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// 혼합일때 모듈 개별의 row를 체크함
|
if (sumRowCount > maxRow || sumColCount) {
|
||||||
const isPassedObject =
|
failAutoSetupRoof.push(moduleSetupSurface)
|
||||||
isMultipleModules && layoutSetupRef.find((item, index) => item.checked && item.row > trestleDetailData.module[index].mixModuleMaxRows)
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (isPassedObject) {
|
// 혼합일때 모듈 개별의 row를 체크함
|
||||||
failAutoSetupRoof.push(moduleSetupSurface)
|
const isPassedObject =
|
||||||
return false
|
isMultipleModules && layoutSetupRef.find((item, index) => item.checked && item.row > trestleDetailData.module[index].mixModuleMaxRows)
|
||||||
|
|
||||||
|
if (isPassedObject) {
|
||||||
|
failAutoSetupRoof.push(moduleSetupSurface)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//북면 모듈만 선택했을때
|
||||||
|
if (checkedModule.length === 1) {
|
||||||
|
const maxCol = trestleDetailData.moduleMaxCols //최대 열수 -> 얘는 멀티랑 관계없음
|
||||||
|
const maxRow = trestleDetailData.module.find((item) => item.moduleTpCd === checkedModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
||||||
|
|
||||||
|
//단수 합단수
|
||||||
|
const sumRowCount = layoutSetupRef.find((item) => item.moduleId === checkedModule[0].itemId).row //멀티모듈이면 전체 합, 체크된 한개의 열
|
||||||
|
const sumColCount = layoutSetupRef.filter((item) => item.col).some((item) => item.col > maxCol)
|
||||||
|
|
||||||
|
if (sumRowCount > maxRow || sumColCount) {
|
||||||
|
failAutoSetupRoof.push(moduleSetupSurface)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const normalModule = checkedModule.filter((item) => item.northModuleYn === 'N')
|
||||||
|
const northModule = checkedModule.filter((item) => item.northModuleYn === 'Y')
|
||||||
|
|
||||||
|
//만약 북면 모듈이 2개면 이 하위 로직 가져다가 쓰면됨 northModule === 만 바꾸면 될듯
|
||||||
|
// northModule을 배열로 만들고 include로 해서 체크 해야됨
|
||||||
|
if (normalModule.length > 0 && !moduleSetupSurface.isNorth) {
|
||||||
|
const isMultipleModules = normalModule.length > 1 //모듈이 여러개면
|
||||||
|
const maxCol = trestleDetailData.moduleMaxCols //최대 열수 -> 얘는 멀티랑 관계없음
|
||||||
|
const maxRow = isMultipleModules
|
||||||
|
? trestleDetailData.moduleMaxRows
|
||||||
|
: trestleDetailData.module.find((item) => item.moduleTpCd === normalModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
||||||
|
|
||||||
|
//단수 합단수
|
||||||
|
const sumRowCount = isMultipleModules
|
||||||
|
? layoutSetupRef.filter((item) => item.checked && item.moduleId !== northModule[0].itemId).reduce((acc, cur) => acc + cur.row, 0)
|
||||||
|
: layoutSetupRef.find((item) => item.moduleId === normalModule[0].itemId).row //멀티모듈이면 전체 합, 체크된 한개의 열
|
||||||
|
|
||||||
|
//
|
||||||
|
const sumColCount = layoutSetupRef.filter((item) => item.col && item.moduleId !== northModule[0].itemId).some((item) => item.col > maxCol)
|
||||||
|
|
||||||
|
if (sumRowCount > maxRow || sumColCount) {
|
||||||
|
failAutoSetupRoof.push(moduleSetupSurface)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 혼합일때 모듈 개별의 row를 체크함
|
||||||
|
const isPassedObject =
|
||||||
|
isMultipleModules &&
|
||||||
|
layoutSetupRef.find(
|
||||||
|
(item, index) =>
|
||||||
|
item.checked && item.moduleId !== northModule[0].itemId && item.row > trestleDetailData.module[index].mixModuleMaxRows,
|
||||||
|
)
|
||||||
|
|
||||||
|
if (isPassedObject) {
|
||||||
|
failAutoSetupRoof.push(moduleSetupSurface)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (northModule.length > 0 && moduleSetupSurface.isNorth) {
|
||||||
|
const maxCol = trestleDetailData.moduleMaxCols //최대 열수 -> 얘는 멀티랑 관계없음
|
||||||
|
const maxRow = trestleDetailData.module.find((item) => item.moduleTpCd === checkedModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
||||||
|
|
||||||
|
const sumRowCount = layoutSetupRef.find((item) => item.moduleId === northModule[0].itemId).row
|
||||||
|
const sumColCount = layoutSetupRef.filter((item) => item.col && item.moduleId !== northModule[0].itemId).some((item) => item.col > maxCol)
|
||||||
|
|
||||||
|
if (sumRowCount > maxRow || sumColCount) {
|
||||||
|
failAutoSetupRoof.push(moduleSetupSurface)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -1943,12 +2014,11 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let flowLines
|
let flowLines
|
||||||
let installedModuleMixYn
|
let installedModuleMixYn
|
||||||
const isNorthSurface = moduleSetupSurface.isNorth
|
const isNorthSurface = moduleSetupSurface.isNorth
|
||||||
const isIncludeNorthModule = checkedModule.some((module) => module.northModuleYn === 'Y') //체크된 모듈 중에 북면 모듈이 있는지 확인하는 로직
|
|
||||||
|
|
||||||
let layoutRow = 0
|
let layoutRow = 0
|
||||||
let layoutCol = 0
|
let layoutCol = 0
|
||||||
|
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
||||||
if (!isPassed) {
|
if (!isPassed) {
|
||||||
return
|
return
|
||||||
@ -1958,7 +2028,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
for (let moduleIndex = 0; moduleIndex < checkedModule.length; moduleIndex++) {
|
for (let moduleIndex = 0; moduleIndex < checkedModule.length; moduleIndex++) {
|
||||||
const module = checkedModule[moduleIndex]
|
const module = checkedModule[moduleIndex]
|
||||||
|
|
||||||
if (type === 'layout' && checkedLayoutData) {
|
if (type === MODULE_SETUP_TYPE.LAYOUT && checkedLayoutData) {
|
||||||
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
||||||
layoutRow = layout.row
|
layoutRow = layout.row
|
||||||
layoutCol = layout.col
|
layoutCol = layout.col
|
||||||
@ -2009,7 +2079,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let calcAreaHeight = flowLines.bottom.y1 - flowLines.top.y1
|
let calcAreaHeight = flowLines.bottom.y1 - flowLines.top.y1
|
||||||
let calcModuleHeightCount = calcAreaHeight / (height + intvVer + 1)
|
let calcModuleHeightCount = calcAreaHeight / (height + intvVer + 1)
|
||||||
|
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
||||||
calcModuleHeightCount = layoutRow
|
calcModuleHeightCount = layoutRow
|
||||||
}
|
}
|
||||||
@ -2095,9 +2165,9 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
installedLastHeightCoord = moduleY - height - heightMargin
|
installedLastHeightCoord = moduleY - height - heightMargin
|
||||||
} else {
|
} else {
|
||||||
//디버깅용
|
//디버깅용
|
||||||
tempModule.set({ fill: 'transparent', stroke: 'red', strokeWidth: 1 })
|
// tempModule.set({ fill: 'transparent', stroke: 'red', strokeWidth: 1 })
|
||||||
canvas?.add(tempModule)
|
// canvas?.add(tempModule)
|
||||||
canvas.renderAll()
|
// canvas.renderAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isInstall) {
|
if (isInstall) {
|
||||||
@ -2136,7 +2206,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let layoutRow = 0
|
let layoutRow = 0
|
||||||
let layoutCol = 0
|
let layoutCol = 0
|
||||||
|
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
||||||
if (!isPassed) {
|
if (!isPassed) {
|
||||||
return
|
return
|
||||||
@ -2146,7 +2216,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
for (let moduleIndex = 0; moduleIndex < checkedModule.length; moduleIndex++) {
|
for (let moduleIndex = 0; moduleIndex < checkedModule.length; moduleIndex++) {
|
||||||
const module = checkedModule[moduleIndex]
|
const module = checkedModule[moduleIndex]
|
||||||
|
|
||||||
if (type === 'layout' && checkedLayoutData) {
|
if (type === MODULE_SETUP_TYPE.LAYOUT && checkedLayoutData) {
|
||||||
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
||||||
layoutRow = layout.row
|
layoutRow = layout.row
|
||||||
layoutCol = layout.col
|
layoutCol = layout.col
|
||||||
@ -2204,7 +2274,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let calcModuleHeightCount = calcAreaHeight / (height + intvVer + 1)
|
let calcModuleHeightCount = calcAreaHeight / (height + intvVer + 1)
|
||||||
|
|
||||||
//단수지정 자동이면
|
//단수지정 자동이면
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
||||||
calcModuleHeightCount = layoutRow
|
calcModuleHeightCount = layoutRow
|
||||||
}
|
}
|
||||||
@ -2325,7 +2395,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let layoutRow = 0
|
let layoutRow = 0
|
||||||
let layoutCol = 0
|
let layoutCol = 0
|
||||||
|
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
||||||
if (!isPassed) {
|
if (!isPassed) {
|
||||||
return
|
return
|
||||||
@ -2336,7 +2406,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
const module = checkedModule[moduleIndex]
|
const module = checkedModule[moduleIndex]
|
||||||
|
|
||||||
//단수 지정이면
|
//단수 지정이면
|
||||||
if (type === 'layout' && checkedLayoutData) {
|
if (type === MODULE_SETUP_TYPE.LAYOUT && checkedLayoutData) {
|
||||||
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
||||||
layoutRow = layout.row
|
layoutRow = layout.row
|
||||||
layoutCol = layout.col
|
layoutCol = layout.col
|
||||||
@ -2397,7 +2467,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let calcModuleHeightCount = calcAreaHeight / (width + intvVer + 1)
|
let calcModuleHeightCount = calcAreaHeight / (width + intvVer + 1)
|
||||||
|
|
||||||
//단수지정 자동이면
|
//단수지정 자동이면
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
||||||
calcModuleHeightCount = layoutRow
|
calcModuleHeightCount = layoutRow
|
||||||
}
|
}
|
||||||
@ -2518,7 +2588,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let layoutRow = 0
|
let layoutRow = 0
|
||||||
let layoutCol = 0
|
let layoutCol = 0
|
||||||
|
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
const isPassed = checkAutoLayoutModuleSetup(moduleSetupSurface, trestleDetailData)
|
||||||
if (!isPassed) {
|
if (!isPassed) {
|
||||||
return
|
return
|
||||||
@ -2528,7 +2598,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
for (let moduleIndex = 0; moduleIndex < checkedModule.length; moduleIndex++) {
|
for (let moduleIndex = 0; moduleIndex < checkedModule.length; moduleIndex++) {
|
||||||
const module = checkedModule[moduleIndex]
|
const module = checkedModule[moduleIndex]
|
||||||
|
|
||||||
if (type === 'layout' && checkedLayoutData) {
|
if (type === MODULE_SETUP_TYPE.LAYOUT && checkedLayoutData) {
|
||||||
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
const layout = checkedLayoutData.find((item) => module.itemId === item.moduleId)
|
||||||
layoutRow = layout.row
|
layoutRow = layout.row
|
||||||
layoutCol = layout.col
|
layoutCol = layout.col
|
||||||
@ -2588,7 +2658,7 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
let calcModuleHeightCount = calcAreaHeight / (width + intvVer + 1)
|
let calcModuleHeightCount = calcAreaHeight / (width + intvVer + 1)
|
||||||
|
|
||||||
//단수지정 자동이면
|
//단수지정 자동이면
|
||||||
if (type === 'layout') {
|
if (type === MODULE_SETUP_TYPE.LAYOUT) {
|
||||||
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
calcModuleWidthCount = layoutCol > calcModuleWidthCount ? calcModuleWidthCount : layoutCol
|
||||||
calcModuleHeightCount = layoutRow
|
calcModuleHeightCount = layoutRow
|
||||||
}
|
}
|
||||||
@ -2778,16 +2848,14 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
/**
|
/**
|
||||||
* 자동 레이아웃일떄 설치 가능한 애들은 설치 해주고 실패한 애들은 이름, 최대 설치 가능한 높이 알려줄라고
|
* 자동 레이아웃일떄 설치 가능한 애들은 설치 해주고 실패한 애들은 이름, 최대 설치 가능한 높이 알려줄라고
|
||||||
*/
|
*/
|
||||||
if (type === 'layout' && failAutoSetupRoof.length > 0) {
|
if (type === MODULE_SETUP_TYPE.LAYOUT && failAutoSetupRoof.length > 0) {
|
||||||
const roofNamesList = failAutoSetupRoof.map((roof) => ({
|
const roofNamesList = failAutoSetupRoof.map((roof) => ({
|
||||||
roofName: roof.roofMaterial.roofMatlNmJp,
|
roofName: roof.roofMaterial.roofMatlNmJp,
|
||||||
moduleMaxRows: roof.trestleDetail.moduleMaxRows,
|
moduleMaxRows: roof.trestleDetail.moduleMaxRows,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const alertString = roofNamesList.map((item, index) => `${item.roofName}(${item.moduleMaxRows})`)
|
const alertString = roofNamesList.map((item, index) => `${item.roofName}(${item.moduleMaxRows})`)
|
||||||
console.log('alertString', alertString)
|
swalFire({ text: alertString, icon: 'warning' })
|
||||||
|
|
||||||
// swalFire({ text: alertString, icon: 'warning' })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user