diff --git a/lib/pages/home/doorAndCar/person_selection_page.dart b/lib/pages/home/doorAndCar/person_selection_page.dart index c22c8ce..5e3cb2a 100644 --- a/lib/pages/home/doorAndCar/person_selection_page.dart +++ b/lib/pages/home/doorAndCar/person_selection_page.dart @@ -186,9 +186,23 @@ class _PersonSelectionPageState extends State { final Map result = await DoorAndCarApi.getPeopleinProject(id); if (result['success'] ) { + + // 获取原始数据列表 + List rawList = result['data'] ?? []; + + // 过滤出 trainingState == "1" 的数据 + List filteredList = rawList.where((item) { + // 确保 item 是 Map,并且 trainingState 为 "1" + return item is Map && item['trainingState'] == "1"; + }).toList(); + setState(() { - list = result['data']; + list = filteredList; }); + + // setState(() { + // list = result['data']; + // }); }else{ ToastUtil.showNormal(context, '加载数据失败'); // _showMessage('加载数据失败');