From 1fba14da5d0765f802b53b71dcc2896feafe607b Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 12 Oct 2026 11:04:32 +0800 Subject: [PATCH] =?UTF-8?q?fix(short-drama-agent-front):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=A7=86=E9=A2=91=E7=B4=A0=E6=9D=90=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E4=B8=8E=E5=B1=95=E7=A4=BA=E9=A1=BA=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ShotProductionAssets.vue | 63 +++++++++++-------- tests/features/production/production.test.ts | 9 ++- 2 files changed, 44 insertions(+), 28 deletions(-) diff --git a/src/features/production/components/ShotProductionAssets.vue b/src/features/production/components/ShotProductionAssets.vue index 5ec71de..fce31ab 100644 --- a/src/features/production/components/ShotProductionAssets.vue +++ b/src/features/production/components/ShotProductionAssets.vue @@ -601,15 +601,41 @@ defineExpose({ inspectSpecs, inspecting }) :messages="videoIssueMessages" /> -
+ +

首帧或参考图已变化,请重新生成视频。

+ +
+ +
+

+ {{ videoCandidates.length ? '尚无已确认主视频,请在候选中检查并选择。' : '尚无视频任务记录。' }} +

+ +
{{ videoInputPlan.inputMode === 'omni_reference' ? '使用多张参考图' : '使用首帧' }} {{ videoInputPlan.reasons.map(productionMessage).join(';') }}
- -

首帧或参考图已变化,请重新生成视频。

-
+ +
视频使用的素材
@@ -674,26 +700,6 @@ defineExpose({ inspectSpecs, inspecting })
- -
- -
-

- {{ videoCandidates.length ? '尚无已确认主视频,请在候选中检查并选择。' : '尚无视频任务记录。' }} -

管理候选({{ videoCandidates.length }}) @@ -945,10 +951,15 @@ defineExpose({ inspectSpecs, inspecting }) .keyframe-card .asset-image { @apply aspect-square rounded-none; } -/* 素材按可用宽度等分列,自动收起空列,让首尾卡片与内容区左右边缘对齐。 */ +/* 素材背景与标题铺满外层内容宽度。 */ +.video-input-section { + width: 100%; +} +/* 单行按 220px 紧凑排列;放不下时网格铺满可用宽度,自动换行并等分列,左右贴齐。 */ .video-input-grid { @apply grid w-full gap-3; - grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); + max-width: calc(var(--video-input-count) * 220px + (var(--video-input-count) - 1) * 12px); + grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); } .video-input-grid .asset-image { @apply aspect-square rounded-none; diff --git a/tests/features/production/production.test.ts b/tests/features/production/production.test.ts index fcec82c..43921b2 100644 --- a/tests/features/production/production.test.ts +++ b/tests/features/production/production.test.ts @@ -46,12 +46,17 @@ describe('镜头生产数据契约', () => { expect(source).toMatch(/\.generation-input-mode-label\s*\{[^}]*mb-\[7px\][^}]*text-xs/) }) - it('主首帧与主视频共用固定宽度,素材引用保留正方形网格', () => { + it('素材外层铺满,单行保持紧凑方图,换行后按可用宽度等分', () => { const source = readFileSync('src/features/production/components/ShotProductionAssets.vue', 'utf8') expect(source).toContain('v-if="currentVideo" class="video-grid mt-4"') expect(source).toMatch(/\.keyframe-grid,\s*\.video-grid\s*\{[^}]*max-w-\[260px\][^}]*grid-cols-1/) expect(source).toMatch( - /\.video-input-grid\s*\{[^}]*grid-template-columns:\s*repeat\(auto-fit, minmax\(min\(180px, 100%\), 1fr\)\)/ + /\.video-input-grid\s*\{[^}]*grid-template-columns:\s*repeat\(auto-fit, minmax\(min\(220px, 100%\), 1fr\)\)/ + ) + expect(source).toContain("'--video-input-count': (currentVideoInput?.references.length ?? 0) + 1") + expect(source).toMatch(/\.video-input-section\s*\{\s*width:\s*100%;\s*\}/) + expect(source).toMatch( + /\.video-input-grid\s*\{[^}]*max-width:\s*calc\(var\(--video-input-count\) \* 220px \+ \(var\(--video-input-count\) - 1\) \* 12px\)/ ) expect(source).toMatch(/\.keyframe-card \.asset-image\s*\{[^}]*aspect-square/) const videoCard = readFileSync('src/features/production/components/VideoCard.vue', 'utf8')