- 자재 확인 페이지에 뒤로가기 버튼 추가 - 상세 목록 탭에 PIPE 분석 섹션 추가 - 재질-외경-스케줄-제작방식별로 그룹화 - 동일 속성 파이프들의 길이 합산 표시 - 총 파이프 길이 및 규격 종류 수 요약 - 파일 삭제 기능 수정 (외래키 제약 조건 해결) - MaterialsPage에서 전체 자재 목록 표시 (limit 10000) - 길이 단위 변환 로직 수정 (mm 단위 유지) - 파싱 로직에 디버그 출력 추가 TODO: MAIN_NOM/RED_NOM 별도 저장을 위한 스키마 개선 필요
99 lines
3.8 KiB
JavaScript
99 lines
3.8 KiB
JavaScript
import React from 'react';
|
|
import { Card, CardContent, Typography, Box, Grid, Chip, Divider } from '@mui/material';
|
|
|
|
const PipeDetailsCard = ({ material }) => {
|
|
const pipeDetails = material.pipe_details || {};
|
|
|
|
return (
|
|
<Card sx={{ mt: 2, backgroundColor: '#f5f5f5' }}>
|
|
<CardContent>
|
|
<Box sx={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', mb: 2 }}>
|
|
<Typography variant="h6" sx={{ fontWeight: 'bold' }}>
|
|
🔧 PIPE 상세 정보
|
|
</Typography>
|
|
<Chip
|
|
label={`신뢰도: ${Math.round((material.classification_confidence || 0) * 100)}%`}
|
|
color={material.classification_confidence >= 0.8 ? 'success' : 'warning'}
|
|
size="small"
|
|
/>
|
|
</Box>
|
|
|
|
<Divider sx={{ mb: 2 }} />
|
|
|
|
<Grid container spacing={2}>
|
|
<Grid item xs={12}>
|
|
<Typography variant="subtitle2" color="text.secondary">자재명</Typography>
|
|
<Typography variant="body1" sx={{ fontWeight: 'medium' }}>
|
|
{material.original_description}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">크기</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.size_inches || material.size_spec || '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">스케줄</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.schedule_type || '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">재질</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.material_spec || material.material_grade || '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">제작방식</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.manufacturing_method || '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">길이</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.length_mm ? `${pipeDetails.length_mm}mm` : '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">외경</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.outer_diameter_mm ? `${pipeDetails.outer_diameter_mm}mm` : '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">두께</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.wall_thickness_mm ? `${pipeDetails.wall_thickness_mm}mm` : '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={6} sm={3}>
|
|
<Typography variant="subtitle2" color="text.secondary">중량</Typography>
|
|
<Typography variant="body1">
|
|
{pipeDetails.weight_per_meter_kg ? `${pipeDetails.weight_per_meter_kg}kg/m` : '-'}
|
|
</Typography>
|
|
</Grid>
|
|
|
|
<Grid item xs={12}>
|
|
<Typography variant="subtitle2" color="text.secondary">수량</Typography>
|
|
<Typography variant="body1" sx={{ fontWeight: 'bold', color: 'primary.main' }}>
|
|
{material.quantity} {material.unit}
|
|
</Typography>
|
|
</Grid>
|
|
</Grid>
|
|
</CardContent>
|
|
</Card>
|
|
);
|
|
};
|
|
|
|
export default PipeDetailsCard;
|