🗑️ 전체(ALL) 카테고리 제거 - 헤더/본문 정렬 문제 해결
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled
Some checks failed
SonarQube Analysis / SonarQube Scan (push) Has been cancelled
- 전체 카테고리 버튼 제거 - 기본 선택 카테고리를 PIPE로 변경 - 문제 원인: 전체 카테고리에서 서로 다른 컬럼 수를 가진 자재들이 섞여서 표시됨 (PIPE 9개, FLANGE 10개, GASKET 11개 등) - 이제 각 카테고리별로만 표시되어 헤더와 본문이 완벽히 정렬됨 - quantity-info wrapper 제거로 셀 구조 단순화
This commit is contained in:
@@ -17,7 +17,7 @@ const NewMaterialsPage = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const [materials, setMaterials] = useState([]);
|
const [materials, setMaterials] = useState([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [selectedCategory, setSelectedCategory] = useState('ALL');
|
const [selectedCategory, setSelectedCategory] = useState('PIPE');
|
||||||
const [selectedMaterials, setSelectedMaterials] = useState(new Set());
|
const [selectedMaterials, setSelectedMaterials] = useState(new Set());
|
||||||
const [viewMode, setViewMode] = useState('detailed'); // 'detailed' or 'simple'
|
const [viewMode, setViewMode] = useState('detailed'); // 'detailed' or 'simple'
|
||||||
const [availableRevisions, setAvailableRevisions] = useState([]);
|
const [availableRevisions, setAvailableRevisions] = useState([]);
|
||||||
@@ -781,7 +781,7 @@ const NewMaterialsPage = ({
|
|||||||
const filteredMaterials = materials
|
const filteredMaterials = materials
|
||||||
.filter(material => {
|
.filter(material => {
|
||||||
// 카테고리 필터
|
// 카테고리 필터
|
||||||
if (selectedCategory !== 'ALL' && material.classified_category !== selectedCategory) {
|
if (material.classified_category !== selectedCategory) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -899,7 +899,6 @@ const NewMaterialsPage = ({
|
|||||||
|
|
||||||
// 현재 선택된 카테고리의 자재들만 필터링
|
// 현재 선택된 카테고리의 자재들만 필터링
|
||||||
const categoryMaterials = materials.filter(material => {
|
const categoryMaterials = materials.filter(material => {
|
||||||
if (selectedCategory === 'ALL') return true;
|
|
||||||
return material.classified_category === selectedCategory;
|
return material.classified_category === selectedCategory;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1138,15 +1137,6 @@ const NewMaterialsPage = ({
|
|||||||
|
|
||||||
{/* 카테고리 필터 */}
|
{/* 카테고리 필터 */}
|
||||||
<div className="category-filters">
|
<div className="category-filters">
|
||||||
{/* 전체 카테고리 버튼 */}
|
|
||||||
<button
|
|
||||||
key="ALL"
|
|
||||||
className={`category-btn ${selectedCategory === 'ALL' ? 'active' : ''}`}
|
|
||||||
onClick={() => setSelectedCategory('ALL')}
|
|
||||||
>
|
|
||||||
전체 <span className="count">{materials.length}</span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{/* SPECIAL 카테고리 우선 표시 */}
|
{/* SPECIAL 카테고리 우선 표시 */}
|
||||||
<button
|
<button
|
||||||
key="SPECIAL"
|
key="SPECIAL"
|
||||||
@@ -1422,7 +1412,7 @@ const NewMaterialsPage = ({
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (material.classified_category === 'PIPE' || (!material.classified_category && selectedCategory === 'ALL')) {
|
if (material.classified_category === 'PIPE') {
|
||||||
// PIPE 또는 카테고리 없는 경우 (기본 9개 컬럼)
|
// PIPE 또는 카테고리 없는 경우 (기본 9개 컬럼)
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -1568,11 +1558,9 @@ const NewMaterialsPage = ({
|
|||||||
|
|
||||||
{/* 수량 */}
|
{/* 수량 */}
|
||||||
<div className="material-cell">
|
<div className="material-cell">
|
||||||
<div className="quantity-info">
|
<span className="quantity-value">
|
||||||
<span className="quantity-value">
|
{info.quantity} {info.unit}
|
||||||
{info.quantity} {info.unit}
|
</span>
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -1639,11 +1627,9 @@ const NewMaterialsPage = ({
|
|||||||
|
|
||||||
{/* 수량 */}
|
{/* 수량 */}
|
||||||
<div className="material-cell">
|
<div className="material-cell">
|
||||||
<div className="quantity-info">
|
<span className="quantity-value">
|
||||||
<span className="quantity-value">
|
{info.quantity} {info.unit}
|
||||||
{info.quantity} {info.unit}
|
</span>
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -1717,11 +1703,9 @@ const NewMaterialsPage = ({
|
|||||||
|
|
||||||
{/* 수량 */}
|
{/* 수량 */}
|
||||||
<div className="material-cell">
|
<div className="material-cell">
|
||||||
<div className="quantity-info">
|
<span className="quantity-value">
|
||||||
<span className="quantity-value">
|
{info.quantity} {info.unit}
|
||||||
{info.quantity} {info.unit}
|
</span>
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user