feat: 소프트 딜리트 기능 전면 구현 완료
## 주요 변경사항 - Company, Equipment, License, Warehouse Location 모든 화면에 소프트 딜리트 구현 - 관리자 권한으로 삭제된 데이터 조회 가능 (includeInactive 파라미터) - 데이터 무결성 보장을 위한 논리 삭제 시스템 완성 ## 기능 개선 - 각 리스트 컨트롤러에 toggleIncludeInactive() 메서드 추가 - UI에 "비활성 포함" 체크박스 추가 (관리자 전용) - API 데이터소스에 includeInactive 파라미터 지원 ## 문서 정리 - 불필요한 문서 파일 제거 및 재구성 - CLAUDE.md 프로젝트 상태 업데이트 (진행률 80%) - 테스트 결과 문서화 (test20250812v01.md) ## UI 컴포넌트 - Equipment 화면 위젯 모듈화 (custom_dropdown_field, equipment_basic_info_section) - 폼 유효성 검증 강화 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ class WarehouseLocationListController extends BaseListController<WarehouseLocati
|
||||
|
||||
// 필터 옵션
|
||||
bool? _isActive;
|
||||
bool _includeInactive = false; // 비활성 창고 포함 여부
|
||||
|
||||
WarehouseLocationListController() {
|
||||
if (GetIt.instance.isRegistered<WarehouseService>()) {
|
||||
@@ -25,6 +26,13 @@ class WarehouseLocationListController extends BaseListController<WarehouseLocati
|
||||
// 추가 Getters
|
||||
List<WarehouseLocation> get warehouseLocations => items;
|
||||
bool? get isActive => _isActive;
|
||||
bool get includeInactive => _includeInactive;
|
||||
|
||||
// 비활성 포함 토글
|
||||
void toggleIncludeInactive() {
|
||||
_includeInactive = !_includeInactive;
|
||||
loadData(isRefresh: true);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PagedResult<WarehouseLocation>> fetchData({
|
||||
@@ -37,6 +45,8 @@ class WarehouseLocationListController extends BaseListController<WarehouseLocati
|
||||
page: params.page,
|
||||
perPage: params.perPage,
|
||||
isActive: _isActive,
|
||||
search: params.search,
|
||||
includeInactive: _includeInactive,
|
||||
),
|
||||
onError: (failure) {
|
||||
throw failure;
|
||||
@@ -129,8 +139,11 @@ class WarehouseLocationListController extends BaseListController<WarehouseLocati
|
||||
},
|
||||
);
|
||||
|
||||
// 로컬 삭제
|
||||
removeItemLocally((l) => l.id == id);
|
||||
// 로컬 삭제 대신 서버에서 새로고침
|
||||
// removeItemLocally((l) => l.id == id);
|
||||
|
||||
// 삭제 후 리스트 새로고침 (서버에서 10개 다시 가져오기)
|
||||
await refresh();
|
||||
}
|
||||
|
||||
// 사용 중인 창고 위치 조회
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:superport/models/warehouse_location_model.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
@@ -10,6 +11,7 @@ import 'package:superport/screens/common/widgets/standard_action_bar.dart';
|
||||
import 'package:superport/screens/common/widgets/standard_states.dart';
|
||||
import 'package:superport/screens/common/layouts/base_list_screen.dart';
|
||||
import 'package:superport/screens/warehouse_location/controllers/warehouse_location_list_controller.dart';
|
||||
import 'package:superport/services/auth_service.dart';
|
||||
import 'package:superport/utils/constants.dart';
|
||||
import 'package:superport/core/widgets/auth_guard.dart';
|
||||
|
||||
@@ -25,6 +27,9 @@ class WarehouseLocationList extends StatefulWidget {
|
||||
class _WarehouseLocationListState
|
||||
extends State<WarehouseLocationList> {
|
||||
late WarehouseLocationListController _controller;
|
||||
final TextEditingController _searchController = TextEditingController();
|
||||
final AuthService _authService = GetIt.instance<AuthService>();
|
||||
bool _isAdmin = false;
|
||||
// 페이지 상태는 이제 Controller에서 관리
|
||||
|
||||
@override
|
||||
@@ -33,13 +38,21 @@ class _WarehouseLocationListState
|
||||
_controller = WarehouseLocationListController();
|
||||
_controller.pageSize = 10; // 페이지 크기를 10으로 설정
|
||||
// 초기 데이터 로드
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||
_controller.loadWarehouseLocations();
|
||||
// 사용자 권한 확인
|
||||
final user = await _authService.getCurrentUser();
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_isAdmin = user?.role == 'admin';
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_searchController.dispose();
|
||||
_controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -120,8 +133,17 @@ class _WarehouseLocationListState
|
||||
: '등록된 입고지가 없습니다',
|
||||
emptyIcon: Icons.warehouse_outlined,
|
||||
|
||||
// 검색바 (기본 비어있음)
|
||||
searchBar: Container(),
|
||||
// 검색바
|
||||
searchBar: UnifiedSearchBar(
|
||||
controller: _searchController,
|
||||
placeholder: '창고명, 주소로 검색',
|
||||
onChanged: (value) => _controller.search(value),
|
||||
onSearch: () => _controller.search(_searchController.text),
|
||||
onClear: () {
|
||||
_searchController.clear();
|
||||
_controller.search('');
|
||||
},
|
||||
),
|
||||
|
||||
// 액션바
|
||||
actionBar: StandardActionBar(
|
||||
@@ -134,6 +156,21 @@ class _WarehouseLocationListState
|
||||
icon: Icon(Icons.add),
|
||||
),
|
||||
],
|
||||
rightActions: [
|
||||
// 관리자용 비활성 포함 체크박스
|
||||
if (_isAdmin)
|
||||
Row(
|
||||
children: [
|
||||
Checkbox(
|
||||
value: controller.includeInactive,
|
||||
onChanged: (_) => setState(() {
|
||||
controller.toggleIncludeInactive();
|
||||
}),
|
||||
),
|
||||
const Text('비활성 포함'),
|
||||
],
|
||||
),
|
||||
],
|
||||
totalCount: totalCount,
|
||||
onRefresh: _reload,
|
||||
statusMessage:
|
||||
|
||||
Reference in New Issue
Block a user