| | |
| | | import React, { useState } from 'react'; |
| | | import React, { useState, useRef } from 'react'; |
| | | import { Spin } from 'antd'; |
| | | import './App.css'; |
| | | |
| | |
| | | |
| | | function AppContent() { |
| | | const [activeModal, setActiveModal] = useState(null); |
| | | const { loading } = useCaseData(); |
| | | const { loading, refreshData } = useCaseData(); |
| | | |
| | | // TabContainer ref - 用于切换Tab |
| | | const tabContainerRef = useRef(null); |
| | | |
| | | // 工具配置 |
| | | const toolConfig = { |
| | |
| | | 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; |
| | |
| | | <MediationProgress /> |
| | | |
| | | {/* 选项卡容器 */} |
| | | <TabContainer /> |
| | | <TabContainer ref={tabContainerRef} /> |
| | | </div> |
| | | |
| | | {/* B区域:右侧工具栏 */} |
| | |
| | | )} |
| | | |
| | | {/* 智能外呼通话显示组件 - 默认隐藏,可主动触发显示 */} |
| | | <OutboundCallWidget /> |
| | | <OutboundCallWidget |
| | | onSwitchTab={handleSwitchTab} |
| | | onRefreshData={handleRefreshData} |
| | | /> |
| | | </div> |
| | | </Spin> |
| | | ); |