결재 단계 필터 개선

This commit is contained in:
JiWoong Sul
2025-09-25 16:53:43 +09:00
parent 35b9002688
commit c31f6217ef
3 changed files with 68 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ class ApprovalStepController extends ChangeNotifier {
bool _isLoading = false;
String _query = '';
int? _statusId;
int? _approverId;
String? _errorMessage;
bool _isLoadingDetail = false;
ApprovalStepRecord? _selected;
@@ -22,6 +23,7 @@ class ApprovalStepController extends ChangeNotifier {
bool get isLoading => _isLoading;
String get query => _query;
int? get statusId => _statusId;
int? get approverId => _approverId;
String? get errorMessage => _errorMessage;
bool get isLoadingDetail => _isLoadingDetail;
ApprovalStepRecord? get selected => _selected;
@@ -37,6 +39,7 @@ class ApprovalStepController extends ChangeNotifier {
pageSize: _result?.pageSize ?? 20,
query: sanitizedQuery.isEmpty ? null : sanitizedQuery,
statusId: _statusId,
approverId: _approverId,
);
_result = response;
} catch (e) {
@@ -57,6 +60,11 @@ class ApprovalStepController extends ChangeNotifier {
notifyListeners();
}
void updateApproverId(int? value) {
_approverId = value;
notifyListeners();
}
Future<ApprovalStepRecord?> fetchDetail(int id) async {
_isLoadingDetail = true;
_errorMessage = null;
@@ -84,11 +92,13 @@ class ApprovalStepController extends ChangeNotifier {
notifyListeners();
}
bool get hasActiveFilters => _query.trim().isNotEmpty || _statusId != null;
bool get hasActiveFilters =>
_query.trim().isNotEmpty || _statusId != null || _approverId != null;
void resetFilters() {
_query = '';
_statusId = null;
_approverId = null;
notifyListeners();
}
}