feat(capture): 统一报告捕获流程并集成视觉语言模型识别
- 替换 QuickCaptureFlow 和 ArchiveFlow 为 UnifiedCaptureFlow 统一流程 - 新增 VLSession 封装 Qwen2.5-VL 模型进行图像文本推理 - 实现 AIRuntime 中 VL 模型的准备和分析功能 - 添加 VLPrompts 定义体检化验单识别的 JSON 输出模板 - 创建 CaptureReviewForm 提供 VL 解析结果的可编辑表单界面 - 集成 VisionKit 文档扫描器支持真机多页文档扫描 - 为模拟器实现 PhotosPicker 回退方案选择已有照片 - 在 RootView 中统一使用 UnifiedCaptureFlow 处理快速和归档流程 - 添加 CustomMetricEditor 支持自定义监测指标的创建编辑删除 - 扩展 KangkangApp 模型配置以支持新数据类型 - 实现档案列表中症状结束功能通过时间线行点击触发
This commit is contained in:
@@ -4,14 +4,19 @@ import SwiftData
|
||||
struct MeView: View {
|
||||
@Environment(\.modelContext) private var ctx
|
||||
@Query private var profiles: [UserProfile]
|
||||
@Query private var reminders: [MetricReminder]
|
||||
@Query private var customMetrics: [CustomMonitorMetric]
|
||||
|
||||
private var profile: UserProfile? { profiles.first }
|
||||
private var enabledReminderCount: Int { reminders.filter(\.enabled).count }
|
||||
|
||||
var body: some View {
|
||||
NavigationStack {
|
||||
ScrollView {
|
||||
VStack(spacing: 12) {
|
||||
profileCard
|
||||
remindersCard
|
||||
customMetricsCard
|
||||
settingsCard(title: "模型管理",
|
||||
detail: "未配置",
|
||||
icon: "cpu")
|
||||
@@ -77,6 +82,85 @@ struct MeView: View {
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
private var remindersCard: some View {
|
||||
NavigationLink {
|
||||
RemindersListView()
|
||||
} label: {
|
||||
HStack(spacing: 12) {
|
||||
ZStack {
|
||||
Circle()
|
||||
.fill(enabledReminderCount > 0 ? Tj.Palette.amber.opacity(0.25) : Tj.Palette.sand2)
|
||||
Image(systemName: "bell.fill")
|
||||
.font(.system(size: 18))
|
||||
.foregroundStyle(enabledReminderCount > 0 ? Tj.Palette.ink : Tj.Palette.text2)
|
||||
}
|
||||
.frame(width: 44, height: 44)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text("记录提醒")
|
||||
.font(.system(size: 15, weight: .semibold))
|
||||
.foregroundStyle(Tj.Palette.text)
|
||||
Text(reminderLine)
|
||||
.font(.system(size: 12))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
.lineLimit(1)
|
||||
}
|
||||
Spacer()
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.system(size: 13, weight: .medium))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
}
|
||||
.padding(14)
|
||||
.tjCard()
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
private var reminderLine: String {
|
||||
if reminders.isEmpty { return "尚未设置" }
|
||||
if enabledReminderCount == 0 { return "全部已关闭(\(reminders.count) 条)" }
|
||||
return "\(enabledReminderCount) 项启用"
|
||||
}
|
||||
|
||||
private var customMetricsCard: some View {
|
||||
NavigationLink {
|
||||
CustomMetricsListView()
|
||||
} label: {
|
||||
HStack(spacing: 12) {
|
||||
ZStack {
|
||||
Circle()
|
||||
.fill(customMetrics.isEmpty ? Tj.Palette.sand2 : Tj.Palette.leafSoft)
|
||||
Image(systemName: "slider.horizontal.3")
|
||||
.font(.system(size: 18))
|
||||
.foregroundStyle(customMetrics.isEmpty ? Tj.Palette.text2 : Tj.Palette.ink)
|
||||
}
|
||||
.frame(width: 44, height: 44)
|
||||
|
||||
VStack(alignment: .leading, spacing: 2) {
|
||||
Text("自定义指标")
|
||||
.font(.system(size: 15, weight: .semibold))
|
||||
.foregroundStyle(Tj.Palette.text)
|
||||
Text(customMetricsLine)
|
||||
.font(.system(size: 12))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
.lineLimit(1)
|
||||
}
|
||||
Spacer()
|
||||
Image(systemName: "chevron.right")
|
||||
.font(.system(size: 13, weight: .medium))
|
||||
.foregroundStyle(Tj.Palette.text3)
|
||||
}
|
||||
.padding(14)
|
||||
.tjCard()
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
}
|
||||
|
||||
private var customMetricsLine: String {
|
||||
if customMetrics.isEmpty { return "添加你自己的长期监测项" }
|
||||
return "\(customMetrics.count) 项"
|
||||
}
|
||||
|
||||
private func settingsCard(title: String, detail: String, icon: String) -> some View {
|
||||
HStack(spacing: 12) {
|
||||
ZStack {
|
||||
@@ -114,6 +198,7 @@ struct MeView: View {
|
||||
MeView()
|
||||
.modelContainer(for: [
|
||||
UserProfile.self, Indicator.self, Report.self, DiaryEntry.self,
|
||||
Asset.self, ChatTurn.self, Symptom.self,
|
||||
Asset.self, ChatTurn.self, Symptom.self, MetricReminder.self,
|
||||
CustomMonitorMetric.self,
|
||||
], inMemory: true)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user