Merge pull request 'dev' (#277) from dev into prd-deploy

Reviewed-on: #277
This commit is contained in:
ysCha 2025-08-05 11:31:22 +09:00
commit 9b18a8a655
2 changed files with 25 additions and 18 deletions

View File

@ -186,7 +186,7 @@ export default function ContextRoofAllocationSetting(props) {
<input <input
type="text" type="text"
className="input-origin block" className="input-origin block"
value={parseInt(roof.hajebichi)} value={roof.hajebichi === '' ? '0' : roof.hajebichi}
readOnly={roof.roofPchAuth === 'R'} readOnly={roof.roofPchAuth === 'R'}
onChange={(e) => handleChangeInput(e, 'hajebichi', index)} onChange={(e) => handleChangeInput(e, 'hajebichi', index)}
/> />
@ -205,8 +205,8 @@ export default function ContextRoofAllocationSetting(props) {
// handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) // handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
handleChangePitch(e, index) handleChangePitch(e, index)
}} }}
value={currentAngleType === 'slope' ? roof.pitch : roof.angle} value={currentAngleType === 'slope' ? (roof.pitch || '0') : (roof.angle || '0')}
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} defaultValue={currentAngleType === 'slope' ? (roof.pitch || '0') : (roof.angle || '0')}
/> />
</div> </div>
<span className="absol">{pitchText}</span> <span className="absol">{pitchText}</span>

View File

@ -127,21 +127,25 @@ export function useRoofAllocationSetting(id) {
} }
}) })
} else { } else {
roofsArray = [ if(roofList.length > 0){
{ roofsArray = roofList
planNo: planNo, }else{
roofApply: true, roofsArray = [
roofSeq: 0, {
roofMatlCd: 'ROOF_ID_WA_53A', planNo: planNo,
roofWidth: 265, roofApply: true,
roofHeight: 235, roofSeq: 0,
roofHajebichi: 0, roofMatlCd: 'ROOF_ID_WA_53A',
roofGap: 'HEI_455', roofWidth: 265,
roofLayout: 'P', roofHeight: 235,
roofPitch: 4, roofHajebichi: 0,
roofAngle: 21.8, roofGap: 'HEI_455',
}, roofLayout: 'P',
] roofPitch: 4,
roofAngle: 21.8,
},
]
}
} }
/** /**
@ -182,6 +186,9 @@ export function useRoofAllocationSetting(id) {
roofSizeSet: '' + res[0].roofSizeSet, roofSizeSet: '' + res[0].roofSizeSet,
roofAngleSet: '' + res[0].roofAngleSet, roofAngleSet: '' + res[0].roofAngleSet,
}) })
//데이터 동기화
setCurrentRoofList(selectRoofs)
}) })
} catch (error) { } catch (error) {
console.error('Data fetching error:', error) console.error('Data fetching error:', error)