feat: Equipment DTO 호환성 수정 전 백업 커밋
- Equipment DTO 필드명 변경 (name → equipment_number 등) 완료 - Phase 1-7 파생 수정사항 체계적 진행 예정 - 통합 모델 정리, Controller 동기화, UI 업데이트 예정 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -618,10 +618,8 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
Routes.equipmentInAdd,
|
||||
);
|
||||
if (result == true) {
|
||||
setState(() {
|
||||
_controller.loadData();
|
||||
_controller.goToPage(1);
|
||||
});
|
||||
// 입고 완료 후 데이터 새로고침 (중복 방지)
|
||||
_controller.refresh();
|
||||
}
|
||||
},
|
||||
variant: ShadcnButtonVariant.primary,
|
||||
@@ -693,10 +691,8 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
Routes.equipmentInAdd,
|
||||
);
|
||||
if (result == true) {
|
||||
setState(() {
|
||||
_controller.loadData();
|
||||
_controller.goToPage(1);
|
||||
});
|
||||
// 입고 완료 후 데이터 새로고침 (중복 방지)
|
||||
_controller.refresh();
|
||||
}
|
||||
},
|
||||
variant: ShadcnButtonVariant.primary,
|
||||
@@ -743,7 +739,11 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
totalWidth += 100; // 카테고리
|
||||
totalWidth += 50; // 수량
|
||||
totalWidth += 70; // 상태
|
||||
totalWidth += 80; // 날짜
|
||||
totalWidth += 80; // 입출고일
|
||||
totalWidth += 120; // 입고지
|
||||
totalWidth += 120; // 구매처
|
||||
totalWidth += 100; // 구매일
|
||||
totalWidth += 100; // 구매가격
|
||||
totalWidth += 90; // 관리
|
||||
|
||||
// 상세 컬럼들 (조건부)
|
||||
@@ -751,10 +751,8 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
totalWidth += 120; // 시리얼번호
|
||||
totalWidth += 120; // 바코드
|
||||
totalWidth += 120; // 현재 위치
|
||||
totalWidth += 100; // 창고 위치
|
||||
totalWidth += 100; // 창고 위치 (중복 - 입고지와 다름)
|
||||
totalWidth += 100; // 점검일
|
||||
totalWidth += 100; // 구매일
|
||||
totalWidth += 100; // 구매가격
|
||||
}
|
||||
|
||||
// padding 추가 (좌우 각 16px)
|
||||
@@ -853,15 +851,21 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
_buildHeaderCell('수량', flex: 1, useExpanded: useExpanded, minWidth: 50),
|
||||
// 상태
|
||||
_buildHeaderCell('상태', flex: 2, useExpanded: useExpanded, minWidth: 70),
|
||||
// 날짜
|
||||
_buildHeaderCell('날짜', flex: 2, useExpanded: useExpanded, minWidth: 80),
|
||||
// 입출고일
|
||||
_buildHeaderCell('입출고일', flex: 2, useExpanded: useExpanded, minWidth: 80),
|
||||
// 입고지
|
||||
_buildHeaderCell('입고지', flex: 3, useExpanded: useExpanded, minWidth: 120),
|
||||
// 구매처
|
||||
_buildHeaderCell('구매처', flex: 3, useExpanded: useExpanded, minWidth: 120),
|
||||
// 구매일
|
||||
_buildHeaderCell('구매일', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
// 구매가격
|
||||
_buildHeaderCell('구매가격', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
// 상세 정보 (조건부)
|
||||
if (_showDetailedColumns) ...[
|
||||
_buildHeaderCell('현재 위치', flex: 3, useExpanded: useExpanded, minWidth: 120),
|
||||
_buildHeaderCell('창고 위치', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
_buildHeaderCell('점검일', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
_buildHeaderCell('구매일', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
_buildHeaderCell('구매가격', flex: 2, useExpanded: useExpanded, minWidth: 100),
|
||||
],
|
||||
// 관리
|
||||
_buildHeaderCell('관리', flex: 2, useExpanded: useExpanded, minWidth: 90),
|
||||
@@ -975,13 +979,57 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 70,
|
||||
),
|
||||
// 날짜
|
||||
// 입출고일
|
||||
_buildDataCell(
|
||||
_buildDateWidget(equipment),
|
||||
_buildCreatedDateWidget(equipment),
|
||||
flex: 2,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 80,
|
||||
),
|
||||
// 입고지
|
||||
_buildDataCell(
|
||||
Text(
|
||||
equipment.warehouseLocation ?? '-',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
),
|
||||
flex: 3,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 120,
|
||||
),
|
||||
// 구매처 (회사명)
|
||||
_buildDataCell(
|
||||
Text(
|
||||
equipment.currentCompany ?? '-',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
),
|
||||
flex: 3,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 120,
|
||||
),
|
||||
// 구매일
|
||||
_buildDataCell(
|
||||
Text(
|
||||
equipment.equipment.purchaseDate != null
|
||||
? '${equipment.equipment.purchaseDate!.year}/${equipment.equipment.purchaseDate!.month.toString().padLeft(2, '0')}/${equipment.equipment.purchaseDate!.day.toString().padLeft(2, '0')}'
|
||||
: '-',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
),
|
||||
flex: 2,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 100,
|
||||
),
|
||||
// 구매가격
|
||||
_buildDataCell(
|
||||
Text(
|
||||
equipment.equipment.purchasePrice != null
|
||||
? '₩${equipment.equipment.purchasePrice!.toStringAsFixed(0).replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},')}'
|
||||
: '-',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
),
|
||||
flex: 2,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 100,
|
||||
),
|
||||
// 상세 정보 (조건부)
|
||||
if (_showDetailedColumns) ...[
|
||||
// 현재 위치 (회사 + 지점)
|
||||
@@ -1011,30 +1059,6 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 100,
|
||||
),
|
||||
// 구매일
|
||||
_buildDataCell(
|
||||
Text(
|
||||
equipment.equipment.inDate != null
|
||||
? '${equipment.equipment.inDate!.year}/${equipment.equipment.inDate!.month.toString().padLeft(2, '0')}/${equipment.equipment.inDate!.day.toString().padLeft(2, '0')}'
|
||||
: '-',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
),
|
||||
flex: 2,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 100,
|
||||
),
|
||||
// 구매가격
|
||||
_buildDataCell(
|
||||
Text(
|
||||
equipment.equipment.purchasePrice != null
|
||||
? '₩${equipment.equipment.purchasePrice!.toStringAsFixed(0).replaceAllMapped(RegExp(r'(\d{1,3})(?=(\d{3})+(?!\d))'), (Match m) => '${m[1]},')}'
|
||||
: '-',
|
||||
style: ShadcnTheme.bodySmall,
|
||||
),
|
||||
flex: 2,
|
||||
useExpanded: useExpanded,
|
||||
minWidth: 100,
|
||||
),
|
||||
],
|
||||
// 관리
|
||||
_buildDataCell(
|
||||
@@ -1159,8 +1183,8 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
);
|
||||
}
|
||||
|
||||
/// 날짜 위젯 빌더
|
||||
Widget _buildDateWidget(UnifiedEquipment equipment) {
|
||||
/// 입출고일 위젯 빌더
|
||||
Widget _buildCreatedDateWidget(UnifiedEquipment equipment) {
|
||||
String dateStr = equipment.date.toString().substring(0, 10);
|
||||
return Text(
|
||||
dateStr,
|
||||
@@ -1288,23 +1312,63 @@ class _EquipmentListState extends State<EquipmentList> {
|
||||
return '${category.substring(0, 2)}...';
|
||||
}
|
||||
|
||||
/// 카테고리 툴팁 위젯
|
||||
/// 영어 카테고리를 한국어로 변환
|
||||
String _translateCategory(String category) {
|
||||
const Map<String, String> categoryMap = {
|
||||
// 대분류
|
||||
'Network': '네트워크',
|
||||
'Server': '서버',
|
||||
'Storage': '스토리지',
|
||||
'Security': '보안',
|
||||
'Computer': '컴퓨터',
|
||||
'Mobile': '모바일',
|
||||
'Printer': '프린터',
|
||||
'Monitor': '모니터',
|
||||
'Peripheral': '주변기기',
|
||||
// 중분류
|
||||
'Router': '라우터',
|
||||
'Switch': '스위치',
|
||||
'Firewall': '방화벽',
|
||||
'Laptop': '노트북',
|
||||
'Desktop': '데스크톱',
|
||||
'Tablet': '태블릿',
|
||||
'Smartphone': '스마트폰',
|
||||
'Scanner': '스캐너',
|
||||
'Keyboard': '키보드',
|
||||
'Mouse': '마우스',
|
||||
// 소분류 예시
|
||||
'Wireless': '무선',
|
||||
'Wired': '유선',
|
||||
'Gaming': '게이밍',
|
||||
'Office': '사무용',
|
||||
};
|
||||
|
||||
return categoryMap[category] ?? category;
|
||||
}
|
||||
|
||||
/// 카테고리 툴팁 위젯 (한국어 변환 적용)
|
||||
Widget _buildCategoryWithTooltip(UnifiedEquipment equipment) {
|
||||
// 영어→한국어 변환 적용
|
||||
final translatedCategory = _translateCategory(equipment.equipment.category);
|
||||
final translatedSubCategory = _translateCategory(equipment.equipment.subCategory);
|
||||
final translatedSubSubCategory = _translateCategory(equipment.equipment.subSubCategory);
|
||||
|
||||
final fullCategory = EquipmentDisplayHelper.formatCategory(
|
||||
equipment.equipment.category,
|
||||
equipment.equipment.subCategory,
|
||||
equipment.equipment.subSubCategory,
|
||||
translatedCategory,
|
||||
translatedSubCategory,
|
||||
translatedSubSubCategory,
|
||||
);
|
||||
|
||||
// 축약 표기 적용 - 비어있지 않은 카테고리만 표시
|
||||
final List<String> parts = [];
|
||||
if (equipment.equipment.category.isNotEmpty) {
|
||||
parts.add(_shortenCategory(equipment.equipment.category));
|
||||
if (translatedCategory.isNotEmpty) {
|
||||
parts.add(_shortenCategory(translatedCategory));
|
||||
}
|
||||
if (equipment.equipment.subCategory.isNotEmpty) {
|
||||
parts.add(_shortenCategory(equipment.equipment.subCategory));
|
||||
if (translatedSubCategory.isNotEmpty) {
|
||||
parts.add(_shortenCategory(translatedSubCategory));
|
||||
}
|
||||
if (equipment.equipment.subSubCategory.isNotEmpty) {
|
||||
parts.add(_shortenCategory(equipment.equipment.subSubCategory));
|
||||
if (translatedSubSubCategory.isNotEmpty) {
|
||||
parts.add(_shortenCategory(translatedSubSubCategory));
|
||||
}
|
||||
final shortCategory = parts.join(' > ');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user