修复工作人员作业预检状态与提示

This commit is contained in:
czl231
2026-09-05 20:17:07 +08:00
parent 1670d5880f
commit cec02c8887
8 changed files with 191 additions and 12 deletions

View File

@@ -35,6 +35,12 @@ class PreflightResult {
final bool canWork;
final Map<String, Object?> checks;
/// 仅统计真正阻止进入工作台的检查项。
int get blockerCount => checks.values.where((value) {
final detail = _map(value);
return detail['status'] == 'blocked';
}).length;
factory PreflightResult.fromJson(Map<String, Object?> json) => PreflightResult(
roleCode: json['role_code'] as String? ?? '',
workStatus: json['work_status'] as String? ?? 'off_duty',