From dde3b3d12ea85a0847ee3a2697c87059bd92e826 Mon Sep 17 00:00:00 2001 From: sladro Date: Wed, 17 Sep 2025 09:50:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E8=96=84=E5=A3=B3?= =?UTF-8?q?=E5=8C=96=E5=88=86=E6=9E=90=E7=BB=93=E6=9E=9C=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E5=8A=9F=E8=83=BD=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增ShellAnalysisResult.vue完整数据展示功能 - 支持分析数据接收、统计摘要、零件列表展示 - 实现筛选、分页、选择、删除功能 - 添加creoApi.deleteComponentsByPath删除接口 - 修复数据传递链路:CreoModelAnalysis -> DashboardView -> ShellAnalysisResult - 遵循API接入标准流程,确保数据正确传递 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .claude/settings.local.json | 4 +- src/components/pages/CreoModelAnalysis.vue | 3 +- src/components/pages/ShellAnalysisResult.vue | 981 ++++++++++++++++++- src/services/creoApi.js | 21 + src/views/DashboardView.vue | 8 +- 5 files changed, 991 insertions(+), 26 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index e072dd9..f4ed7c1 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -9,7 +9,9 @@ "mcp__sequential-thinking__sequentialthinking", "Bash(for dir in src/assets src/components src/config src/router src/stores src/views)", "Bash(do echo \"=== $dir ===\")", - "Bash(ls:*)" + "Bash(ls:*)", + "mcp__context7__resolve-library-id", + "mcp__context7__get-library-docs" ], "deny": [], "ask": [], diff --git a/src/components/pages/CreoModelAnalysis.vue b/src/components/pages/CreoModelAnalysis.vue index 2ecb02a..7a91d16 100644 --- a/src/components/pages/CreoModelAnalysis.vue +++ b/src/components/pages/CreoModelAnalysis.vue @@ -80,7 +80,8 @@ const emit = defineEmits(['show-shell-analysis-result', 'show-hierarchy-analysis const handleShellAnalysis = async () => { const result = await creoApi.startShellAnalysis() if (result.success) { - emit('show-shell-analysis-result') + // 将API数据传递给父组件 + emit('show-shell-analysis-result', result.data) } } const handleHierarchyDeletion = async () => { diff --git a/src/components/pages/ShellAnalysisResult.vue b/src/components/pages/ShellAnalysisResult.vue index 98280b0..ed59e42 100644 --- a/src/components/pages/ShellAnalysisResult.vue +++ b/src/components/pages/ShellAnalysisResult.vue @@ -9,25 +9,476 @@
-
-
- + +
+
+

分析摘要

+
+ + 完成时间: {{ analysisTime }} +
+
+ +
+
+
{{ allParts.length }}
+
总零件数
+
+
+
{{ analysisResults.estimatedReduction.volumeReduction }}
+
体积减少
+
+
+
{{ analysisResults.estimatedReduction.fileSizeReduction }}
+
文件大小减少
+
+
+
{{ analysisResults.estimatedReduction.performanceImprovement }}
+
性能提升
+
+
+
+ + +
+
+

+ + 薄壳化分析结果 ({{ filteredParts.length }} 个零件) +

+
+ +
+ + + + +
+ +
+ + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
选择ID零件名称零件路径体积减少置信度原因删除建议
+ + {{ part.id }}{{ part.name }}{{ part.partPath }}{{ formatPercent(part.volumeReduction) }}%{{ formatPercent(part.confidence * 100) }}%{{ part.reason }} + + {{ getDeletionRecommendationText(part.deletion_recommendation) }} + +
+
+ + +
+ + +
+ 第 {{ currentPage }} 页 / 共 {{ totalPages }} 页,展示 {{ filteredParts.length }} 个结果 +
+
+ + +
+
+ 已选择: {{ selectedParts.size }} 个零件 +
+
-

分析结果页面

-

此页面将展示智能薄壳化分析的结果

\ No newline at end of file diff --git a/src/services/creoApi.js b/src/services/creoApi.js index 6855b66..737acf5 100644 --- a/src/services/creoApi.js +++ b/src/services/creoApi.js @@ -124,6 +124,27 @@ class CreoApiService { } }) } + + /** + * 删除指定路径的组件 + * @param {Array} componentPaths - 要删除的组件路径数组 + * @param {boolean} forceDelete - 是否强制删除,默认false + * @returns {Promise<{success: boolean, data?: any, error?: string}>} + */ + async deleteComponentsByPath(componentPaths, forceDelete = false) { + const url = buildApiUrl(this.softwareName, 'deleteComponent') + + return await apiClient.post(url, { + "software_type": "creo", + "component_paths": componentPaths, + "force_delete": forceDelete + }, { + operationContext: { + software: 'Creo', + operation: '删除组件' + } + }) + } } // 导出单例实例 diff --git a/src/views/DashboardView.vue b/src/views/DashboardView.vue index da88dcb..3143db1 100644 --- a/src/views/DashboardView.vue +++ b/src/views/DashboardView.vue @@ -112,7 +112,7 @@
- +
@@ -231,6 +231,9 @@ const currentPage = ref(PAGE_TYPES.HOME) const showModelViewer = ref(false) const currentModelData = ref(null) +// 分析结果数据存储 +const shellAnalysisData = ref(null) + // 处理显示模型查看器 const handleShowModelViewer = (modelData) => { currentModelData.value = modelData @@ -244,7 +247,8 @@ const handlePageChange = (page) => { } // 处理跳转到分析结果页面 -const handleShowShellAnalysisResult = () => { +const handleShowShellAnalysisResult = (analysisData) => { + shellAnalysisData.value = analysisData currentPage.value = PAGE_TYPES.SHELL_ANALYSIS_RESULT }