fix(short-drama-agent-front): 修复视频素材布局与展示顺序

This commit is contained in:
GJ committed 2026-10-12 11:04:32 +08:00
1 parent 3d2c198e52
commit 1fba14da5d
2 files changed
+44 -28

No files matched your search

@@ -601,15 +601,41 @@ defineExpose({ inspectSpecs, inspecting })
:messages="videoIssueMessages"
/>
</div>
<div v-if="videoInputPlan" class="mt-3 flex flex-wrap items-center gap-2 text-xs">
<!-- 以下是主视频素材变化说明模块,与此前画面检查结论分别说明 -->
<p v-if="videoStale" class="mt-3 text-xs text-muted">首帧或参考图已变化,请重新生成视频。</p>
<!-- 以下是主视频展示模块,位于素材引用之前,其它记录在候选弹窗中查看 -->
<div v-if="currentVideo" class="video-grid mt-4">
<VideoCard
:item="currentVideo"
:shot-no="shot.shotNo"
:duration-seconds="shot.durationSeconds"
:stale="videoStale"
:blocked="assetBlocked"
:validation-passed="sessionVideoValidation(projectId, shot.shotId, currentVideo.id)?.passed ?? null"
:recorded-validation-passed="
videoRecordedValidation(videoQualityStatus, shot.shotId, currentVideo.id)
"
:confirming="false"
@quality="openQuality('video', currentVideo.id)"
@history="openVideoHistory(currentVideo.id)"
/>
</div>
<p v-else class="mt-4 text-xs text-muted">
{{ videoCandidates.length ? '尚无已确认主视频,请在候选中检查并选择。' : '尚无视频任务记录。' }}
</p>
<!-- 以下是视频素材输入方式与原因说明模块,位于主视频下方、素材引用之前 -->
<div v-if="videoInputPlan" class="mt-4 flex flex-wrap items-center gap-2 text-xs">
<NTag size="small" :bordered="false" type="info">
{{ videoInputPlan.inputMode === 'omni_reference' ? '使用多张参考图' : '使用首帧' }}
</NTag>
<span class="text-muted">{{ videoInputPlan.reasons.map(productionMessage).join(';') }}</span>
</div>
<!-- 以下是主视频素材变化说明模块,与此前画面检查结论分别说明 -->
<p v-if="videoStale" class="mt-3 text-xs text-muted">首帧或参考图已变化,请重新生成视频。</p>
<section class="surface-inset mt-4 p-4" aria-label="当前视频生成素材引用">
<!-- 以下是外层铺满、单行紧凑排列、换行后按可用宽度等分的视频素材模块 -->
<section
class="video-input-section surface-inset mt-4 p-4"
:style="{ '--video-input-count': (currentVideoInput?.references.length ?? 0) + 1 }"
aria-label="当前视频生成素材引用"
>
<div class="flex flex-wrap items-center justify-between gap-2">
<h6 class="text-xs font-medium">视频使用的素材</h6>
<span v-if="currentVideoInput" class="text-[11px] text-muted">
@@ -674,26 +700,6 @@ defineExpose({ inspectSpecs, inspecting })
</div>
</div>
</section>
<!-- 以下是主视频展示模块,其它记录在候选弹窗中查看 -->
<div v-if="currentVideo" class="video-grid mt-4">
<VideoCard
:item="currentVideo"
:shot-no="shot.shotNo"
:duration-seconds="shot.durationSeconds"
:stale="videoStale"
:blocked="assetBlocked"
:validation-passed="sessionVideoValidation(projectId, shot.shotId, currentVideo.id)?.passed ?? null"
:recorded-validation-passed="
videoRecordedValidation(videoQualityStatus, shot.shotId, currentVideo.id)
"
:confirming="false"
@quality="openQuality('video', currentVideo.id)"
@history="openVideoHistory(currentVideo.id)"
/>
</div>
<p v-else class="mt-4 text-xs text-muted">
{{ videoCandidates.length ? '尚无已确认主视频,请在候选中检查并选择。' : '尚无视频任务记录。' }}
</p>
<!-- 以下是视频候选弹窗入口模块 -->
<div v-if="videoCandidates.length" class="mt-4 flex flex-wrap gap-3">
<NButton @click="videoCandidatesOpen = true">管理候选({{ videoCandidates.length }})</NButton>
@@ -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;
+7 -2
View File
@@ -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')