From 5e8062f1d2d6baf8e2df12701981c7923d2dcdc4 Mon Sep 17 00:00:00 2001 From: chenjw28 <792430652@qq.com> Date: Fri, 15 May 2026 14:33:02 +0800 Subject: [PATCH] x --- static/style.css | 45 +++++++++++++ static/vue-app.js | 161 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 206 insertions(+) diff --git a/static/style.css b/static/style.css index 963f955..8149276 100644 --- a/static/style.css +++ b/static/style.css @@ -1348,6 +1348,51 @@ optgroup { background: linear-gradient(180deg, var(--bg-primary) 0%, var(--primary-50) 100%); } +.mechanism-list { + display: flex; + flex-direction: column; + gap: var(--space-4); +} + +.mechanism-card { + border: 1px solid var(--border-light); + border-radius: var(--radius-lg); + padding: var(--space-4); + background: var(--bg-primary); +} + +.mechanism-title { + font-size: var(--text-base); + font-weight: var(--font-semibold); + color: var(--text-primary); + margin-bottom: var(--space-3); +} + +.mechanism-subtitle { + font-size: var(--text-sm); + font-weight: var(--font-semibold); + color: var(--text-secondary); + margin-bottom: var(--space-2); +} + +.mechanism-notes { + margin-top: var(--space-4); + padding-top: var(--space-4); + border-top: 1px solid var(--border-light); +} + +.mechanism-note-list { + margin: 0; + padding-left: 1.1rem; + color: var(--text-secondary); + font-size: var(--text-sm); + line-height: 1.7; +} + +.mechanism-note-list li + li { + margin-top: var(--space-2); +} + .result-priority-grid { margin-bottom: var(--space-6); } diff --git a/static/vue-app.js b/static/vue-app.js index 6909396..726d294 100644 --- a/static/vue-app.js +++ b/static/vue-app.js @@ -1509,6 +1509,16 @@ const ResultView = { const selectedHtmlFile = computed(() => selectedScheme.value?.html_file || state.task?.html_file || ''); const selectedDfmViolations = computed(() => selectedScheme.value?.dfm_violations || []); const selectedInjectionSystem = computed(() => selectedCavityData.value?.injection_system || state.task?.plan_result?.injection_system || null); + const selectedSideActions = computed(() => { + return selectedScheme.value?.side_actions + || selectedCavityData.value?.side_actions + || state.task?.side_actions + || null; + }); + const sideActionSummary = computed(() => selectedSideActions.value?.summary || {}); + const sliderMechanisms = computed(() => selectedSideActions.value?.slider_mechanisms || []); + const lifterMechanisms = computed(() => selectedSideActions.value?.lifter_mechanisms || []); + const sideActionRecommendations = computed(() => selectedSideActions.value?.recommendations || []); const stageTimingEntries = computed(() => { const timings = state.task?.stage_timings || {}; return Object.entries(timings) @@ -1538,6 +1548,7 @@ const ResultView = { const resultAnchorLinks = [ { id: 'candidate-schemes', label: '方案' }, { id: 'engineering-summary', label: '工程摘要' }, + { id: 'side-actions', label: '抽芯建议' }, { id: 'dfm-check', label: 'DFM' }, { id: 'preview-3d', label: '预览' }, { id: 'export-cam', label: '导出/CAM' }, @@ -1601,6 +1612,15 @@ const ResultView = { return stageNameMap[name] || name; }; const formatTiming = (value) => `${Number(value || 0).toFixed(3)} s`; + const formatVector = (vector) => { + if (!Array.isArray(vector)) return 'N/A'; + return `[${vector.map(v => Number(v).toFixed(2)).join(', ')}]`; + }; + const formatMechanismSize = (size) => { + if (!size || typeof size !== 'object') return 'N/A'; + const keys = Object.keys(size); + return keys.map(key => `${key}:${Number(size[key]).toFixed(1)} mm`).join(' / '); + }; const exportCAD = async (format) => { try { @@ -1695,12 +1715,19 @@ const ResultView = { selectedHtmlFile, selectedDfmViolations, selectedInjectionSystem, + selectedSideActions, + sideActionSummary, + sliderMechanisms, + lifterMechanisms, + sideActionRecommendations, stageTimingEntries, getWallThicknessSummary, countFeaturesByTypes, getUndercutCount, formatStageName, formatTiming, + formatVector, + formatMechanismSize, primaryRecommendation, sortedRecommendations, selectedDfmCount, @@ -2062,6 +2089,140 @@ const ResultView = { +
+

倒扣与抽芯建议

+
+
+

总体摘要

+
+
+ 倒扣面总数 + {{ sideActionSummary.total_undercut_faces || getUndercutCount() }} +
+
+ 滑块数量 + {{ sideActionSummary.total_slider_count || sliderMechanisms.length }} +
+
+ 斜顶数量 + {{ sideActionSummary.total_lifter_count || lifterMechanisms.length }} +
+
+ 机构复杂度 + {{ sideActionSummary.complexity || 'N/A' }} +
+
+ 液压抽芯 + {{ sideActionSummary.has_hydraulic ? '需要' : '暂不需要' }} +
+
+ 建议动作 + {{ sideActionRecommendations[0] || '当前方案未返回额外抽芯建议' }} +
+
+
+ +
+

滑块抽芯

+
+
+
滑块 {{ idx + 1 }}
+
+
+ 抽芯方向 + {{ formatVector(item.slide_direction) }} +
+
+ 抽芯行程 + {{ item.slide_stroke || 'N/A' }} mm +
+
+ 抽芯角度 + {{ item.slide_angle || 'N/A' }}° +
+
+ 驱动方式 + {{ item.actuation || 'N/A' }} +
+
+ 导滑方式 + {{ item.guide_type || 'N/A' }} +
+
+ 锁紧方式 + {{ item.locking_mechanism || 'N/A' }} +
+
+ 机构尺寸 + {{ formatMechanismSize(item.block_size) }} +
+
+ 机构位置 + {{ formatVector(item.location) }} +
+
+
+
注意事项
+
    +
  • {{ note }}
  • +
+
+
+
+
+ +
+

斜顶抽芯

+
+
+
斜顶 {{ idx + 1 }}
+
+
+ 斜顶角度 + {{ item.lifter_angle || 'N/A' }}° +
+
+ 斜顶行程 + {{ item.lifter_stroke || 'N/A' }} mm +
+
+ 回位方式 + {{ item.return_mechanism || 'N/A' }} +
+
+ 导向方式 + {{ item.guide_type || 'N/A' }} +
+
+ 机构尺寸 + {{ formatMechanismSize(item.block_size) }} +
+
+ 机构位置 + {{ formatVector(item.location) }} +
+
+
+
注意事项
+
    +
  • {{ note }}
  • +
+
+
+
+
+
+ +
+

总体建议

+
+
+
{{ rec }}
+
+
+
+
+

DFM 检查