缺少代码差异信息,无法生成具体的commit message。
请提供 "code differences" 的具体内容,以便我能够根据代码变更情况生成符合 Angular 规范的中文 commit message。
This commit is contained in:
@@ -5,6 +5,20 @@ enum IndicatorStatus: String, Codable, CaseIterable {
|
||||
case high, low, normal
|
||||
}
|
||||
|
||||
/// 指标录入来源。manual = 「记录指标」手动录入;quickCapture = 异常项快拍(VL);report = 报告归档携带。
|
||||
/// 旧数据无此字段 → 默认 manual(轻量迁移)。
|
||||
enum IndicatorSource: String, Codable, CaseIterable {
|
||||
case manual, quickCapture, report
|
||||
|
||||
var label: String {
|
||||
switch self {
|
||||
case .manual: return String(appLoc: "手动记录")
|
||||
case .quickCapture: return String(appLoc: "异常项快拍")
|
||||
case .report: return String(appLoc: "报告归档")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
enum ReportType: String, Codable, CaseIterable {
|
||||
case checkup, lab, imaging, prescription, other
|
||||
|
||||
@@ -38,6 +52,9 @@ final class Indicator {
|
||||
/// 用途:Trends 按 seriesKey 分组;Timeline 配对(如 bp.systolic + bp.diastolic 合并)。
|
||||
var seriesKey: String?
|
||||
|
||||
/// 录入来源(IndicatorSource.rawValue)。带默认值 → SwiftData 轻量迁移,旧记录视为手动。
|
||||
var sourceRaw: String = IndicatorSource.manual.rawValue
|
||||
|
||||
init(name: String,
|
||||
value: String,
|
||||
unit: String,
|
||||
@@ -48,7 +65,8 @@ final class Indicator {
|
||||
report: Report? = nil,
|
||||
asset: Asset? = nil,
|
||||
pinned: Bool = false,
|
||||
seriesKey: String? = nil) {
|
||||
seriesKey: String? = nil,
|
||||
source: IndicatorSource = .manual) {
|
||||
self.name = name
|
||||
self.value = value
|
||||
self.unit = unit
|
||||
@@ -60,11 +78,16 @@ final class Indicator {
|
||||
self.asset = asset
|
||||
self.pinned = pinned
|
||||
self.seriesKey = seriesKey
|
||||
self.sourceRaw = source.rawValue
|
||||
}
|
||||
|
||||
var status: IndicatorStatus {
|
||||
IndicatorStatus(rawValue: statusRaw) ?? .normal
|
||||
}
|
||||
|
||||
var source: IndicatorSource {
|
||||
IndicatorSource(rawValue: sourceRaw) ?? .manual
|
||||
}
|
||||
}
|
||||
|
||||
@Model
|
||||
|
||||
Reference in New Issue
Block a user