From 4eb71775167ae903aea17bb410c6201e872daf66 Mon Sep 17 00:00:00 2001
From: tony.cheng <chengmingwei_1984122@126.com>
Date: Thu, 05 Feb 2026 16:35:50 +0800
Subject: [PATCH] feat: 优化类案推荐功能 - 相似度分级、分页加载、详情字段扩展及法条显示优化

---
 web-app/src/components/dashboard/TopSection.jsx |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/web-app/src/components/dashboard/TopSection.jsx b/web-app/src/components/dashboard/TopSection.jsx
index 370a311..fe61d02 100644
--- a/web-app/src/components/dashboard/TopSection.jsx
+++ b/web-app/src/components/dashboard/TopSection.jsx
@@ -1,15 +1,20 @@
 import React from 'react';
+import { useCaseData } from '../../contexts/CaseDataContext';
+import { translateMediationState } from '../../utils/stateTranslator';
 
 /**
  * 顶部区域组件 - 标题、AI状态、案件信息
  */
-const TopSection = ({ caseInfo = {}, aiStatus = 'AI调解中' }) => {
-  const {
-    caseNumber = 'LD-2026-0014',
-    disputeType = '劳动争议/拖欠、克扣工资',
-    startTime = '2026-01-15 09:30',
-    endTime = '2026-01-15 11:00',
-  } = caseInfo;
+const TopSection = () => {
+  const { caseData } = useCaseData();
+  const timeline = caseData || {};
+  
+  // 从 timeline 中获取数据,提供默认值
+  const caseNumber = timeline.case_ref || 'LD-2026-0014';
+  const disputeType = timeline.case_type_first_name || '劳动争议/拖欠、克扣工资';
+  const startTime = timeline.mediation?.start_date || '2026-01-15 09:30';
+  const endTime = timeline.mediation?.end_date || '2026-01-15 11:00';
+  const aiStatus = translateMediationState(timeline.mediation?.state) || 'AI调解中';
 
   return (
     <section className="top-section">

--
Gitblit v1.8.0