Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/ysCha
This commit is contained in:
commit
fb297b9a0a
@ -92,7 +92,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (raftBaseList.length > 0) {
|
||||
setSelectedRaftBase(raftBaseList.find((raft) => raft.clCode === trestleState?.raftBaseCd) ?? null)
|
||||
setSelectedRaftBase(raftBaseList.find((raft) => raft.clCode === selectedRoof?.raft) ?? null)
|
||||
} else {
|
||||
setSelectedRaftBase(null)
|
||||
}
|
||||
@ -157,7 +157,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
length: e,
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: selectedRaftBase?.clCode,
|
||||
raft: selectedRaftBase?.clCode,
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -169,7 +169,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: e.clCode,
|
||||
raft: e.clCode,
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -181,7 +181,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: selectedRaftBase?.clCode,
|
||||
raft: selectedRaftBase?.clCode,
|
||||
trestleMkrCd: e.trestleMkrCd,
|
||||
},
|
||||
})
|
||||
@ -194,7 +194,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: selectedRaftBase?.clCode,
|
||||
raft: selectedRaftBase?.clCode,
|
||||
trestleMkrCd: selectedTrestle.trestleMkrCd,
|
||||
constMthdCd: e.constMthdCd,
|
||||
},
|
||||
@ -208,7 +208,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: selectedRaftBase?.clCode,
|
||||
raft: selectedRaftBase?.clCode,
|
||||
trestleMkrCd: selectedTrestle.trestleMkrCd,
|
||||
constMthdCd: selectedConstMthd.constMthdCd,
|
||||
roofBaseCd: e.roofBaseCd,
|
||||
@ -229,7 +229,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
roof: {
|
||||
moduleTpCd: selectedModules.itemTp ?? '',
|
||||
roofMatlCd: selectedRoof?.roofMatlCd ?? '',
|
||||
raftBaseCd: selectedRaftBase?.clCode,
|
||||
raft: selectedRaftBase?.clCode,
|
||||
trestleMkrCd: selectedTrestle.trestleMkrCd,
|
||||
constMthdCd: selectedConstMthd.constMthdCd,
|
||||
roofBaseCd: selectedRoofBase.roofBaseCd,
|
||||
@ -266,6 +266,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
ridgeMargin,
|
||||
kerabaMargin,
|
||||
roofIndex: selectedRoof.index,
|
||||
raft: selectedRaftBase?.clCode,
|
||||
trestle: {
|
||||
hajebichi: hajebichi,
|
||||
length: lengthBase,
|
||||
@ -302,6 +303,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
ridgeMargin,
|
||||
kerabaMargin,
|
||||
roofIndex: roof.index,
|
||||
raft: selectedRaftBase?.clCode,
|
||||
trestle: {
|
||||
length: lengthBase,
|
||||
hajebichi: hajebichi,
|
||||
@ -374,7 +376,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
}
|
||||
}
|
||||
if (['C', 'R'].includes(roof.raftAuth)) {
|
||||
if (!roof?.raftBaseCd) {
|
||||
if (!roof?.raft) {
|
||||
Swal.fire({
|
||||
title: getMessage('modal.module.basic.settting.module.error6', [roof.nameJp]), // 서까래 간격을 입력해주세요.
|
||||
icon: 'warning',
|
||||
@ -477,7 +479,7 @@ const Trestle = forwardRef((props, ref) => {
|
||||
addRoof: newRoofs[index],
|
||||
trestle: {
|
||||
...roof.trestle,
|
||||
raftBaseCd: roof.raftBaseCd,
|
||||
raft: roof.raftBaseCd,
|
||||
},
|
||||
construction: {
|
||||
// ...constructionList.find((construction) => newAddedRoofs[index].construction.constTp === construction.constTp),
|
||||
@ -502,8 +504,6 @@ const Trestle = forwardRef((props, ref) => {
|
||||
return false
|
||||
}
|
||||
|
||||
const onMarginCheck = (target, data) => {}
|
||||
|
||||
useImperativeHandle(ref, () => ({
|
||||
isComplete,
|
||||
}))
|
||||
|
||||
@ -1902,57 +1902,51 @@ export function useModuleBasicSetting(tabNum) {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
//북면 모듈이 1개만있을때
|
||||
if (checkedModule.length === 1) {
|
||||
const maxRow = trestleDetailData.module.find((item) => item.moduleTpCd === checkedModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
||||
const normalModule = checkedModule.filter((item) => item.northModuleYn === 'N')
|
||||
const northModule = checkedModule.filter((item) => item.northModuleYn === 'Y')
|
||||
const northModuleIds = northModule.map((item) => item.itemId)
|
||||
let isPassedNormalModule = false
|
||||
|
||||
//단수 합단수
|
||||
const sumRowCount = layoutSetupRef.find((item) => item.moduleId === checkedModule[0].itemId).row //멀티모듈이면 전체 합, 체크된 한개의 열
|
||||
const sumColCount = layoutSetupRef.filter((item) => item.col).some((item) => item.col > maxCol)
|
||||
//만약 북면 모듈이 2개면 이 하위 로직 가져다가 쓰면됨 northModule === 만 바꾸면 될듯
|
||||
// northModule을 배열로 만들고 include로 해서 체크 해야됨
|
||||
if (normalModule.length > 0 && !moduleSetupSurface.isNorth) {
|
||||
//C1C2 모듈일 경우ㅁㅁ
|
||||
const isMultipleModules = normalModule.length > 1 //모듈이 여러개면
|
||||
const maxRow = isMultipleModules
|
||||
? trestleDetailData.moduleMaxRows
|
||||
: trestleDetailData.module.find((item) => item.moduleTpCd === normalModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
||||
|
||||
if (sumRowCount > maxRow || sumColCount) {
|
||||
//북면 모듈 id를 제외한 모듈의 단 체크
|
||||
const sumRowCount = isMultipleModules
|
||||
? layoutSetupRef.filter((item) => item.checked && !northModuleIds.includes(item.moduleId)).reduce((acc, cur) => acc + cur.row, 0)
|
||||
: layoutSetupRef.find((item) => item.moduleId === normalModule[0].itemId).row //멀티모듈이면 전체 합, 체크된 한개의 열
|
||||
|
||||
//북면 모듈 id를 제외한 모듈의 열 체크
|
||||
const sumColCount = layoutSetupRef.filter((item) => item.col && !northModuleIds.includes(item.moduleId)).some((item) => item.col > maxCol)
|
||||
|
||||
// 혼합일때 모듈 개별의 row를 체크함
|
||||
const isPassedObject =
|
||||
isMultipleModules &&
|
||||
layoutSetupRef.find(
|
||||
(item, index) => item.checked && !item.moduleId.includes(northModuleIds) && item.row > trestleDetailData.module[index].mixModuleMaxRows,
|
||||
)
|
||||
|
||||
// 합산 단수가 맥스단수보다 크거나 열이 맥스열수보다 크거나 혼합일때 모듈 개별의 row가 맥스단수보다 크면 실패
|
||||
if (sumRowCount > maxRow || sumColCount || isPassedObject) {
|
||||
failAutoSetupRoof.push(moduleSetupSurface)
|
||||
return false
|
||||
} else {
|
||||
isPassedNormalModule = true
|
||||
}
|
||||
} else {
|
||||
const normalModule = checkedModule.filter((item) => item.northModuleYn === 'N')
|
||||
const northModule = checkedModule.filter((item) => item.northModuleYn === 'Y')
|
||||
const northModuleIds = northModule.map((item) => item.itemId)
|
||||
|
||||
//만약 북면 모듈이 2개면 이 하위 로직 가져다가 쓰면됨 northModule === 만 바꾸면 될듯
|
||||
// northModule을 배열로 만들고 include로 해서 체크 해야됨
|
||||
if (normalModule.length > 0 && !moduleSetupSurface.isNorth) {
|
||||
//C1C2 모듈일 경우ㅁㅁ
|
||||
const isMultipleModules = normalModule.length > 1 //모듈이 여러개면
|
||||
const maxRow = isMultipleModules
|
||||
? trestleDetailData.moduleMaxRows
|
||||
: trestleDetailData.module.find((item) => item.moduleTpCd === normalModule[0].moduleTpCd).moduleMaxRows //멀티모듈이면 밖에 maxRows로 판단 아니면 module->itemmList를 가지고 판단
|
||||
|
||||
//북면 모듈 id를 제외한 모듈의 단 체크
|
||||
const sumRowCount = isMultipleModules
|
||||
? layoutSetupRef.filter((item) => item.checked && !northModuleIds.includes(item.moduleId)).reduce((acc, cur) => acc + cur.row, 0)
|
||||
: layoutSetupRef.find((item) => item.moduleId === normalModule[0].itemId).row //멀티모듈이면 전체 합, 체크된 한개의 열
|
||||
|
||||
//북면 모듈 id를 제외한 모듈의 열 체크
|
||||
const sumColCount = layoutSetupRef.filter((item) => item.col && !northModuleIds.includes(item.moduleId)).some((item) => item.col > maxCol)
|
||||
|
||||
// 혼합일때 모듈 개별의 row를 체크함
|
||||
const isPassedObject =
|
||||
isMultipleModules &&
|
||||
layoutSetupRef.find(
|
||||
(item, index) =>
|
||||
item.checked && !item.moduleId.includes(northModuleIds) && item.row > trestleDetailData.module[index].mixModuleMaxRows,
|
||||
)
|
||||
|
||||
// 합산 단수가 맥스단수보다 크거나 열이 맥스열수보다 크거나 혼합일때 모듈 개별의 row가 맥스단수보다 크면 실패
|
||||
if (sumRowCount > maxRow || sumColCount || isPassedObject) {
|
||||
failAutoSetupRoof.push(moduleSetupSurface)
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//위에서 일반 모듈이 설치가 완료면 그냥 넘어간다
|
||||
//일반 모듈이 pass라면 일반 모듈이 설치됨
|
||||
//만약 일반모듈이 체크가 안되어 있으면 밑에 로직을 탐
|
||||
if (!isPassedNormalModule) {
|
||||
//북면 모듈이 있고 북면에 있을때
|
||||
if (northModule.length > 0 && (moduleSetupSurface.isNorth || !moduleSetupSurface.isNorth)) {
|
||||
//북면 모듈이 있는데 일반 모듈이 있을때 북면이 아니면 그냥 북면은 그냥 pass
|
||||
const isMultipleModules = northModule.length > 1 //모듈이 여러개면
|
||||
const maxRow = isMultipleModules
|
||||
? trestleDetailData.moduleMaxRows
|
||||
|
||||
@ -25,7 +25,7 @@ const trestleReducer = (state, action) => {
|
||||
moduleTpCd: action.roof.module?.itemTp ?? '',
|
||||
roofMatlCd: action.roof?.roofMatlCd ?? '',
|
||||
hajebichi: action.roof?.hajebichi ?? 0,
|
||||
raftBaseCd: action.roof?.raft ?? null,
|
||||
raft: action.roof?.raft ?? null,
|
||||
trestleMkrCd: action.roof.trestle?.trestleMkrCd ?? null,
|
||||
constMthdCd: action.roof.trestle?.constMthdCd ?? null,
|
||||
constTp: action.roof.construction?.constTp ?? null,
|
||||
@ -72,7 +72,6 @@ export function useModuleTrestle(props) {
|
||||
|
||||
useEffect(() => {
|
||||
const raftCodeList = findCommonCode(RAFT_BASE_CODE)
|
||||
|
||||
setRaftBaseList(raftCodeList)
|
||||
setTrestleList([])
|
||||
setConstMthdList([])
|
||||
@ -150,7 +149,7 @@ export function useModuleTrestle(props) {
|
||||
getTrestleList({
|
||||
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
||||
raftBaseCd: trestleState?.raft ?? '',
|
||||
})
|
||||
.then((res) => {
|
||||
if (res?.data) setTrestleList(res.data)
|
||||
@ -166,7 +165,7 @@ export function useModuleTrestle(props) {
|
||||
getTrestleList({
|
||||
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
||||
raftBaseCd: trestleState?.raft ?? '',
|
||||
trestleMkrCd: trestleState?.trestleMkrCd ?? '',
|
||||
})
|
||||
.then((res) => {
|
||||
@ -183,7 +182,7 @@ export function useModuleTrestle(props) {
|
||||
getTrestleList({
|
||||
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
||||
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
||||
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
||||
raftBaseCd: trestleState?.raft ?? '',
|
||||
trestleMkrCd: trestleState?.trestleMkrCd ?? '',
|
||||
constMthdCd: trestleState?.constMthdCd ?? '',
|
||||
})
|
||||
@ -209,7 +208,7 @@ export function useModuleTrestle(props) {
|
||||
stdWindSpeed: trestleState.stdWindSpeed ?? '',
|
||||
stdSnowLd: trestleState.stdSnowLd ?? '',
|
||||
inclCd: trestleState.inclCd ?? '',
|
||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||
raftBaseCd: trestleState.raft ?? '',
|
||||
roofPitch: Math.round(trestleState.roofPitch) ?? '',
|
||||
})
|
||||
.then((res) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user