From 1b0bbeb5f3b2cda6af065e9aa99c67050af392fd Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Sat, 13 Dec 2025 15:54:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(web):=20=E6=B7=BB=E5=8A=A0=E8=AF=84?= =?UTF-8?q?=E4=BC=B0=E5=9F=BA=E5=87=86=E5=88=97=E8=A1=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=B9=B6=E4=BC=98=E5=8C=96=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 1 + src/services/evaluation_service.py | 2 +- web/src/components/RAGEvaluationTab.vue | 22 ++++++++++++++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 97b7f18b..85c0c94e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,7 @@ dependencies = [ "aiohttp>=3.9.0", "deepagents>=0.2.5", "json-repair>=0.54.0", + "openpyxl>=3.1.5", ] [tool.ruff] line-length = 120 # 代码最大行宽 diff --git a/src/services/evaluation_service.py b/src/services/evaluation_service.py index fdb01b3a..b3afcf17 100644 --- a/src/services/evaluation_service.py +++ b/src/services/evaluation_service.py @@ -284,7 +284,7 @@ class EvaluationService: generated = 0 attempts = 0 - await context.set_progress(25, "生成样本") + await context.set_progress(0, "准备生成样本") with open(data_file_path, "w", encoding="utf-8") as f: # Allow more attempts to generate enough questions diff --git a/web/src/components/RAGEvaluationTab.vue b/web/src/components/RAGEvaluationTab.vue index 036759e9..a07df61d 100644 --- a/web/src/components/RAGEvaluationTab.vue +++ b/web/src/components/RAGEvaluationTab.vue @@ -18,9 +18,18 @@ :key="benchmark.benchmark_id" :value="benchmark.benchmark_id" > - {{ benchmark.name }}({{ benchmark.question_count }} 个问题) + {{ benchmark.name }} ({{ benchmark.question_count }} 个问题) + @@ -466,7 +475,7 @@ const handleSearchConfigSave = (config) => { }; // 加载基准列表 -const loadBenchmarks = async () => { +const loadBenchmarks = async (showSuccessMessage = false) => { if (!props.databaseId) return; benchmarksLoading.value = true; @@ -491,6 +500,11 @@ const loadBenchmarks = async () => { selectedBenchmark.value = response.data.find(b => b.benchmark_id === selectedBenchmarkId.value); } } + + // 如果是手动刷新,显示成功提示 + if (showSuccessMessage) { + message.success(`已刷新,找到 ${response.data.length} 个评估基准`); + } } else { console.error('响应格式不符合预期:', response); message.error('基准数据格式错误'); @@ -857,6 +871,10 @@ onMounted(() => { margin: 0; white-space: nowrap; } + + .refresh-benchmarks-btn { + color: var(--gray-600); + } } .toolbar-right {