feat(training): 新增已结束筛选并精简课程展示
新增已结束任务筛选与只读回顾资格,保留搜索和游标分页。移除任务小节数量及课程附件文件名、切换入口,并更新接口和界面回归测试。
This commit is contained in:
@@ -79,6 +79,7 @@ extension TrainingLearnerStatus: Codable {
|
||||
switch try container.decode(String.self) {
|
||||
case "pending": self = .pendingExam
|
||||
case "completed": self = .completed
|
||||
case "ended": self = .ended
|
||||
default: throw DecodingError.dataCorruptedError(in: container, debugDescription: "Unknown training learner status")
|
||||
}
|
||||
}
|
||||
@@ -88,7 +89,7 @@ extension TrainingLearnerStatus: Codable {
|
||||
try container.encode(apiValue)
|
||||
}
|
||||
/// 查询参数使用的正式状态值。
|
||||
var apiValue: String { self == .completed ? "completed" : "pending" }
|
||||
var apiValue: String { switch self { case .pendingExam: "pending"; case .completed: "completed"; case .ended: "ended" } }
|
||||
}
|
||||
|
||||
/// 游标分页;小节、附件、任务和成绩复用相同分页边界。
|
||||
|
||||
@@ -6,12 +6,12 @@ enum TrainingMode: String, Codable, Sendable { case study, exam }
|
||||
/// 任务发布状态;关闭后只允许回顾。
|
||||
enum TrainingTaskStatus: String, Codable, Sendable { case published, closed }
|
||||
|
||||
/// 学员列表统一展示的两种状态。
|
||||
/// 学员任务列表的待办、完成与结束状态。
|
||||
enum TrainingLearnerStatus: String, CaseIterable, Sendable {
|
||||
case pendingExam, completed
|
||||
case pendingExam, completed, ended
|
||||
|
||||
/// 面向学员的状态名称。
|
||||
var title: String { self == .completed ? "已完成" : "待考试" }
|
||||
var title: String { switch self { case .pendingExam: "待考试"; case .completed: "已完成"; case .ended: "已结束" } }
|
||||
}
|
||||
|
||||
/// 单选和多选题型。
|
||||
|
||||
Reference in New Issue
Block a user