4 files added
8 files modified
| New file |
| | |
| | | <!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.feba8a67.js"></script><link href="/static/css/main.fcdca725.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> |
| New file |
| | |
| | | # ============================================ |
| | | # 客户系统 Nginx配置文件 |
| | | # 服务器: 36.140.67.217 |
| | | # 部署路径: /var/www/customer-system |
| | | # |
| | | # 安装方法: |
| | | # 1. 将此文件复制到服务器: /etc/nginx/conf.d/customer-system.conf |
| | | # 2. 测试配置: nginx -t |
| | | # 3. 重启服务: systemctl restart nginx |
| | | # ============================================ |
| | | |
| | | server { |
| | | listen 9002; |
| | | server_name 36.140.67.217 localhost; |
| | | |
| | | # 网站根目录 |
| | | root /deploy/code/front; |
| | | index index.html index.htm; |
| | | |
| | | # 日志配置 |
| | | access_log /var/log/nginx/customer-system.access.log; |
| | | error_log /var/log/nginx/customer-system.error.log; |
| | | |
| | | # Gzip压缩配置 |
| | | gzip on; |
| | | gzip_vary on; |
| | | gzip_min_length 1024; |
| | | gzip_proxied any; |
| | | gzip_comp_level 6; |
| | | gzip_types text/plain text/css text/xml text/javascript |
| | | application/javascript application/xml application/json |
| | | application/x-font-ttf application/x-font-woff |
| | | image/svg+xml; |
| | | |
| | | # 静态资源缓存 - JS/CSS/字体/图片长期缓存 |
| | | location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|otf)$ { |
| | | expires 1y; |
| | | add_header Cache-Control "public, immutable"; |
| | | access_log off; |
| | | |
| | | # 允许跨域访问字体文件 |
| | | add_header Access-Control-Allow-Origin *; |
| | | } |
| | | |
| | | # HTML文件不缓存 - 确保用户总是获取最新版本 |
| | | location ~* \.html$ { |
| | | expires -1; |
| | | add_header Cache-Control "no-cache, no-store, must-revalidate"; |
| | | add_header Pragma "no-cache"; |
| | | } |
| | | |
| | | location /api/ { |
| | | proxy_pass http://127.0.0.1:9031; |
| | | proxy_http_version 1.1; |
| | | proxy_set_header Host $host; |
| | | proxy_set_header X-Real-IP $remote_addr; |
| | | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| | | proxy_set_header X-Forwarded-Proto $scheme; |
| | | } |
| | | |
| | | # SPA单页应用路由支持 |
| | | # 所有路由都返回index.html,由前端路由处理 |
| | | location / { |
| | | try_files $uri $uri/ /index.html; |
| | | } |
| | | |
| | | # 安全头配置 |
| | | add_header X-Frame-Options "SAMEORIGIN" always; |
| | | add_header X-XSS-Protection "1; mode=block" always; |
| | | add_header X-Content-Type-Options "nosniff" always; |
| | | add_header Referrer-Policy "strict-origin-when-cross-origin" always; |
| | | |
| | | # 禁止访问隐藏文件 |
| | | location ~ /\. { |
| | | deny all; |
| | | access_log off; |
| | | log_not_found off; |
| | | } |
| | | |
| | | # 错误页面 |
| | | error_page 404 /index.html; |
| | | error_page 500 502 503 504 /50x.html; |
| | | location = /50x.html { |
| | | root /usr/share/nginx/html; |
| | | } |
| | | } |
| | | |
| | | # ============================================ |
| | | # HTTPS配置 (可选 - 需要SSL证书) |
| | | # ============================================ |
| | | # server { |
| | | # listen 443 ssl http2; |
| | | # server_name 36.140.67.217; |
| | | # |
| | | # ssl_certificate /etc/nginx/ssl/customer-system.crt; |
| | | # ssl_certificate_key /etc/nginx/ssl/customer-system.key; |
| | | # ssl_session_timeout 1d; |
| | | # ssl_session_cache shared:SSL:50m; |
| | | # ssl_protocols TLSv1.2 TLSv1.3; |
| | | # ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256; |
| | | # ssl_prefer_server_ciphers off; |
| | | # |
| | | # # ... 其他配置同上 |
| | | # } |
| | | # |
| | | # # HTTP重定向到HTTPS |
| | | # server { |
| | | # listen 80; |
| | | # server_name 36.140.67.217; |
| | | # return 301 https://$server_name$request_uri; |
| | | # } |
| | |
| | | */ |
| | | const OutboundCallWidget = ({ onSwitchTab, onRefreshData }) => { |
| | | const { caseData } = useCaseData(); |
| | | const [isVisible, setIsVisible] = useState(false); // 默认不显示,有任务时自动显示 |
| | | const [isVisible, setIsVisible] = useState(false); // 默认隐藏 |
| | | const [isMinimized, setIsMinimized] = useState(false); // 默认展开(非最小化) |
| | | const [calls, setCalls] = useState([]); |
| | | const isMountedRef = useRef(true); |
| | | const fetchCallStatusRef = useRef(null); // 用于存储最新的 fetchCallStatus 函数引用 |
| | | |
| | | // 轮询间隔(毫秒) |
| | | const POLL_INTERVAL = 10000; // 10秒 |
| | |
| | | // 最大重试次数 |
| | | const MAX_RETRY_COUNT = 10; |
| | | |
| | | // 获取 caseIdg |
| | | // 获取 caseId |
| | | const caseId = caseData?.caseId || caseData?.case_id; |
| | | |
| | | // 格式化通话时长 |
| | |
| | | // 读取成功的任务 |
| | | const storedSuccess = localStorage.getItem(OUTBOUND_JOBS_KEY); |
| | | const successJobs = storedSuccess ? JSON.parse(storedSuccess) : []; |
| | | console.log('读取成功任务:', successJobs.length, successJobs); |
| | | |
| | | // 读取失败的任务 |
| | | const storedFailed = localStorage.getItem(`${OUTBOUND_JOBS_KEY}_failed`); |
| | | const failedJobs = storedFailed ? JSON.parse(storedFailed) : []; |
| | | console.log('读取失败任务:', failedJobs.length, failedJobs); |
| | | console.log('读取失败任务:', failedJobs); |
| | | |
| | | // 清理失败任务 - 按 errorCode 不同策略 |
| | | const now = Date.now(); |
| | |
| | | } |
| | | }); |
| | | |
| | | // 获取成功任务的 personId 集合 |
| | | const successPersonIds = new Set(successJobs.map(job => job.personId)); |
| | | |
| | | // 过滤掉已有成功任务的 personId 对应的失败任务(成功任务优先) |
| | | const filteredFailedJobs = uniqueFailedJobs.filter(job => !successPersonIds.has(job.personId)); |
| | | |
| | | // 合并所有任务 |
| | | return [...successJobs, ...uniqueFailedJobs]; |
| | | return [...successJobs, ...filteredFailedJobs]; |
| | | } catch (err) { |
| | | console.error('读取外呼任务失败:', err); |
| | | return []; |
| | |
| | | * 查询通话状态 |
| | | */ |
| | | const fetchCallStatus = useCallback(async () => { |
| | | console.log('fetchCallStatus 被调用'); |
| | | |
| | | // 从 localStorage 读取任务 |
| | | const storedJobs = loadJobsFromStorage(); |
| | | console.log('从 localStorage 读取的所有任务:', storedJobs); |
| | | |
| | | // 分离成功任务和失败任务 |
| | | const successJobs = storedJobs.filter(job => !job.errorCode && isActiveStatus(job.callStatus)); |
| | | const failedJobs = storedJobs.filter(job => job.errorCode > 0); |
| | | |
| | | console.log('成功任务数量:', successJobs.length, '失败任务数量:', failedJobs.length); |
| | | |
| | | if (successJobs.length === 0) { |
| | | // 没有活跃任务,更新状态并返回 |
| | | if (isMountedRef.current) { |
| | | setCalls([...failedJobs]); |
| | | if (failedJobs.length > 0) { |
| | | if (failedJobs.length > 0 && !isVisible) { |
| | | setIsVisible(true); |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | |
| | | // 立即显示气泡(不等待 API 返回) |
| | | console.log('isMountedRef.current:', isMountedRef.current); |
| | | if (isMountedRef.current) { |
| | | // 先合并当前的成功任务和失败任务,立即显示 |
| | | const immediateJobs = [...successJobs, ...failedJobs.filter(f => !successJobs.some(s => s.personId === f.personId))]; |
| | | console.log('准备设置 calls:', immediateJobs); |
| | | setCalls(immediateJobs); |
| | | setIsVisible(true); |
| | | console.log('立即显示气泡,任务数:', immediateJobs.length, 'isVisible 设置为 true'); |
| | | } else { |
| | | console.log('组件未挂载,跳过显示气泡'); |
| | | } |
| | | |
| | | // 收集需要更新到后端的任务(状态变化且原状态不是Scheduling) |
| | |
| | | // 保存到 localStorage |
| | | saveJobsToStorage(cleanedJobs); |
| | | |
| | | // 合并成功任务和失败任务,按 personId 去重(成功任务优先) |
| | | const successPersonIds = new Set(cleanedJobs.map(job => job.personId)); |
| | | // 过滤掉已有成功任务的 personId 对应的失败任务 |
| | | const filteredFailedJobs = failedJobs.filter(job => !successPersonIds.has(job.personId)); |
| | | const allJobs = [...cleanedJobs, ...filteredFailedJobs]; |
| | | // 合并成功任务和失败任务 |
| | | const allJobs = [...cleanedJobs, ...failedJobs]; |
| | | |
| | | // 更新组件状态 |
| | | if (isMountedRef.current) { |
| | | setCalls(allJobs); |
| | | // 如果有任务,显示气泡(使用函数式更新避免依赖 isVisible) |
| | | if (allJobs.length > 0) { |
| | | // 如果有任务,显示气泡 |
| | | if (allJobs.length > 0 && !isVisible) { |
| | | setIsVisible(true); |
| | | } |
| | | } |
| | | }, [triggerPageUpdate]); |
| | | |
| | | // 将最新的 fetchCallStatus 存储到 ref 中 |
| | | useEffect(() => { |
| | | fetchCallStatusRef.current = fetchCallStatus; |
| | | }, [fetchCallStatus]); |
| | | }, [isVisible, triggerPageUpdate]); |
| | | |
| | | // 定时轮询通话状态 |
| | | useEffect(() => { |
| | |
| | | // 设置轮询定时器(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]); |
| | | |
| | | // 监听 localStorage 变化,外呼成功后立即刷新 |
| | | useEffect(() => { |
| | | const handleStorageChange = (e) => { |
| | | // 监听外呼任务存储的变化 |
| | | if (e.key === OUTBOUND_JOBS_KEY || e.key === `${OUTBOUND_JOBS_KEY}_failed`) { |
| | | console.log('localStorage 变化,刷新外呼状态'); |
| | | if (fetchCallStatusRef.current) { |
| | | fetchCallStatusRef.current(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | // 监听 storage 事件(跨标签页同步) |
| | | window.addEventListener('storage', handleStorageChange); |
| | | |
| | | // 同页面内的 localStorage 变化需要手动触发 |
| | | // 创建自定义事件监听 - 使用 ref 避免依赖问题 |
| | | const handleCustomStorageChange = () => { |
| | | console.log('同页面 localStorage 变化,刷新外呼状态'); |
| | | if (fetchCallStatusRef.current) { |
| | | fetchCallStatusRef.current(); |
| | | } |
| | | }; |
| | | window.addEventListener('outbound-jobs-updated', handleCustomStorageChange); |
| | | |
| | | console.log('事件监听器已设置: outbound-jobs-updated'); |
| | | |
| | | return () => { |
| | | window.removeEventListener('storage', handleStorageChange); |
| | | window.removeEventListener('outbound-jobs-updated', handleCustomStorageChange); |
| | | }; |
| | | }, []); // 空依赖数组,只在组件挂载时设置一次 |
| | | |
| | | // 关闭气泡 |
| | | const handleClose = (e) => { |
| | |
| | | return true; |
| | | }); |
| | | |
| | | // 添加调试日志 |
| | | console.log('渲染检查 - calls:', calls.length, 'activeCalls:', activeCalls.length, 'isVisible:', isVisible, 'isMinimized:', isMinimized); |
| | | |
| | | // 如果没有任务,不渲染任何内容 |
| | | if (activeCalls.length === 0) { |
| | | console.log('无活跃任务,不渲染气泡'); |
| | | // 如果没有活跃任务且不可见,不渲染任何内容 |
| | | if (activeCalls.length === 0 && !isVisible) { |
| | | return null; |
| | | } |
| | | |
| | |
| | | </div> |
| | | ))} |
| | | |
| | | {/* 无通话时的占位提示 */} |
| | | {activeCalls.length === 0 && isVisible && ( |
| | | <div |
| | | style={{ |
| | | background: 'linear-gradient(135deg, #1A6FB8 0%, #0d4a8a 100%)', |
| | | borderRadius: 12, |
| | | padding: '16px 20px', |
| | | color: 'white', |
| | | boxShadow: '0 4px 16px rgba(26, 111, 184, 0.3)', |
| | | position: 'relative', |
| | | minWidth: 280, |
| | | }} |
| | | > |
| | | {/* 关闭按钮 */} |
| | | <button |
| | | onClick={handleClose} |
| | | style={{ |
| | | position: 'absolute', |
| | | top: 8, |
| | | right: 8, |
| | | width: 24, |
| | | height: 24, |
| | | borderRadius: '50%', |
| | | border: 'none', |
| | | background: 'rgba(255,255,255,0.2)', |
| | | color: 'white', |
| | | cursor: 'pointer', |
| | | display: 'flex', |
| | | alignItems: 'center', |
| | | justifyContent: 'center', |
| | | fontSize: 14, |
| | | }} |
| | | > |
| | | <i className="fas fa-times" /> |
| | | </button> |
| | | |
| | | <div style={{ display: 'flex', alignItems: 'center', gap: 10 }}> |
| | | <div |
| | | style={{ |
| | | width: 36, |
| | | height: 36, |
| | | borderRadius: '50%', |
| | | background: 'rgba(255,255,255,0.2)', |
| | | display: 'flex', |
| | | alignItems: 'center', |
| | | justifyContent: 'center', |
| | | }} |
| | | > |
| | | <i className="fas fa-robot" style={{ fontSize: 18 }} /> |
| | | </div> |
| | | <div> |
| | | <div style={{ fontSize: 16, fontWeight: 600 }}>智能外呼系统</div> |
| | | <div style={{ fontSize: 13, opacity: 0.85 }}>暂无进行中的通话</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | )} |
| | | |
| | | {/* CSS 动画 */} |
| | | <style>{` |
| | | @keyframes pulse { |
| | |
| | | <img |
| | | style={{ width: 36 }} |
| | | src="http://gz.hugeinfo.com.cn/dyh/wx414ae04ac3f10b4e/images/pngAI_logo.png" |
| | | alt="解纷智能体" |
| | | // alt="云小调" |
| | | /> |
| | | </div> |
| | | <div className="title-text"> |
| | |
| | | }, |
| | | [ENV_TYPES.SIT]: { |
| | | // 集成测试环境 - 通过 Nginx 代理访问后端,避免跨域 |
| | | baseURL: '', |
| | | baseURL: '', // 使用相对路径,通过Nginx代理转发 |
| | | timeout: 30000, |
| | | withCredentials: true, |
| | | withCredentials: false, |
| | | name: '集成测试环境' |
| | | }, |
| | | [ENV_TYPES.UAT]: { |
| | |
| | | name: '用户验收环境' |
| | | }, |
| | | [ENV_TYPES.PRD]: { |
| | | // 生产环境 |
| | | baseURL: 'https://api.example.com', |
| | | // 生产环境 - 通过 Nginx 代理访问后端 |
| | | baseURL: '', // 使用相对路径,通过Nginx代理转发 |
| | | timeout: 30000, |
| | | withCredentials: true, |
| | | name: '生产环境' |
| | |
| | | }); |
| | | |
| | | // 处理响应 |
| | | console.log('triggerOutboundCall API 响应:', response); |
| | | console.log('response.data:', response?.data); |
| | | console.log('response.data 是数组:', Array.isArray(response?.data)); |
| | | |
| | | if (response?.data && Array.isArray(response.data)) { |
| | | const successJobs = []; |
| | | const failedJobs = []; |
| | |
| | | personId: item.personId, |
| | | mediationId: item.mediationId, |
| | | caseId: String(caseId), // 添加 caseId 字段用于轮询 |
| | | perTypeName: item.perTypeName || '', // 当事人类型名称(申请方当事人/被申请方当事人) |
| | | perClassName: item.perClassName || '', // 添加人员类型名称 |
| | | trueName: item.trueName || '', // 添加真实姓名 |
| | | startTime: item.createTime || item.createdTime || item.start_time, |
| | | startTime: item.createTime || item.createdTime || item.start_time, // 兼容 createTime 和 createdTime |
| | | pollStartTime: Date.now(), |
| | | retryCount: 0 |
| | | }); |
| | |
| | | failedJobs.push({ |
| | | personId: item.personId, |
| | | message: item.message || '未知错误', |
| | | perTypeName: item.perTypeName || '', // 当事人类型名称(申请方当事人/被申请方当事人) |
| | | perClassName: item.perClassName || '', // 添加人员类型名称 |
| | | trueName: item.trueName || '', // 添加真实姓名 |
| | | errorCode: item.errorCode, // 添加错误码 |
| | |
| | | |
| | | // 存储成功的任务到 localStorage |
| | | if (successJobs.length > 0) { |
| | | // 读取现有的成功任务,合并而不是覆盖 |
| | | const existingJobs = JSON.parse(localStorage.getItem(OUTBOUND_JOBS_KEY) || '[]'); |
| | | // 按 jobId 去重,新任务优先 |
| | | const existingJobIds = new Set(successJobs.map(job => job.jobId)); |
| | | const filteredExistingJobs = existingJobs.filter(job => !existingJobIds.has(job.jobId)); |
| | | const mergedJobs = [...successJobs, ...filteredExistingJobs]; |
| | | // 新任务发起时,先清除所有旧的成功任务(替换而不是追加) |
| | | localStorage.setItem(OUTBOUND_JOBS_KEY, JSON.stringify(successJobs)); |
| | | console.log('存储外呼任务成功,数量:', successJobs.length); |
| | | |
| | | localStorage.setItem(OUTBOUND_JOBS_KEY, JSON.stringify(mergedJobs)); |
| | | console.log('存储外呼任务成功,新增:', successJobs.length, '总数:', mergedJobs.length); |
| | | console.log('存储的任务:', JSON.stringify(mergedJobs, null, 2)); |
| | | // 外呼成功后,清除所有失败记录(新任务开始时应清空旧记录) |
| | | localStorage.removeItem(`${OUTBOUND_JOBS_KEY}_failed`); |
| | | console.log('外呼成功后清除所有失败记录'); |
| | | |
| | | // 外呼成功后,清除对应的失败记录 |
| | | const storedFailedJobs = JSON.parse(localStorage.getItem(`${OUTBOUND_JOBS_KEY}_failed`) || '[]'); |
| | | if (storedFailedJobs.length > 0) { |
| | | // 获取成功任务的 personId 列表 |
| | | const successPersonIds = successJobs.map(job => job.personId); |
| | | // 过滤掉已成功的 personId 对应的失败记录 |
| | | const remainingFailedJobs = storedFailedJobs.filter(job => !successPersonIds.includes(job.personId)); |
| | | localStorage.setItem(`${OUTBOUND_JOBS_KEY}_failed`, JSON.stringify(remainingFailedJobs)); |
| | | console.log('外呼成功后清除失败记录,清除数量:', storedFailedJobs.length - remainingFailedJobs.length); |
| | | } |
| | | |
| | | // 延迟触发自定义事件,确保监听器已经设置好 |
| | | // 触发自定义事件,通知 OutboundCallWidget 组件立即刷新 |
| | | setTimeout(() => { |
| | | console.log('触发 outbound-jobs-updated 事件'); |
| | | window.dispatchEvent(new CustomEvent('outbound-jobs-updated')); |
| | | }, 300); |
| | | } |
| | |
| | | |
| | | localStorage.setItem(`${OUTBOUND_JOBS_KEY}_failed`, JSON.stringify(cleanedFailedJobs)); |
| | | console.log('存储外呼失败任务,数量:', cleanedFailedJobs.length); |
| | | |
| | | // 触发自定义事件通知 OutboundCallWidget 组件刷新 |
| | | window.dispatchEvent(new CustomEvent('outbound-jobs-updated')); |
| | | } |
| | | |
| | | // 提示失败的任务 |
| | |
| | | return; |
| | | } |
| | | |
| | | EvidenceAPIService.processCaseFilesOcr(params.caseId).catch((ocrError) => { |
| | | console.error('触发案件文件OCR失败:', ocrError); |
| | | }); |
| | | |
| | | try { |
| | | await OutboundBotAPIService.syncStatusByCase({ caseId: params.caseId }); |
| | | } catch (syncError) { |
| | |
| | | } |
| | | |
| | | // 调用API获取数据 |
| | | // 将URL中的auth_token转换为authorization传入API |
| | | const response = await ProcessAPIService.getCaseProcessInfo( |
| | | params.caseId, |
| | | { |
| | | caseTypeFirst: params.caseTypeFirst, |
| | | platform_code: params.platform_code, |
| | | authorization: params.auth_token |
| | | authorization: params.auth_token || params.authorization || '' |
| | | } |
| | | ); |
| | | |
| | |
| | | |
| | | class EvidenceAPIService { |
| | | /** |
| | | * 触发案件关联文件的 OCR 处理(后台任务) |
| | | * POST /api/v1/case-files-ocr/process |
| | | * @param {string|number} caseId - 案件ID |
| | | * @returns {Promise} OCR处理结果 |
| | | */ |
| | | static processCaseFilesOcr(caseId) { |
| | | const trimmedCaseId = String(caseId ?? '').trim(); |
| | | const formData = new FormData(); |
| | | formData.append('caseId', trimmedCaseId); |
| | | return request.post('/api/v1/case-files-ocr/process', formData); |
| | | } |
| | | |
| | | /** |
| | | * 证据列表查询 |
| | | * GET /api/v1/evidence/list |
| | | * @param {Object} params - 查询参数 |
| | |
| | | } |
| | | } |
| | | |
| | | export default EvidenceAPIService; |
| | | export default EvidenceAPIService; |
| | |
| | | * @returns {Promise} 重新生成的协议信息(包含新的agreeId和agreeContent) |
| | | */ |
| | | static regenerateAgreement(caseId) { |
| | | return request.post('/api/v1/medi-agreement/regenerate', { caseId }, { timeout: 120000 }); |
| | | return request.post('/api/v1/medi-agreement/regenerate', { caseId }, { timeout: 30000 }); |
| | | } |
| | | } |
| | | |
| | |
| | | * @param {Object} params - 查询参数 |
| | | * @param {string} params.caseTypeFirst - 案件一级分类 |
| | | * @param {string} params.platform_code - 外部平台编号 |
| | | * @param {string} params.authorization - 授权token |
| | | * @returns {Promise} 调解时间线数据 |
| | | */ |
| | | static getMediationTimeline(caseId, params = {}) { |
| | | return request.get(`/api/v1/mediation-timeline/v2/case/${caseId}`, params); |
| | | const { authorization, ...queryParams } = params; |
| | | queryParams.authorization = authorization; |
| | | const config = authorization ? { headers: { Authorization: authorization } } : {}; |
| | | return request.get(`/api/v1/mediation-timeline/v2/case/${caseId}`, queryParams, config); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param {string} params.caseTypeFirst - 案件一级分类 |
| | | * @param {string} params.platformCode - 外部平台编号 |
| | | * @param {string} params.caseId - 案件ID |
| | | * @param {string} params.authorization - 授权token |
| | | * @returns {Promise} 流程节点列表 |
| | | */ |
| | | static getProcessNodes(params = {}) { |
| | | return request.get('/api/v1/process/node', params); |
| | | const { authorization, ...queryParams } = params; |
| | | const config = authorization ? { headers: { Authorization: authorization } } : {}; |
| | | return request.get('/api/v1/process/node', queryParams, config); |
| | | } |
| | | |
| | | |
| | |
| | | * @param {Object} params - 查询参数 |
| | | * @param {string} params.caseTypeFirst - 案件一级分类 |
| | | * @param {string} params.platform_code - 外部平台编号 |
| | | * @param {string} params.authorization - 授权token(来自URL的auth_token) |
| | | * @returns {Promise} 完整流程信息 |
| | | */ |
| | | static async getCaseProcessInfo(caseId, params = {}) { |
| | |
| | | const nodeParams = { |
| | | caseTypeFirst: params.caseTypeFirst, |
| | | platformCode: params.platform_code, |
| | | caseId |
| | | caseId, |
| | | authorization: params.authorization |
| | | }; |
| | | |
| | | // 提取authorization用于子请求 |
| | | const { authorization, ...timelineParams } = params; |
| | | console.log('Timeline params:', timelineParams); |
| | | timelineParams.authorization = authorization; |
| | | // 并行获取时间线和流程节点 |
| | | const promises = [ |
| | | this.getMediationTimeline(caseId, params), |
| | | this.getProcessNodes(nodeParams) |
| | | this.getMediationTimeline(caseId, { ...timelineParams, authorization }), |
| | | this.getProcessNodes({ ...nodeParams, authorization }) |
| | | ]; |
| | | |
| | | const results = await Promise.all(promises); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 人工接管API· |
| | | * 人工接管API |
| | | * PUT /api/v1/mediation-timeline/v2/case/{caseId}/takeover |
| | | * @param {string} caseId - 案件ID |
| | | * @param {Object} data - 请求数据 |