Merge remote-tracking branch 'origin/dev' into feature/ysCha

This commit is contained in:
ysCha 2025-09-26 18:42:11 +09:00
commit c407709838

View File

@ -23,7 +23,7 @@ const Trestle = forwardRef((props, ref) => {
const autoSelectTimeoutRef = useRef(null) const autoSelectTimeoutRef = useRef(null)
// () // ()
const AUTO_SELECT_TIMEOUT = 700 // API const AUTO_SELECT_TIMEOUT = 500 // API
const { const {
trestleState, trestleState,
trestleDetail, trestleDetail,
@ -66,7 +66,7 @@ const Trestle = forwardRef((props, ref) => {
const [flag, setFlag] = useState(false) const [flag, setFlag] = useState(false)
const tempModuleSelectionData = useRef(null) const tempModuleSelectionData = useRef(null)
const [autoSelectStep, setAutoSelectStep] = useState(null) // 'raftBase', 'trestle', 'constMthd', 'roofBase', 'construction' const [autoSelectStep, setAutoSelectStep] = useState(null) // 'raftBase', 'trestle', 'constMthd', 'roofBase', 'construction'
const prevHajebichiRef = useRef();
useEffect(() => { useEffect(() => {
if (roofs && roofs.length > 0 && !selectedRoof) { if (roofs && roofs.length > 0 && !selectedRoof) {
@ -76,10 +76,14 @@ const Trestle = forwardRef((props, ref) => {
} }
if (selectedRoof && selectedRoof.lenAuth === "C") { if (selectedRoof && selectedRoof.lenAuth === "C") {
onChangeLength(selectedRoof.length); onChangeLength(selectedRoof.length);
} }else if (selectedRoof && ["C", "R"].includes(selectedRoof.raftAuth) && roofs && roofs.length > 0) {
if (selectedRoof && ["C", "R"].includes(selectedRoof.raftAuth) && roofs && roofs.length > 0) {
onChangeRaftBase(roofs[0]); onChangeRaftBase(roofs[0]);
}else if (selectedRoof && ["C", "R"].includes(selectedRoof.roofPchAuth) && roofs && roofs.length > 0 &&
roofs[0].hajebichi !== prevHajebichiRef.current ) {
prevHajebichiRef.current = roofs[0].hajebichi;
onChangeHajebichi(roofs[0].hajebichi);
} }
// //
restoreModuleInstArea() restoreModuleInstArea()
}, [roofs, selectedRoof]) // selectedRoof }, [roofs, selectedRoof]) // selectedRoof
@ -280,7 +284,7 @@ const Trestle = forwardRef((props, ref) => {
roof: { roof: {
moduleTpCd: selectedModules.itemTp ?? '', moduleTpCd: selectedModules.itemTp ?? '',
roofMatlCd: selectedRoof?.roofMatlCd ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '',
raft: selectedRaftBase?.clCode, raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd,
hajebichi: e, hajebichi: e,
}, },
}) })
@ -303,7 +307,8 @@ const Trestle = forwardRef((props, ref) => {
roof: { roof: {
moduleTpCd: selectedModules.itemTp ?? '', moduleTpCd: selectedModules.itemTp ?? '',
roofMatlCd: selectedRoof?.roofMatlCd ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '',
raft: selectedRaftBase?.clCode, raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd,
//hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi,
trestleMkrCd: e.trestleMkrCd, trestleMkrCd: e.trestleMkrCd,
}, },
}) })
@ -325,7 +330,8 @@ const Trestle = forwardRef((props, ref) => {
roof: { roof: {
moduleTpCd: selectedModules.itemTp ?? '', moduleTpCd: selectedModules.itemTp ?? '',
roofMatlCd: selectedRoof?.roofMatlCd ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '',
raft: selectedRaftBase?.clCode, raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd,
//hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi,
trestleMkrCd: selectedTrestle?.trestleMkrCd, trestleMkrCd: selectedTrestle?.trestleMkrCd,
constMthdCd: e.constMthdCd, constMthdCd: e.constMthdCd,
}, },
@ -357,7 +363,8 @@ const Trestle = forwardRef((props, ref) => {
roof: { roof: {
moduleTpCd: selectedModules.itemTp ?? '', moduleTpCd: selectedModules.itemTp ?? '',
roofMatlCd: selectedRoof?.roofMatlCd ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '',
raft: selectedRaftBase?.clCode, raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd,
//hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi,
trestleMkrCd: selectedTrestle?.trestleMkrCd, trestleMkrCd: selectedTrestle?.trestleMkrCd,
constMthdCd: selectedConstMthd?.constMthdCd, constMthdCd: selectedConstMthd?.constMthdCd,
roofBaseCd: e.roofBaseCd, roofBaseCd: e.roofBaseCd,
@ -383,7 +390,8 @@ const Trestle = forwardRef((props, ref) => {
roof: { roof: {
moduleTpCd: selectedModules.itemTp ?? '', moduleTpCd: selectedModules.itemTp ?? '',
roofMatlCd: selectedRoof?.roofMatlCd ?? '', roofMatlCd: selectedRoof?.roofMatlCd ?? '',
raft: selectedRaftBase?.clCode, raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd,
//hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi,
trestleMkrCd: selectedTrestle.trestleMkrCd, trestleMkrCd: selectedTrestle.trestleMkrCd,
constMthdCd: selectedConstMthd.constMthdCd, constMthdCd: selectedConstMthd.constMthdCd,
roofBaseCd: selectedRoofBase.roofBaseCd, roofBaseCd: selectedRoofBase.roofBaseCd,
@ -420,7 +428,7 @@ const Trestle = forwardRef((props, ref) => {
ridgeMargin, ridgeMargin,
kerabaMargin, kerabaMargin,
roofIndex: selectedRoof.index, roofIndex: selectedRoof.index,
raft: selectedRaftBase?.clCode, raft: selectedRaftBase?.clCode ?? selectedRoof?.roofBaseCd,
trestle: { trestle: {
hajebichi: hajebichi, hajebichi: hajebichi,
length: lengthBase, length: lengthBase,
@ -457,8 +465,8 @@ const Trestle = forwardRef((props, ref) => {
ridgeMargin, ridgeMargin,
kerabaMargin, kerabaMargin,
roofIndex: roof.index, roofIndex: roof.index,
raft: selectedRaftBase?.clCode, raft: selectedRaftBase?.clCode ?? selectedRoof?.raft ?? '',
hajebichi: hajebichi, //hajebichi: selectedRaftBase?.hajebichi ?? selectedRoof?.hajebichi ?? 0,
trestle: { trestle: {
length: lengthBase, length: lengthBase,
hajebichi: hajebichi, hajebichi: hajebichi,
@ -543,7 +551,7 @@ const Trestle = forwardRef((props, ref) => {
} }
if (['C', 'R'].includes(roof.roofPchAuth)) { if (['C', 'R'].includes(roof.roofPchAuth)) {
if (!roof?.roofPchBase) { if (!roof?.hajebichi) {
Swal.fire({ Swal.fire({
title: getMessage('modal.module.basic.settting.module.error7', [roof.nameJp]), // . title: getMessage('modal.module.basic.settting.module.error7', [roof.nameJp]), // .
icon: 'warning', icon: 'warning',