feat: 实现剧本创作与拆解前端工作台
This commit is contained in:
1 parent
edc003443f
commit
2ee6f049f6
56 files changed
+7597
-2
No files matched your search
@@ -0,0 +1,94 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { Clock3 } from '@lucide/vue'
|
||||
import { EmptyState } from '../../../components/ui'
|
||||
import type { EpisodePlan, EpisodeShots } from '../types'
|
||||
|
||||
/** Episode → Beat → Shot 的分层查看,不提前加入下一条 graph 的导演字段。 */
|
||||
const props = defineProps<{ plans: EpisodePlan[]; episodes: EpisodeShots[] }>()
|
||||
const selected = ref<number>()
|
||||
const plans = computed(() => (props.plans.length ? props.plans : props.episodes.map(item => item.episodePlan)))
|
||||
const plan = computed(() => plans.value.find(item => item.episodeNo === selected.value) ?? plans.value[0])
|
||||
const episode = computed(() => props.episodes.find(item => item.episodeNo === plan.value?.episodeNo))
|
||||
const purposeLabels: Record<string, string> = {
|
||||
establish: '建立场景',
|
||||
introduce: '引入',
|
||||
action: '行动',
|
||||
dialogue: '对白',
|
||||
reaction: '反应',
|
||||
reveal: '揭示',
|
||||
transition: '过渡',
|
||||
climax: '高潮',
|
||||
resolution: '收束',
|
||||
hook: '钩子'
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="plan" class="p-5 lg:p-7">
|
||||
<div class="mb-5 flex flex-wrap items-center justify-between gap-3">
|
||||
<label class="flex items-center gap-3 text-sm"
|
||||
>选择剧集<select v-model="selected" class="input w-auto" aria-label="选择分镜剧集">
|
||||
<option v-if="selected === undefined" :value="undefined">
|
||||
第 {{ plan.episodeNo }} 集 · {{ plan.episodeTitle }}
|
||||
</option>
|
||||
<option v-for="item in plans" :key="item.episodeNo" :value="item.episodeNo">
|
||||
第 {{ item.episodeNo }} 集 · {{ item.episodeTitle }}
|
||||
</option>
|
||||
</select></label
|
||||
><span class="text-xs text-muted"
|
||||
>{{ plan.beats.length }} 个节拍 ·
|
||||
{{ episode?.beatShots.reduce((sum, beat) => sum + beat.shots.length, 0) ?? 0 }} 个镜头</span
|
||||
>
|
||||
</div>
|
||||
<div class="mb-7 border-l-2 border-accent pl-4">
|
||||
<p class="font-medium">{{ plan.storyGoal }}</p>
|
||||
<p class="mt-2 text-sm leading-6 text-muted">{{ plan.emotionalArc }}</p>
|
||||
</div>
|
||||
<p v-if="!episode" class="alert mb-5">
|
||||
本集已完成节拍规划,镜头尚未生成。请等待进度更新,或在确认中断后使用“补齐缺失镜头”。
|
||||
</p>
|
||||
<section v-for="beat in plan.beats" :key="beat.beatNo" class="beat-section">
|
||||
<div class="beat-heading">
|
||||
<span class="beat-number">{{ String(beat.beatNo).padStart(2, '0') }}</span>
|
||||
<h3 class="text-sm font-semibold">{{ beat.title }}</h3>
|
||||
<span class="tag ml-auto">{{ purposeLabels[beat.purpose] || beat.purpose }}</span>
|
||||
</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"
|
||||
>
|
||||
<div class="shot-label">
|
||||
镜头 {{ String(shot.shotNo).padStart(2, '0')
|
||||
}}<span class="mt-2 flex items-center gap-1 text-[11px]"
|
||||
><Clock3 :size="11" />{{ shot.durationSeconds }}s</span
|
||||
>
|
||||
</div>
|
||||
<div class="min-w-0 flex-1">
|
||||
<h4 class="text-sm font-medium">{{ shot.title }}</h4>
|
||||
<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">
|
||||
<code v-for="ref in shot.subjectRefs" :key="ref" class="subject-ref">{{ ref }}</code>
|
||||
</div>
|
||||
<p v-if="shot.subjectBindings?.length" class="mt-2 text-xs leading-6 text-muted">
|
||||
{{
|
||||
shot.subjectBindings
|
||||
.map(binding => binding.subjectRef + ' · ' + binding.formName)
|
||||
.join(' / ')
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<EmptyState
|
||||
v-else
|
||||
title="分镜规划尚未生成"
|
||||
description="完成主体整理后,工作流会先规划每集的剧情节拍,再逐集生成镜头。"
|
||||
/>
|
||||
</template>
|
||||
@@ -0,0 +1,67 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import { Search, ChevronDown } from '@lucide/vue'
|
||||
import { EmptyState } from '../../../components/ui'
|
||||
import type { SubjectCandidate, SubjectForm } from '../types'
|
||||
|
||||
/** 主体列表按稳定 ref 展示;形态以 profileId 关联。 */
|
||||
const props = defineProps<{ subjects: SubjectCandidate[]; forms: SubjectForm[] }>()
|
||||
const search = ref('')
|
||||
const filtered = computed(() =>
|
||||
props.subjects.filter(item =>
|
||||
`${item.name} ${item.ref} ${item.aliases?.join(' ') ?? ''}`
|
||||
.toLowerCase()
|
||||
.includes(search.value.trim().toLowerCase())
|
||||
)
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="p-5 lg:p-7">
|
||||
<div class="mb-5 flex items-center justify-between gap-3">
|
||||
<p class="text-sm text-muted">{{ subjects.length }} 个主体</p>
|
||||
<div class="search-field">
|
||||
<Search :size="14" /><input v-model="search" placeholder="搜索名称或引用" aria-label="搜索主体" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="filtered.length" class="divide-y divide-line">
|
||||
<article v-for="subject in filtered" :key="subject.profileId" class="py-5 first:pt-0">
|
||||
<div class="mb-3 flex flex-wrap items-center gap-3">
|
||||
<h3 class="font-semibold">{{ subject.name }}</h3>
|
||||
<code class="subject-ref">{{ subject.ref }}</code
|
||||
><span v-if="subject.aliases?.length" class="text-xs text-muted"
|
||||
>别名:{{ subject.aliases.join('、') }}</span
|
||||
>
|
||||
</div>
|
||||
<p class="text-sm leading-7">{{ subject.description }}</p>
|
||||
<details class="subject-details mt-4">
|
||||
<summary>
|
||||
<ChevronDown :size="14" />外观描述与形态
|
||||
<span class="ml-1 text-muted">{{
|
||||
forms.filter(form => form.profileId === subject.profileId).length
|
||||
}}</span>
|
||||
</summary>
|
||||
<p class="mt-3 whitespace-pre-wrap text-sm leading-7 text-muted">
|
||||
{{ subject.appearance_prompt || '暂无外观描述' }}
|
||||
</p>
|
||||
<div
|
||||
v-for="form in forms.filter(item => item.profileId === subject.profileId)"
|
||||
:key="form.formId"
|
||||
class="mt-3 border-l-2 border-line pl-4"
|
||||
>
|
||||
<p class="text-sm font-medium">
|
||||
{{ form.formName || form.name }}<span v-if="form.isDefault" class="tag ml-2">默认</span>
|
||||
</p>
|
||||
<p class="mt-2 text-sm leading-6 text-muted">{{ form.description }}</p>
|
||||
<p class="mt-2 text-xs leading-6 text-muted">{{ form.appearancePrompt }}</p>
|
||||
</div>
|
||||
</details>
|
||||
</article>
|
||||
</div>
|
||||
<EmptyState
|
||||
v-else
|
||||
:title="subjects.length ? '没有匹配的主体' : '尚无主体结果'"
|
||||
description="主体会在抽取、合并与档案整理完成后出现在这里。若未启用该模块,则不会生成此类主体。"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user