This commit is contained in:
2026-05-27 15:47:36 +08:00
parent a73d530f07
commit 06cee89e19
+23 -68
View File
@@ -2080,6 +2080,21 @@ const ResultView = {
</div>
</div>
<div v-if="state.task.status === 'completed'" class="export-buttons-bar" style="display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; padding: var(--space-3) 0;">
<button class="btn-sm btn-primary" @click="exportCAD('step')" title="导出装配体STEP格式(UG/FreeCAD/SolidWorks通用)">
📦 导出 STEP
</button>
<button class="btn-sm btn-secondary" @click="exportCAD('iges')" title="导出IGES格式(兼容旧系统)">
导出 IGES
</button>
<button class="btn-sm btn-secondary" @click="exportCAD('stl')" title="导出STL网格格式(3D打印预览)">
导出 STL
</button>
<button class="btn-sm btn-secondary" @click="exportCAD('brep')" title="导出BRep格式(FreeCAD原生)">
导出 BRep
</button>
</div>
<div id="preview-3d" v-if="selectedHtmlFile" class="viewer-section viewer-section-hero">
<div class="summary-header">
<h3>3D 预览</h3>
@@ -2109,57 +2124,8 @@ const ResultView = {
</div>
</div>
<div id="candidate-schemes" v-if="candidateSchemes.length" class="viewer-section">
<h3>候选分模方案</h3>
<div :class="['result-grid', hasSingleScheme ? 'single-scheme-grid' : '']">
<div
v-for="scheme in candidateSchemes"
:key="scheme.scheme_id"
:class="['result-card', hasSingleScheme ? 'single-scheme-card' : '']"
:style="state.selectedSchemeId === scheme.scheme_id ? 'border: 2px solid var(--primary-color);' : ''"
>
<div class="summary-header">
<h4>{{ scheme.title || scheme.scheme_id }}</h4>
<span class="badge badge-info">总分 {{ formatNumber(scheme.score) }}</span>
</div>
<div class="info-list">
<div class="info-item">
<span class="info-label">方案说明</span>
<span class="info-value" style="font-weight: 600; color: var(--text-primary);">{{ scheme.summary || scheme.reason || '暂无说明' }}</span>
</div>
<div class="info-item">
<span class="info-label">分型方向</span>
<span class="info-value">{{ formatSchemeDirection(scheme) }}</span>
</div>
<div class="info-item">
<span class="info-label">模具结构</span>
<span class="info-value">{{ scheme.mold_structure_type === 'two_half_cavity' ? '两板半腔(无独立模芯)' : '型腔 + 模芯' }}</span>
</div>
<div class="info-item">
<span class="info-label">分型面位置</span>
<span class="info-value">{{ scheme.offset_label || '中面' }}</span>
</div>
<div class="info-item">
<span class="info-label">可制造性</span>
<span class="info-value">{{ formatNumber(scheme.score_breakdown?.manufacturability || 0) }}</span>
</div>
<div class="info-item">
<span class="info-label">分型质量</span>
<span class="info-value">{{ formatNumber(scheme.score_breakdown?.parting_quality || 0) }}</span>
</div>
<div class="info-item">
<span class="info-label">风险得分</span>
<span class="info-value">{{ formatNumber(scheme.score_breakdown?.risk || 0) }}</span>
</div>
</div>
<button v-if="candidateSchemes.length > 1" class="btn-sm btn-primary" @click="selectScheme(scheme.scheme_id)">查看此方案</button>
<div v-else class="inline-note">当前仅生成 1 套可用分模方案</div>
</div>
</div>
</div>
<details v-if="candidateSchemes.length > 1" class="viewer-section diagnostic-panel">
<summary>方案对比</summary>
<div id="candidate-schemes" v-if="candidateSchemes.length > 1" class="viewer-section diagnostic-panel" style="margin-top: var(--space-4);">
<summary>📊 全部方案对比</summary>
<div class="result-card full-width diagnostic-panel-body">
<table class="data-table">
<thead>
@@ -2176,8 +2142,11 @@ const ResultView = {
</tr>
</thead>
<tbody>
<tr v-for="scheme in candidateSchemes" :key="'cmp-' + scheme.scheme_id">
<td>{{ scheme.title || scheme.scheme_id }}</td>
<tr v-for="scheme in candidateSchemes" :key="'cmp-' + scheme.scheme_id" :style="state.selectedSchemeId === scheme.scheme_id ? 'background: rgba(var(--primary-rgb), 0.06); font-weight: 600;' : ''">
<td>
<span v-if="scheme.scheme_id === state.bestSchemeId" style="color: var(--primary-color); margin-right: 4px;">★</span>
<span style="cursor: pointer; color: var(--primary-color);" @click="selectScheme(scheme.scheme_id)">{{ scheme.title || scheme.scheme_id }}</span>
</td>
<td>{{ formatSchemeDirection(scheme) }}</td>
<td>{{ scheme.offset_label || '中面' }}</td>
<td>{{ formatNumber(scheme.score) }}</td>
@@ -2272,21 +2241,7 @@ const ResultView = {
<div id="export-cam" class="viewer-section">
<div class="summary-header">
<h3>CAM 与 CNC 加工</h3>
<span class="badge badge-info">计划 | 导出</span>
</div>
<div v-if="state.task.status === 'completed'" class="export-buttons export-buttons-block" style="margin-bottom: var(--space-4);">
<button class="btn-sm btn-primary" @click="exportCAD('step')" title="导出装配体STEP格式(UG/FreeCAD/SolidWorks通用)">
📦 导出 STEP
</button>
<button class="btn-sm btn-secondary" @click="exportCAD('iges')" title="导出IGES格式(兼容旧系统)">
导出 IGES
</button>
<button class="btn-sm btn-secondary" @click="exportCAD('stl')" title="导出STL网格格式(3D打印预览)">
导出 STL
</button>
<button class="btn-sm btn-secondary" @click="exportCAD('brep')" title="导出BRep格式(FreeCAD原生)">
导出 BRep
</button>
<span class="badge badge-info">工艺规划</span>
</div>
<div class="result-card" style="margin-bottom: var(--space-4);">
<h4>CAM 参数</h4>