```
feat(AI): 集成MNN推理引擎替换MLX作为主AI运行时 - 引入MNN(alibaba) + Arm SME2 + CPU作为主AI运行时,支持A19/iPhone17的 SME2和A17的NEON加速 - 添加MLX Swift作为兜底GPU推理方案,实现双后端切换机制 - 使用单一Qwen3.5-2B多模态模型(1.2GB),替代原有的LLM+VL分离架构 - 实现InferenceEngine.current引擎选择逻辑,真机默认MNN,模拟器回退MLX - 更新AIAgent架构,通过MNNLLMBridge(ObjC++) → MNNBackend进行推理 - 修改队列机制防止并发推理导致OOM,使用信号量闸门控制显存占用 - 更新文档中的技术栈说明、模块边界和周次交付计划 ```
This commit is contained in:
39
康康/Features/Indicator/RecordAnotherButton.swift
Normal file
39
康康/Features/Indicator/RecordAnotherButton.swift
Normal file
@@ -0,0 +1,39 @@
|
||||
import SwiftUI
|
||||
|
||||
extension IndicatorQuickSheet.Prefill {
|
||||
/// 从一条已有指标推断「再记一条」的预选目标:
|
||||
/// seriesKey 命中长期监测 / 自定义指标则预选对应预设(进趋势 + 自动判异常),否则按 name/unit/range 自由预填。
|
||||
init(indicator i: Indicator) {
|
||||
self.init(seriesKey: i.seriesKey, name: i.name, unit: i.unit, range: i.range)
|
||||
}
|
||||
}
|
||||
|
||||
/// 指标详情 / 同类聚合详情底部「再记一条」按钮:打开预选同款指标的录入表单(数值留空,由用户填新读数)。
|
||||
/// 自带弹窗状态,`TimelineEntryDetailView` 与 `IndicatorSeriesDetailView` 共用同一组件。
|
||||
struct RecordAnotherButton: View {
|
||||
/// 按钮文案里显示的指标名(如「空腹血糖」「血压」)。
|
||||
let name: String
|
||||
/// 打开录入表单时的预选目标。
|
||||
let prefill: IndicatorQuickSheet.Prefill
|
||||
|
||||
@State private var showSheet = false
|
||||
|
||||
var body: some View {
|
||||
Button { showSheet = true } label: {
|
||||
Label(String(appLoc: "再记一条「\(name)」"), systemImage: "plus.circle.fill")
|
||||
.font(.tjScaled( 13, weight: .semibold))
|
||||
.foregroundStyle(Tj.Palette.ink)
|
||||
.frame(maxWidth: .infinity)
|
||||
.padding(.vertical, 12)
|
||||
.background(
|
||||
RoundedRectangle(cornerRadius: Tj.Radius.md, style: .continuous)
|
||||
.fill(Tj.Palette.leaf.opacity(0.16))
|
||||
)
|
||||
.contentShape(Rectangle())
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.sheet(isPresented: $showSheet) {
|
||||
IndicatorQuickSheet(prefill: prefill)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user