From 844c875028a3aee6d2ffc910e72681c41fce2caf Mon Sep 17 00:00:00 2001
From: tony.cheng <chengmingwei_1984122@126.com>
Date: Tue, 03 Mar 2026 16:59:24 +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..bc55e94 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 || '---';
+  const disputeType = timeline.case_type_first_name || '---';
+  const startTime = timeline.mediation?.start_date || '---';
+  const endTime = timeline.mediation?.end_date || '---';
+  const aiStatus = translateMediationState(timeline.mediation?.state) || '---';
 
   return (
     <section className="top-section">

--
Gitblit v1.8.0