Compare commits

..

No commits in common. "dbae3380d7f30701225e594e9f6bad5e50027c70" and "391fe39a2d48ab39c659b19b7e0891b764bd4bfa" have entirely different histories.

2 changed files with 17 additions and 16 deletions

View File

@ -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 === selectedRoof?.raft) ?? null) setSelectedRaftBase(raftBaseList.find((raft) => raft.clCode === trestleState?.raftBaseCd) ?? 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 ?? '',
raft: selectedRaftBase?.clCode, raftBaseCd: 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 ?? '',
raft: e.clCode, raftBaseCd: 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 ?? '',
raft: selectedRaftBase?.clCode, raftBaseCd: 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 ?? '',
raft: selectedRaftBase?.clCode, raftBaseCd: 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 ?? '',
raft: selectedRaftBase?.clCode, raftBaseCd: 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 ?? '',
raft: selectedRaftBase?.clCode, raftBaseCd: selectedRaftBase?.clCode,
trestleMkrCd: selectedTrestle.trestleMkrCd, trestleMkrCd: selectedTrestle.trestleMkrCd,
constMthdCd: selectedConstMthd.constMthdCd, constMthdCd: selectedConstMthd.constMthdCd,
roofBaseCd: selectedRoofBase.roofBaseCd, roofBaseCd: selectedRoofBase.roofBaseCd,
@ -266,7 +266,6 @@ 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,
@ -303,7 +302,6 @@ 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,
@ -376,7 +374,7 @@ const Trestle = forwardRef((props, ref) => {
} }
} }
if (['C', 'R'].includes(roof.raftAuth)) { if (['C', 'R'].includes(roof.raftAuth)) {
if (!roof?.raft) { if (!roof?.raftBaseCd) {
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',
@ -479,7 +477,7 @@ const Trestle = forwardRef((props, ref) => {
addRoof: newRoofs[index], addRoof: newRoofs[index],
trestle: { trestle: {
...roof.trestle, ...roof.trestle,
raft: roof.raftBaseCd, raftBaseCd: roof.raftBaseCd,
}, },
construction: { construction: {
// ...constructionList.find((construction) => newAddedRoofs[index].construction.constTp === construction.constTp), // ...constructionList.find((construction) => newAddedRoofs[index].construction.constTp === construction.constTp),
@ -504,6 +502,8 @@ const Trestle = forwardRef((props, ref) => {
return false return false
} }
const onMarginCheck = (target, data) => {}
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
isComplete, isComplete,
})) }))

View File

@ -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,
raft: action.roof?.raft ?? null, raftBaseCd: 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,6 +72,7 @@ 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([])
@ -149,7 +150,7 @@ export function useModuleTrestle(props) {
getTrestleList({ getTrestleList({
moduleTpCd: trestleState?.moduleTpCd ?? '', moduleTpCd: trestleState?.moduleTpCd ?? '',
roofMatlCd: trestleState?.roofMatlCd ?? '', roofMatlCd: trestleState?.roofMatlCd ?? '',
raftBaseCd: trestleState?.raft ?? '', raftBaseCd: trestleState?.raftBaseCd ?? '',
}) })
.then((res) => { .then((res) => {
if (res?.data) setTrestleList(res.data) if (res?.data) setTrestleList(res.data)
@ -165,7 +166,7 @@ export function useModuleTrestle(props) {
getTrestleList({ getTrestleList({
moduleTpCd: trestleState?.moduleTpCd ?? '', moduleTpCd: trestleState?.moduleTpCd ?? '',
roofMatlCd: trestleState?.roofMatlCd ?? '', roofMatlCd: trestleState?.roofMatlCd ?? '',
raftBaseCd: trestleState?.raft ?? '', raftBaseCd: trestleState?.raftBaseCd ?? '',
trestleMkrCd: trestleState?.trestleMkrCd ?? '', trestleMkrCd: trestleState?.trestleMkrCd ?? '',
}) })
.then((res) => { .then((res) => {
@ -182,7 +183,7 @@ export function useModuleTrestle(props) {
getTrestleList({ getTrestleList({
moduleTpCd: trestleState?.moduleTpCd ?? '', moduleTpCd: trestleState?.moduleTpCd ?? '',
roofMatlCd: trestleState?.roofMatlCd ?? '', roofMatlCd: trestleState?.roofMatlCd ?? '',
raftBaseCd: trestleState?.raft ?? '', raftBaseCd: trestleState?.raftBaseCd ?? '',
trestleMkrCd: trestleState?.trestleMkrCd ?? '', trestleMkrCd: trestleState?.trestleMkrCd ?? '',
constMthdCd: trestleState?.constMthdCd ?? '', constMthdCd: trestleState?.constMthdCd ?? '',
}) })
@ -208,7 +209,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.raft ?? '', raftBaseCd: trestleState.raftBaseCd ?? '',
roofPitch: Math.round(trestleState.roofPitch) ?? '', roofPitch: Math.round(trestleState.roofPitch) ?? '',
}) })
.then((res) => { .then((res) => {