From 1712fb0756a5b10a8433c92a85b35a2bbc5cc184 Mon Sep 17 00:00:00 2001 From: hz4th_coder Date: Tue, 14 Jul 2026 12:42:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=84=E7=90=86=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=AD=A5=E9=AA=A4=E7=AE=80?= =?UTF-8?q?=E8=A6=81=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 显示内容库搜索结果数 - 显示互联网搜索结果数 - 显示抓取成功数 - 显示数据提取/填充状态 - 显示审核ID --- static/css/process.css | 46 +++++++++++++++++++++++++ static/js/process.js | 78 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 122 insertions(+), 2 deletions(-) diff --git a/static/css/process.css b/static/css/process.css index 3fe97f4..98e8ce3 100644 --- a/static/css/process.css +++ b/static/css/process.css @@ -180,6 +180,52 @@ 50% { transform: scale(1.1); } } +/* 步骤简要数值 */ +.steps-summary { + display: flex; + flex-wrap: wrap; + gap: 10px; + padding: 12px 15px; + background: #f8f9fa; + border-radius: 8px; + margin-top: 10px; +} + +.step-summary-item { + display: flex; + align-items: center; + gap: 5px; + padding: 4px 10px; + background: white; + border-radius: 4px; + font-size: 13px; +} + +.step-summary-item.completed { + background: #d1fae5; +} + +.step-summary-item.running { + background: #e0e7ff; +} + +.step-summary-item.failed { + background: #fee2e2; +} + +.step-summary-item.skipped { + background: #f3f4f6; +} + +.step-summary-label { + color: #666; +} + +.step-summary-value { + font-weight: 600; + color: #333; +} + /* 操作按钮 */ .process-actions { display: flex; diff --git a/static/js/process.js b/static/js/process.js index 0e63ee7..e3e3d1d 100644 --- a/static/js/process.js +++ b/static/js/process.js @@ -133,15 +133,23 @@ function displayActiveProcesses(sessions) { function renderStepsProgress(steps, currentStep) { const totalSteps = 6; const stepStatuses = {}; + const stepDataMap = {}; - // 构建步骤状态映射 + // 构建步骤状态和数据映射 steps.forEach(s => { stepStatuses[s.step_number] = s.step_status; + if (s.step_data) { + try { + stepDataMap[s.step_number] = typeof s.step_data === 'string' ? JSON.parse(s.step_data) : s.step_data; + } catch (e) { + stepDataMap[s.step_number] = s.step_data; + } + } }); const stepNames = ['搜索内容库', '搜索互联网', '抓取网页', '提取数据', '填充字段', '提交审核']; - let html = ''; + let html = '
'; for (let i = 1; i <= totalSteps; i++) { const status = stepStatuses[i] || (i > currentStep ? 'pending' : ''); let className = ''; @@ -158,6 +166,72 @@ function renderStepsProgress(steps, currentStep) {
`; } + html += ''; + + // 添加简要数值显示 + html += '
'; + + // 步骤1:内容库搜索结果数 + if (stepDataMap[1]) { + const count = stepDataMap[1].count || 0; + const status = stepStatuses[1]; + html += `
+ 内容库: + ${count} 篇 +
`; + } + + // 步骤2:互联网搜索结果数 + if (stepDataMap[2]) { + const count = stepDataMap[2].count || 0; + const status = stepStatuses[2]; + html += `
+ 互联网: + ${count} 条 +
`; + } + + // 步骤3:抓取成功数 + if (stepDataMap[3]) { + const count = stepDataMap[3].count || 0; + const status = stepStatuses[3]; + html += `
+ 抓取成功: + ${count} 个 +
`; + } + + // 步骤4:提取状态 + if (stepDataMap[4]) { + const hasData = stepDataMap[4].has_data || stepDataMap[4].extracted; + const status = stepStatuses[4]; + html += `
+ 数据提取: + ${hasData ? '成功' : '无数据'} +
`; + } + + // 步骤5:填充状态 + if (stepDataMap[5]) { + const filled = stepDataMap[5].filled; + const status = stepStatuses[5]; + html += `
+ 字段填充: + ${filled ? '完成' : '失败'} +
`; + } + + // 步骤6:审核ID + if (stepDataMap[6]) { + const reviewId = stepDataMap[6].review_id; + const status = stepStatuses[6]; + html += `
+ 审核ID: + ${reviewId || '-'} +
`; + } + + html += '
'; return html; }