feat(web): 添加评估基准列表刷新按钮并优化显示
This commit is contained in:
parent
d435b49c97
commit
1b0bbeb5f3
@ -63,6 +63,7 @@ dependencies = [
|
|||||||
"aiohttp>=3.9.0",
|
"aiohttp>=3.9.0",
|
||||||
"deepagents>=0.2.5",
|
"deepagents>=0.2.5",
|
||||||
"json-repair>=0.54.0",
|
"json-repair>=0.54.0",
|
||||||
|
"openpyxl>=3.1.5",
|
||||||
]
|
]
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 120 # 代码最大行宽
|
line-length = 120 # 代码最大行宽
|
||||||
|
|||||||
@ -284,7 +284,7 @@ class EvaluationService:
|
|||||||
generated = 0
|
generated = 0
|
||||||
attempts = 0
|
attempts = 0
|
||||||
|
|
||||||
await context.set_progress(25, "生成样本")
|
await context.set_progress(0, "准备生成样本")
|
||||||
|
|
||||||
with open(data_file_path, "w", encoding="utf-8") as f:
|
with open(data_file_path, "w", encoding="utf-8") as f:
|
||||||
# Allow more attempts to generate enough questions
|
# Allow more attempts to generate enough questions
|
||||||
|
|||||||
@ -18,9 +18,18 @@
|
|||||||
:key="benchmark.benchmark_id"
|
:key="benchmark.benchmark_id"
|
||||||
:value="benchmark.benchmark_id"
|
:value="benchmark.benchmark_id"
|
||||||
>
|
>
|
||||||
{{ benchmark.name }}({{ benchmark.question_count }} 个问题)
|
{{ benchmark.name }} ({{ benchmark.question_count }} 个问题)
|
||||||
</a-select-option>
|
</a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
|
<a-button
|
||||||
|
type="text"
|
||||||
|
size="middle"
|
||||||
|
:loading="benchmarksLoading"
|
||||||
|
@click="() => loadBenchmarks(true)"
|
||||||
|
:icon="h(ReloadOutlined)"
|
||||||
|
class="refresh-benchmarks-btn"
|
||||||
|
title="刷新评估基准列表"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -466,7 +475,7 @@ const handleSearchConfigSave = (config) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 加载基准列表
|
// 加载基准列表
|
||||||
const loadBenchmarks = async () => {
|
const loadBenchmarks = async (showSuccessMessage = false) => {
|
||||||
if (!props.databaseId) return;
|
if (!props.databaseId) return;
|
||||||
|
|
||||||
benchmarksLoading.value = true;
|
benchmarksLoading.value = true;
|
||||||
@ -491,6 +500,11 @@ const loadBenchmarks = async () => {
|
|||||||
selectedBenchmark.value = response.data.find(b => b.benchmark_id === selectedBenchmarkId.value);
|
selectedBenchmark.value = response.data.find(b => b.benchmark_id === selectedBenchmarkId.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果是手动刷新,显示成功提示
|
||||||
|
if (showSuccessMessage) {
|
||||||
|
message.success(`已刷新,找到 ${response.data.length} 个评估基准`);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error('响应格式不符合预期:', response);
|
console.error('响应格式不符合预期:', response);
|
||||||
message.error('基准数据格式错误');
|
message.error('基准数据格式错误');
|
||||||
@ -857,6 +871,10 @@ onMounted(() => {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.refresh-benchmarks-btn {
|
||||||
|
color: var(--gray-600);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolbar-right {
|
.toolbar-right {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user