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