| | |
| | | let item = stuViewModel.dataSource.value[indexPath.row] |
| | | if self.selectStudents.contains(where: {($0 as! CourseDetailStudentModel).id == item.id}){ |
| | | if self.selectStudents.count == 1{ |
| | | alert(msg: "至少选择一位学员");return |
| | | alert(msg: "至少选择一位运动营成员");return |
| | | } |
| | | if let index = self.selectStudents.firstIndex(where: {($0 as! CourseDetailStudentModel).id == item.id}){ |
| | | self.selectStudents.remove(at: index) |
| | |
| | | let item = actViewModel.dataSource.value[indexPath.row] |
| | | if self.selectStudents.contains(where: {($0 as! ActivityDetailPartModel).id == item.id}){ |
| | | if self.selectStudents.count == 1{ |
| | | alert(msg: "至少选择一位参赛学员");return |
| | | alert(msg: "至少选择一位参赛运动营成员");return |
| | | } |
| | | if let index = self.selectStudents.firstIndex(where: {($0 as! ActivityDetailPartModel).id == item.id}){ |
| | | self.selectStudents.remove(at: index) |