feat: AI 对话附件上下文解析 + 历史会话归档 + 多页面 UI 重构

- 后端: 新增 AttachmentContextBuilder 解析图片/PDF 摘要并拼入 LLM 上下文; ai_chat_endpoints 扩展附件接口; 新增 ReportAnalysisService
- 前端: 新增历史会话页与 conversation_history_provider; chat 链路支持附件展示与回放
- UI: 重构 medication_checkin / notification_center / profile / health_drawer 等多页面
- 配置: api_client baseUrl 适配当前 WiFi IP
This commit is contained in:
MingNian
2026-07-06 12:44:59 +08:00
parent 4507083f3f
commit 7a93237069
38 changed files with 4165 additions and 1157 deletions

View File

@@ -18,6 +18,7 @@ class EnterpriseHeader extends StatelessWidget {
final Color accent;
final List<EnterpriseStat> stats;
final Widget? trailing;
final bool showIcon;
const EnterpriseHeader({
super.key,
@@ -28,23 +29,91 @@ class EnterpriseHeader extends StatelessWidget {
required this.accent,
this.stats = const [],
this.trailing,
this.showIcon = true,
});
@override
Widget build(BuildContext context) {
return Row(
children: [
for (var i = 0; i < stats.length; i++) ...[
Expanded(
child: _HeaderStat(
stat: stats[i],
color: i.isEven ? color : accent,
accent: i.isEven ? accent : color,
),
return Container(
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(color: AppColors.border, width: 1.1),
boxShadow: [AppTheme.shadowLight],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
if (showIcon) ...[
Container(
width: 46,
height: 46,
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
end: Alignment.bottomRight,
colors: [color, accent],
),
borderRadius: BorderRadius.circular(14),
),
child: Icon(icon, color: Colors.white, size: 25),
),
const SizedBox(width: 12),
],
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: AppColors.textPrimary,
fontSize: 20,
fontWeight: FontWeight.w900,
),
),
const SizedBox(height: 3),
Text(
subtitle,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: AppColors.textSecondary,
fontSize: 14,
fontWeight: FontWeight.w600,
height: 1.25,
),
),
],
),
),
if (trailing != null) ...[const SizedBox(width: 10), trailing!],
],
),
if (i != stats.length - 1) const SizedBox(width: 8),
if (stats.isNotEmpty) ...[
const SizedBox(height: 14),
Row(
children: [
for (var i = 0; i < stats.length; i++) ...[
Expanded(
child: _HeaderStat(
stat: stats[i],
color: i.isEven ? color : accent,
accent: i.isEven ? accent : color,
),
),
if (i != stats.length - 1) const SizedBox(width: 8),
],
],
),
],
],
],
),
);
}
}
@@ -63,8 +132,8 @@ class _HeaderStat extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
constraints: const BoxConstraints(minHeight: 54),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 9),
constraints: const BoxConstraints(minHeight: 66),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 11),
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topLeft,
@@ -80,8 +149,8 @@ class _HeaderStat extends StatelessWidget {
child: Row(
children: [
if (stat.icon != null) ...[
Icon(stat.icon, color: color, size: 16),
const SizedBox(width: 6),
Icon(stat.icon, color: color, size: 19),
const SizedBox(width: 8),
],
Expanded(
child: Column(
@@ -93,8 +162,8 @@ class _HeaderStat extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: AppColors.textPrimary,
fontSize: 14,
fontWeight: FontWeight.w800,
fontSize: 17,
fontWeight: FontWeight.w900,
),
),
const SizedBox(height: 2),
@@ -104,8 +173,8 @@ class _HeaderStat extends StatelessWidget {
overflow: TextOverflow.ellipsis,
style: const TextStyle(
color: AppColors.textSecondary,
fontSize: 11,
fontWeight: FontWeight.w700,
fontSize: 12,
fontWeight: FontWeight.w800,
),
),
],