feat: Beat 和 Shot 增加悬停显示的独立 AI 诊断入口

This commit is contained in:
GouJ committed 2026-10-16 13:02:10 +08:00
1 parent 179be28552
commit 82dbeda453
1 file changed
+23 -3
@@ -1,7 +1,7 @@
<script setup lang="ts">
import ContextNotice from '../../../components/ui/ContextNotice.vue'
import { NSelect, NTag } from 'naive-ui'
import { NButton, NSelect, NTag } from 'naive-ui'
import { computed, ref } from 'vue'
import { Clock3 } from '@lucide/vue'
import { EmptyState } from '../../../components/ui'
@@ -9,6 +9,8 @@ import type { EpisodePlan, EpisodeShots } from '../types'
/** Episode → Beat → Shot 的分层查看,不提前加入下一条 graph 的导演字段。 */
const props = defineProps<{ plans: EpisodePlan[]; episodes: EpisodeShots[] }>()
/** 分镜卡片只负责发出诊断定位,确认及模型任务交由页面处理。 */
const emit = defineEmits<{ diagnose: [scope: { episodeNo: number; beatNo: number; shotNo?: number }] }>()
const selected = ref<number>()
const plans = computed(() => (props.plans.length ? props.plans : props.episodes.map(item => item.episodePlan)))
/** 选择器与正文统一使用最终规划编号;初次读取或当前剧集被移除时回退到第一集。 */
@@ -68,13 +70,14 @@ const purposeLabels: Record<string, string> = {
<span class="beat-number">{{ String(beat.beatNo).padStart(2, '0') }}</span>
<h3 class="text-sm font-semibold">{{ beat.title }}</h3>
<NTag size="small" :bordered="false">{{ purposeLabels[beat.purpose] || beat.purpose }}</NTag>
<NButton v-if="plan" size="tiny" text class="diagnose-hover-action ml-auto" aria-label="诊断当前节拍" @click="emit('diagnose', { episodeNo: plan.episodeNo, beatNo: beat.beatNo })">AI 诊断</NButton>
</div>
<p class="mb-4 mt-3 text-sm leading-6 text-muted">{{ beat.description }}</p>
<div class="space-y-3">
<article
v-for="shot in episode?.beatShots.find(item => item.beatNo === beat.beatNo)?.shots ?? []"
:key="shot.shotNo"
class="shot-row"
class="shot-row group"
>
<div class="shot-label">
镜头 {{ String(shot.shotNo).padStart(2, '0')
@@ -83,7 +86,9 @@ const purposeLabels: Record<string, string> = {
>
</div>
<div class="min-w-0 flex-1">
<h4 class="text-sm font-medium">{{ shot.title }}</h4>
<div class="flex items-center justify-between gap-3"><h4 class="text-sm font-medium">{{ shot.title }}</h4>
<NButton v-if="plan" size="tiny" text class="diagnose-hover-action" aria-label="诊断当前镜头" @click="emit('diagnose', { episodeNo: plan.episodeNo, beatNo: beat.beatNo, shotNo: shot.shotNo })">AI 诊断</NButton>
</div>
<p class="mt-2 text-sm leading-7">{{ shot.description }}</p>
<p class="mt-2 text-xs leading-6 text-muted">视觉重点 · {{ shot.visualFocus }}</p>
<div class="mt-3 flex flex-wrap gap-2">
@@ -118,6 +123,21 @@ const purposeLabels: Record<string, string> = {
.beat-heading {
@apply flex items-center gap-2.5;
}
.diagnose-hover-action {
opacity: 0;
pointer-events: none;
transition: opacity 150ms ease;
}
.beat-heading:hover .diagnose-hover-action,
.beat-heading:focus-within .diagnose-hover-action,
.shot-row:hover .diagnose-hover-action,
.shot-row:focus-within .diagnose-hover-action {
opacity: 1;
pointer-events: auto;
}
@media (hover: none) {
.diagnose-hover-action { opacity: 1; pointer-events: auto; }
}
.beat-number {
@apply text-muted font-mono text-[11px];
}