From 3c2aab553bf8543b1cea8ddba7ca06a59cc3516c Mon Sep 17 00:00:00 2001 From: sladro Date: Sun, 21 Sep 2025 13:15:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E5=88=86=E6=9E=90=E5=8A=A8=E6=80=81=E6=A0=91=E5=BD=A2=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E5=92=8C=E5=AD=90=E7=BB=84=E4=BB=B6=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要功能: • 实现层级分析初始请求使用target_level=0获取顶层模型 • 新增getChildrenComponents API方法支持动态加载子组件 • 重构层级分析结果页面使用响应式数组直接管理组件数据 • 实现点击展开按钮动态加载并插入子组件到正确位置 • 修复子组件层级计算逻辑,确保父组件level+1 • 修复组件选择使用路径作为唯一标识,避免多选问题 • 优化界面显示,移除文件大小列,调整总组件数显示 • 添加componentChildren端点配置支持子组件查询 技术改进: • 从computed改为ref数组提升响应性能 • 使用component.path作为唯一标识解决ID重复问题 • 简化树形视图逻辑,移除复杂的展开状态管理 • 优化API参数处理,支持可选componentId参数 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../pages/HierarchyAnalysisResult.vue | 159 ++++++++++-------- src/config/cad.js | 1 + src/services/creoApi.js | 33 +++- 3 files changed, 123 insertions(+), 70 deletions(-) diff --git a/src/components/pages/HierarchyAnalysisResult.vue b/src/components/pages/HierarchyAnalysisResult.vue index 91073fd..eddfb10 100644 --- a/src/components/pages/HierarchyAnalysisResult.vue +++ b/src/components/pages/HierarchyAnalysisResult.vue @@ -49,7 +49,7 @@
-
{{ hierarchyData.length }}
+
{{ (analysisResults?.total_components || 0) - 1 }}
总组件数
@@ -74,8 +74,8 @@
@@ -97,7 +97,7 @@
-
{{ component.id }}
+
{{ component.filename }}
{{ component.type }} 层级: {{ component.level }} @@ -105,8 +105,7 @@
- {{ component.file_size }} -
@@ -129,19 +128,18 @@ 类型 层级 路径 - 文件大小 删除安全性 - + - +
- {{ component.name }} + {{ component.filename }}
{{ component.type }} @@ -149,7 +147,6 @@
{{ component.path }}
- {{ component.file_size }} {{ getSafetyLabel(component.deletion_safety) }} @@ -190,7 +187,7 @@