chengmw
9 days ago 529af79115af1e72bcd4d9a0dce63bb89cc4a5ab
web-app/src/App.js
@@ -1,4 +1,4 @@
import React, { useState } from 'react';
import React, { useState, useRef } from 'react';
import { Spin } from 'antd';
import './App.css';
@@ -16,6 +16,10 @@
import ToolModal from './components/common/ToolModal';
import OutboundCallWidget from './components/common/OutboundCallWidget';
// 新增组件
import AppHeader from './components/common/AppHeader';
import WarningAlert from './components/common/WarningAlert';
// 工具内容组件
import WageCalculatorContent from './components/tools/WageCalculatorContent';
import LawSearchContent from './components/tools/LawSearchContent';
@@ -32,7 +36,10 @@
function AppContent() {
  const [activeModal, setActiveModal] = useState(null);
  const { loading } = useCaseData();
  const { loading, refreshData } = useCaseData();
  // TabContainer ref - 用于切换Tab
  const tabContainerRef = useRef(null);
  // 工具配置
  const toolConfig = {
@@ -66,6 +73,25 @@
    setActiveModal(null);
  };
  /**
   * 切换Tab页签
   * @param {string} tabKey - Tab键名
   */
  const handleSwitchTab = (tabKey) => {
    if (tabContainerRef.current) {
      tabContainerRef.current.switchTab(tabKey);
    }
  };
  /**
   * 刷新案件数据
   */
  const handleRefreshData = () => {
    if (refreshData) {
      refreshData();
    }
  };
  const renderModalContent = () => {
    if (!activeModal || !toolConfig[activeModal]) return null;
    const Component = toolConfig[activeModal].component;
@@ -81,6 +107,9 @@
          href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"
        />
        {/* 蓝色顶部Header */}
        <AppHeader />
        {/* 顶部区域 */}
        <TopSection />
@@ -91,8 +120,11 @@
            {/* AI调解进度 */}
            <MediationProgress />
            {/* 预警提示消息 */}
            <WarningAlert />
            {/* 选项卡容器 */}
            <TabContainer />
            <TabContainer ref={tabContainerRef} />
          </div>
          {/* B区域:右侧工具栏 */}
@@ -114,8 +146,11 @@
          </ToolModal>
        )}
        {/* 智能外呼通话显示组件 - 全局显示 */}
        <OutboundCallWidget />
        {/* 智能外呼通话显示组件 - 默认隐藏,可主动触发显示 */}
        <OutboundCallWidget
          onSwitchTab={handleSwitchTab}
          onRefreshData={handleRefreshData}
        />
      </div>
    </Spin>
  );