update pay function

This commit is contained in:
2025-11-20 16:59:09 +08:00
parent 7c8310eeb6
commit 8dfd344806
3 changed files with 88 additions and 17 deletions

View File

@@ -349,10 +349,11 @@ const DataBrowser: React.FC = () => {
return newSet;
});
} else {
// 展开节点 - 检查是否需要加载子节点
const needsLoading = !node.children || node.children.length === 0;
// 展开节点 - 始终尝试加载子节点(如果还没加载过)
const hasChildren = node.children && node.children.length > 0;
if (needsLoading) {
// 如果没有子节点数据,尝试从服务器加载
if (!hasChildren) {
// 添加加载状态
setLoadingNodes((prev) => new Set(prev).add(node.path));
@@ -711,6 +712,14 @@ const DataBrowser: React.FC = () => {
unit: result.unit,
description: result.description,
};
// 更新面包屑导航为搜索结果的路径
const pathParts = result.category_path.split(' > ');
setBreadcrumbs(pathParts);
// 清空搜索框,显示树结构
setSearchQuery('');
handleMetricClick(metric);
}}
>