tony.cheng
2026-03-13 22ae69256f66f4e413f577a32732e9de200e73e5
web-app/src/components/common/OutboundCallWidget.jsx
@@ -341,9 +341,17 @@
    // 设置轮询定时器(10秒间隔)
    const interval = setInterval(fetchCallStatus, POLL_INTERVAL);
    
    // 监听外呼任务更新事件(立即刷新)
    const handleOutboundJobsUpdated = () => {
      console.log('收到外呼任务更新事件,立即刷新');
      fetchCallStatus();
    };
    window.addEventListener('outbound-jobs-updated', handleOutboundJobsUpdated);
    // 清理函数
    return () => {
      clearInterval(interval);
      window.removeEventListener('outbound-jobs-updated', handleOutboundJobsUpdated);
      isMountedRef.current = false;
    };
  }, [fetchCallStatus]);
@@ -555,14 +563,14 @@
              {call.errorCode > 0 ? (
                // 失败任务显示
                <span>
                  {call.perClassName || '联系人'}
                  {call.perTypeName || '联系人'}
                  {call.trueName && `(${call.trueName})`}:
                  {call.message}
                </span>
              ) : (
                // 成功任务显示
                // 成功任务显示 - 使用 perTypeName 字段(申请方当事人/被申请方当事人)
                <span>
                  正在与{call.perClassName || '申请方'}({call.trueName || call.personId})电话沟通中...
                  正在与{call.perTypeName || '申请方当事人'}({call.trueName || call.personId})电话沟通中...
                </span>
              )}
            </div>