fix(short-drama-agent-front): 修正分镜诊断状态与响应式布局
This commit is contained in:
1 parent
1da56e0d46
commit
b34dc02e39
23 files changed
+796
-273
No files matched your search
@@ -65,11 +65,15 @@
|
||||
|
||||
- 绿色背景、白色文字用于保存、提交、开始生成等主要执行操作;关闭、取消和普通辅助操作使用中性样式。
|
||||
- 错误、校验未通过、需要修复的区域使用柔和浅红背景,深色主题使用对应柔和深红底面。禁止使用上下两条绿色横线表示错误或待修复状态,也不能借用绿色选中态来标记错误。
|
||||
- 普通镜头定位仅使用中性提示,不能因点击“定位镜头”就标红;只有从当前明确问题定位时才使用错误底色,正文刷新后清除旧定位标记。
|
||||
- 错误入口按钮的文字、图标和焦点提示与红色底面保持一致;默认、悬停、按下、聚焦各状态都不能被主题主色覆盖成绿色。保留清晰的键盘焦点提示。
|
||||
- 只有执行完成且结果明确通过校验时,成功任务区域才使用柔和浅绿背景。执行结束但校验失败、质量待审或结果未确认时,不能显示成绿色成功状态,也不能用满格绿色进度条暗示业务成功。
|
||||
- 卡片内的定位、复查、修订和历史入口使用带图标、独立中性底面的按钮,不添加边框,不能与说明文字混在一起;复用 `workspace-action-button` / `workspace-action-group`,不把辅助操作改成绿色主按钮。
|
||||
- 工具栏中相邻按钮保持一致的高度、内边距、图标大小和间距。问题入口使用图标加文字;分镜结构校验失败时文案为“分镜校验未通过”,其他问题按真实类型命名。
|
||||
- 移动端的工具栏操作优先只显示图标,保留完整的 `aria-label`、提示文本和足够点击区域;普通表单的底部关闭、取消、提交按钮仍保留文字。
|
||||
- 仅显示单个图标的操作按钮统一使用正方形,图标居中,并使用 Naive UI `NPopover` 展示完整操作名称;优先复用 `WorkspaceActionTooltip`,保留对应 `aria-label`,相邻按钮尺寸和间距一致。
|
||||
- 按钮已显示完整文字时,不再重复添加同名悬浮提示;桌面有文字、移动端仅图标的响应式按钮,仅在隐藏文字的屏幕尺寸下启用 `NPopover`。桌面仍为纯图标的按钮继续保留提示。
|
||||
- 诊断结果卡片的定位、可选 AI 复查、修订及历史按钮在移动端也保留图标和完整文字,宽度不足时自动换行,不套用顶部工具栏仅显示图标的规则。
|
||||
- 页面左侧汇总状态在运行、成功、失败等状态下均有意义,应保留;右侧操作入口负责打开对应处理界面,避免把状态展示和操作混成重复文案。
|
||||
|
||||
### 设置、问题处理与任务进度
|
||||
@@ -82,6 +86,8 @@
|
||||
- 从问题界面定位正文时,先关闭抽屉,等离场和焦点约束释放后再定位,不能同时叠加两个主界面。
|
||||
- 后端从其他入口启动或重新执行任务时,前端也应发现任务并显示真实运行阶段、进度、作用范围及更新时间;重新进入页面后能够恢复观察,不能只依赖前端本次点击形成的加载状态。
|
||||
- 执行状态与质量校验结果分别表达,不能把“执行完成”直接等同于“校验通过”;没有真实进度或结果时明确显示待确认,不伪造百分比。
|
||||
- 已修订且当前审核通过的镜头,不因未运行或过期的独立 AI 诊断再次列为“需处理”。AI 复查单独作为可选项,只有当前明确冲突或实时结构化问题才提示修复;复查入口受限不能直接解释为正式分镜需要重拆。
|
||||
- 默认收起的“高级检查详情”只保留必要的检查记录和当前复查范围,不再单独展示旧手部覆盖率或未填写手部记录;缺少记录使用中性说明,不作为错误,实际检出的动作冲突仍在普通问题区域展示。
|
||||
- 拆解执行中暂不显示“查看诊断”等需要稳定结果的入口。问题可以只读查看,但人工修改、候选提交、修复和恢复操作应遵守真实活动任务锁,避免冲突。
|
||||
- 拆解任务卡片与相邻模块采用统一边距和状态底色,必要的阶段、范围、进度和时间直接简洁展示;不要把重要信息只藏在“任务详情”折叠中,也不默认展示无助于操作的内部编号或原始数据。
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import { NPopover } from 'naive-ui'
|
||||
import { onScopeDispose, ref } from 'vue'
|
||||
|
||||
/** 工作区图标操作共用的悬浮说明。 */
|
||||
const props = defineProps<{
|
||||
/** 与按钮无障碍名称一致的操作说明。 */
|
||||
label: string
|
||||
/** 按钮仅在手机端隐藏文字时,只在对应窄屏显示说明。 */
|
||||
mobileOnly?: boolean
|
||||
}>()
|
||||
/** 与项目工具栏隐藏文字的断点保持一致。 */
|
||||
const compactMedia = props.mobileOnly ? window.matchMedia('(max-width: 639px)') : null
|
||||
/** 跨屏幕尺寸时同步提示开关,桌面文字按钮不重复提示。 */
|
||||
const compact = ref(compactMedia?.matches ?? false)
|
||||
/**
|
||||
* 同步当前按钮是否处于仅显示图标的窄屏。
|
||||
* @param event 屏幕断点变化事件
|
||||
*/
|
||||
function syncCompact(event: MediaQueryListEvent) {
|
||||
compact.value = event.matches
|
||||
}
|
||||
compactMedia?.addEventListener('change', syncCompact)
|
||||
onScopeDispose(() => compactMedia?.removeEventListener('change', syncCompact))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是图标操作的统一悬浮说明,不额外增加布局容器 -->
|
||||
<NPopover trigger="hover" placement="bottom-end" :disabled="mobileOnly && !compact">
|
||||
<template #trigger><slot /></template>
|
||||
{{ label }}
|
||||
</NPopover>
|
||||
</template>
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { Download } from '@lucide/vue'
|
||||
import { NButton, NPopover } from 'naive-ui'
|
||||
import { NButton } from 'naive-ui'
|
||||
import WorkspaceActionTooltip from './WorkspaceActionTooltip.vue'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
/** 工作区标签栏的直接导出入口。 */
|
||||
@@ -43,21 +44,18 @@ watch(
|
||||
class="tabs-toolbar-actions workspace-export-action"
|
||||
:style="{ '--export-button-size': `${buttonSize}px` }"
|
||||
>
|
||||
<NPopover trigger="hover" placement="bottom-end">
|
||||
<template #trigger>
|
||||
<NButton
|
||||
quaternary
|
||||
size="small"
|
||||
class="icon-button workspace-export-button"
|
||||
:aria-label="label"
|
||||
:disabled="disabled"
|
||||
@click="emit('export')"
|
||||
>
|
||||
<template #icon><Download :size="18" aria-hidden="true" /></template>
|
||||
</NButton>
|
||||
</template>
|
||||
{{ label }}
|
||||
</NPopover>
|
||||
<WorkspaceActionTooltip :label="label">
|
||||
<NButton
|
||||
quaternary
|
||||
size="small"
|
||||
class="icon-button workspace-export-button"
|
||||
:aria-label="label"
|
||||
:disabled="disabled"
|
||||
@click="emit('export')"
|
||||
>
|
||||
<template #icon><Download :size="18" aria-hidden="true" /></template>
|
||||
</NButton>
|
||||
</WorkspaceActionTooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -68,9 +66,10 @@ watch(
|
||||
@apply items-stretch self-stretch shrink-0 flex-nowrap;
|
||||
}
|
||||
.workspace-export-action .n-button.workspace-export-button {
|
||||
width: var(--export-button-size);
|
||||
/* 项目手机工具栏统一紧凑尺寸,其余场景继续跟随标签栏高度。 */
|
||||
width: var(--app-toolbar-icon-size, var(--export-button-size));
|
||||
min-width: 0;
|
||||
height: 100%;
|
||||
align-self: stretch;
|
||||
height: var(--app-toolbar-icon-size, 100%);
|
||||
align-self: center;
|
||||
}
|
||||
</style>
|
||||
@@ -4,6 +4,7 @@ import { NFormItem } from 'naive-ui'
|
||||
import { integerRule, fieldRule } from '../../lib/form-rules'
|
||||
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
import WorkspaceExportButton from '../../components/ui/WorkspaceExportButton.vue'
|
||||
import WorkspaceActionTooltip from '../../components/ui/WorkspaceActionTooltip.vue'
|
||||
import { NScrollbar, NButton, NCheckbox, NCollapse, NCollapseItem, NInputNumber, NTab, NTable, NTabs } from 'naive-ui'
|
||||
import { computed, h, nextTick, onScopeDispose, ref, watch } from 'vue'
|
||||
import { useActionMessage } from '../../components/ui/useActionMessage'
|
||||
@@ -122,11 +123,12 @@ function openShotDiagnosis(location: DiagnosisLocation) {
|
||||
diagnosisPanel.value?.open(location)
|
||||
}
|
||||
/**
|
||||
* 诊断问题定位到分镜正文,必要时切换到对应剧集。
|
||||
* 诊断列表定位到分镜正文,只有实际问题才使用错误提示。
|
||||
* @param location 待定位的分镜坐标
|
||||
* @param problem 当前镜头是否有明确问题
|
||||
*/
|
||||
function locateDiagnosisShot(location: DiagnosisLocation) {
|
||||
void storyboardList.value?.locate(location)
|
||||
function locateDiagnosisShot(location: DiagnosisLocation, problem = false) {
|
||||
void storyboardList.value?.locate(location, { problem })
|
||||
}
|
||||
const backgroundExecution = useWorkflowExecution(projectId, 'breakdown')
|
||||
const recovery = computed(() => recoveryOptions(checkpoints.value))
|
||||
@@ -206,7 +208,7 @@ async function locateIssue(issue: ShotValidation['issues'][number]) {
|
||||
episodeNo: issue.episodeNo,
|
||||
beatNo: issue.beatNo,
|
||||
...(issue.shotNo ? { shotNo: issue.shotNo } : {})
|
||||
})
|
||||
}, { problem: true })
|
||||
}
|
||||
const taskStopped = computed(() => execution.value?.status === 'failed' || execution.value?.status === 'completed')
|
||||
/** 后续候选修订已替代旧任务结果时,只在明确的历史记录中展示回执。 */
|
||||
@@ -762,17 +764,18 @@ const rules = {
|
||||
<template #icon><CircleAlert :size="15" aria-hidden="true" /></template>
|
||||
</NButton>
|
||||
<!-- 以下是手机分类导航中的拆解设置入口,共用原有设置弹窗 -->
|
||||
<WorkspaceActionTooltip label="拆解设置">
|
||||
<NButton
|
||||
quaternary
|
||||
class="icon-button breakdown-mobile-tools"
|
||||
aria-label="拆解设置"
|
||||
title="拆解设置"
|
||||
aria-haspopup="dialog"
|
||||
:aria-expanded="toolsOpen"
|
||||
@click="toolsOpen = true"
|
||||
>
|
||||
<template #icon><Settings2 :size="15" /></template>
|
||||
<template #icon><Settings2 :size="15" aria-hidden="true" /></template>
|
||||
</NButton>
|
||||
</WorkspaceActionTooltip>
|
||||
<!-- 以下是拆解快照直接导出模块,与剧本创作共用图标和悬浮说明 -->
|
||||
<WorkspaceExportButton
|
||||
label="导出拆解结果"
|
||||
@@ -1101,11 +1104,16 @@ const rules = {
|
||||
.breakdown-workspace-page .breakdown-mobile-tools.n-button,
|
||||
.breakdown-workspace-page .breakdown-mobile-issues.n-button {
|
||||
display: inline-flex;
|
||||
width: 44px;
|
||||
min-width: 44px;
|
||||
height: 44px;
|
||||
width: var(--app-toolbar-icon-size, 44px);
|
||||
min-width: var(--app-toolbar-icon-size, 44px);
|
||||
height: var(--app-toolbar-icon-size, 44px);
|
||||
padding: 0;
|
||||
}
|
||||
/* 上下两组手机工具栏采用相同间距,保持两列图标对齐。 */
|
||||
.breakdown-workspace-page .breakdown-toolbar-actions {
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
/* 分类导航与设置共用完整吸顶背景,正文不会从导航区域透出。 */
|
||||
.breakdown-workspace-page .breakdown-results-section > .result-toolbar {
|
||||
position: sticky;
|
||||
|
||||
@@ -24,17 +24,23 @@ import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
</div>
|
||||
</template>
|
||||
<div class="breakdown-skeleton-results" aria-hidden="true">
|
||||
<!-- 来源说明只预留文字位置,不提前显示候选或正式结果的判断。 -->
|
||||
<div class="breakdown-skeleton-source"><NSkeleton :width="84" :height="12" /></div>
|
||||
<!-- 以下是分类标签与操作入口占位模块 -->
|
||||
<div class="breakdown-skeleton-tabs">
|
||||
<NSkeleton v-for="tab in 5" :key="tab" :width="28" :height="14" />
|
||||
<NSkeleton class="breakdown-skeleton-mobile-settings" :width="44" :height="44" />
|
||||
<NSkeleton class="breakdown-skeleton-settings" :width="40" :height="40" />
|
||||
<div class="breakdown-skeleton-tab-labels">
|
||||
<span v-for="tab in 5" :key="tab" class="breakdown-skeleton-tab"><NSkeleton :class="{ 'breakdown-skeleton-task-label': tab === 5 }" :width="tab === 5 ? 56 : 28" :height="14" /></span>
|
||||
</div>
|
||||
<div class="breakdown-skeleton-tab-actions">
|
||||
<NSkeleton class="breakdown-skeleton-icon breakdown-skeleton-mobile-settings" />
|
||||
<NSkeleton class="breakdown-skeleton-icon" />
|
||||
</div>
|
||||
</div>
|
||||
<NScrollbar class="breakdown-skeleton-scroll">
|
||||
<!-- 以下是搜索框与主体统计占位模块 -->
|
||||
<!-- 搜索或剧集选择控件与统计相邻排列,不使用整行的大色块。 -->
|
||||
<div class="breakdown-skeleton-search">
|
||||
<NSkeleton class="breakdown-skeleton-input" :height="34" />
|
||||
<NSkeleton :width="70" :height="12" />
|
||||
<NSkeleton class="breakdown-skeleton-count" :width="96" :height="12" />
|
||||
</div>
|
||||
<!-- 以下是主体名称、描述、关联入口与形态折叠区占位模块 -->
|
||||
<div class="breakdown-skeleton-records">
|
||||
@@ -76,8 +82,26 @@ import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
@apply flex flex-col flex-1 min-h-0 min-w-0;
|
||||
gap: var(--app-content-gap);
|
||||
}
|
||||
.breakdown-skeleton-source {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-height: 16px;
|
||||
}
|
||||
.breakdown-skeleton-tabs {
|
||||
@apply flex items-center shrink-0 gap-8 pl-4 min-h-10 bg-(--app-surface);
|
||||
@apply flex items-center shrink-0 min-h-10 min-w-0 bg-(--app-surface);
|
||||
}
|
||||
.breakdown-skeleton-tab-labels {
|
||||
@apply flex items-center min-w-0 overflow-hidden;
|
||||
}
|
||||
.breakdown-skeleton-tab {
|
||||
@apply flex items-center justify-center shrink-0 px-4 min-h-10;
|
||||
}
|
||||
.breakdown-skeleton-tab-actions {
|
||||
@apply flex items-center shrink-0 ml-auto;
|
||||
}
|
||||
.breakdown-skeleton-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
}
|
||||
:root:not([data-theme='dark']) .breakdown-skeleton-tabs {
|
||||
@apply bg-(--app-subtle);
|
||||
@@ -90,7 +114,10 @@ import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
margin-bottom: var(--app-content-gap);
|
||||
}
|
||||
.breakdown-skeleton-input {
|
||||
@apply basis-[260px] shrink min-w-0;
|
||||
@apply basis-[260px] shrink-0 min-w-0;
|
||||
}
|
||||
.breakdown-skeleton-count {
|
||||
@apply shrink-0;
|
||||
}
|
||||
.breakdown-skeleton-record {
|
||||
@apply p-5 min-w-0 bg-(--app-control);
|
||||
@@ -122,19 +149,30 @@ import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
.breakdown-skeleton-input {
|
||||
@apply flex-1;
|
||||
}
|
||||
.breakdown-skeleton-search {
|
||||
@apply gap-2;
|
||||
}
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
/* 与加载完成后的两列工具图标保持相同间距。 */
|
||||
.breakdown-skeleton-tab-actions {
|
||||
gap: 8px;
|
||||
}
|
||||
.breakdown-skeleton :deep(.workspace-heading-scroll) {
|
||||
@apply hidden;
|
||||
}
|
||||
.breakdown-skeleton-tabs {
|
||||
@apply gap-2 pl-2 min-h-11;
|
||||
.breakdown-skeleton-tab {
|
||||
@apply px-2;
|
||||
}
|
||||
.breakdown-skeleton-task-label {
|
||||
width: 28px !important;
|
||||
}
|
||||
.breakdown-skeleton-mobile-settings {
|
||||
@apply block;
|
||||
}
|
||||
.breakdown-skeleton-tabs .breakdown-skeleton-settings {
|
||||
@apply w-11! h-11!;
|
||||
.breakdown-skeleton-icon {
|
||||
width: var(--app-toolbar-icon-size, 44px);
|
||||
height: var(--app-toolbar-icon-size, 44px);
|
||||
}
|
||||
.breakdown-skeleton-results,
|
||||
.breakdown-skeleton-scroll {
|
||||
|
||||
@@ -117,7 +117,7 @@ async function commit() {
|
||||
const receipt = await breakdownApi.commitCandidate(id)
|
||||
if (receipt.projectId !== id) throw new Error('提交回执所属项目不一致,请刷新确认。')
|
||||
return receipt
|
||||
}, receipt => ({ type: 'success', content: `候选已提交:${receipt.subjectCount} 个主体、${receipt.episodeCount} 集、${receipt.shotCount} 个镜头。` }))
|
||||
}, receipt => ({ type: 'success', content: `拆解结果已保存并采用:${receipt.subjectCount} 个主体、${receipt.episodeCount} 集、${receipt.shotCount} 个镜头。` }))
|
||||
if (props.projectId === id) {
|
||||
if (ok) submittedId.value = `${id}:${checkpointId}`
|
||||
invalidate()
|
||||
@@ -129,16 +129,17 @@ async function commit() {
|
||||
|
||||
<template>
|
||||
<!-- 以下是候选质量与安全提交模块,不使用只读审核结果替代事务门禁 -->
|
||||
<section v-if="isCandidate" class="workspace-panel space-y-4" aria-label="拆解候选">
|
||||
<section v-if="isCandidate" class="workspace-panel space-y-4" :class="{ 'breakdown-candidate-committed': committed }" aria-label="拆解候选">
|
||||
<div class="flex flex-wrap items-center justify-between gap-3">
|
||||
<h3 class="text-sm font-medium">{{ committed ? '候选已提交' : '待确认的拆解候选' }}</h3>
|
||||
<h3 class="text-sm font-medium">{{ committed ? '拆解结果已保存并采用' : '待确认的拆解候选' }}</h3>
|
||||
<span class="text-xs text-muted">{{ committed ? '正式主体' : '候选主体' }} {{ counts.subjects }} · {{ counts.episodes }} 集 · {{ counts.shots }} 镜</span>
|
||||
</div>
|
||||
<p class="text-xs leading-6 text-muted">{{ committed ? '这份结果已写入正式主体、形态与分镜。' : '候选尚未写入正式资产,质量审核后还需通过安全预检查。' }}</p>
|
||||
<p v-if="!committed" class="text-xs text-muted" role="status">{{ quality.loading ? '正在重新审核当前候选…' : quality.needsRefresh ? '当前候选审核尚未确认,请刷新候选状态。' : quality.canRequestCommitPreview ? '候选质量审核通过,可执行提交安全预检查。' : '候选仍有待处理问题,请先修订。' }}</p>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<NButton v-if="!committed" :disabled="!canCheck" :loading="checking || committing" @click="check">提交候选为正式结果</NButton>
|
||||
<WorkspaceRefreshButton label="刷新候选状态" :loading="quality.loading" :disabled="operation.pending || checking" @refresh="emit('refresh')" />
|
||||
<p class="text-xs leading-6 text-muted">{{ committed ? '本次拆解出的人物、场景、道具和分镜已保存,后续制作会使用这份结果。' : '候选尚未写入正式资产,质量审核后还需通过安全预检查。' }}</p>
|
||||
<p v-if="!committed" class="text-xs text-muted" role="status">{{ quality.loading ? '正在重新审核当前候选…' : quality.needsRefresh ? '这份拆解结果的检查状态尚未确认,请点击“重新检查”。' : quality.canRequestCommitPreview ? '候选质量审核通过,可执行提交安全预检查。' : '候选仍有待处理问题,请先修订。' }}</p>
|
||||
<!-- 以下是尚未采用结果的检查与确认操作,采用后不再显示操作区域 -->
|
||||
<div v-if="!committed" class="flex flex-wrap items-center gap-3">
|
||||
<NButton :disabled="!canCheck" :loading="checking || committing" @click="check">提交候选为正式结果</NButton>
|
||||
<WorkspaceRefreshButton label="重新检查" :loading="quality.loading" :disabled="operation.pending || checking" @refresh="emit('refresh')" />
|
||||
</div>
|
||||
<section v-if="failedChecks.length" class="problem-surface p-4" aria-label="未通过的提交安全检查"><p class="mb-2 text-sm">提交安全检查未通过</p><ul class="list-inside list-disc space-y-2 text-xs"><li v-for="label in failedChecks" :key="label">{{ label }}</li></ul></section>
|
||||
<p v-if="checkError" class="text-xs text-danger" role="alert">{{ checkError }}</p>
|
||||
@@ -150,3 +151,10 @@ async function commit() {
|
||||
</AppDialog>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* 只表达结果已成功保存并采用,未采用时保留默认底色,质量审核结论仍独立展示。 */
|
||||
.workspace-panel.breakdown-candidate-committed {
|
||||
background: var(--app-success-soft);
|
||||
}
|
||||
</style>
|
||||
@@ -30,6 +30,9 @@ const history = ref<DiagnosisHistory | null>(null)
|
||||
const revisions = ref<StoryboardHandRepairHistory | null>(null)
|
||||
/** 当前诊断对应的修订资格。 */
|
||||
const readiness = ref<DiagnosisRepairReadiness | null>(null)
|
||||
/** 两类记录均已成功读到空结果时,使用同一条空状态,读取失败不冒充暂无记录。 */
|
||||
const noRecords = computed(() => !loading.value && !error.value && !!history.value && !!revisions.value &&
|
||||
history.value.revisions.length === 0 && revisions.value.revisions.length === 0)
|
||||
/** 当前列表与资格必须同时有效,不能把旧诊断或直接应用标记解释成修订许可。 */
|
||||
const repairEligible = computed(() => readiness.value?.eligible === true && readiness.value.requiresManualReview === true &&
|
||||
readiness.value.canApplyDirectly === false && readiness.value.willCallModel === false && readiness.value.willModifyAssets === false &&
|
||||
@@ -77,12 +80,14 @@ onScopeDispose(reset)
|
||||
<!-- 以下是指定诊断的只读修订条件与历史记录,普通列表不暴露内部编号 -->
|
||||
<div class="diagnosis-shot-tools">
|
||||
<NButton size="small" :aria-label="showDetails ? '收起修订条件与历史' : '修订条件与诊断历史'" :title="showDetails ? '收起修订条件与历史' : '修订条件与诊断历史'" :aria-expanded="showDetails" @click="expanded = showDetails ? [] : ['review']"><template #icon><History :size="15" aria-hidden="true" /></template><span class="diagnosis-action-label">{{ showDetails ? '收起修订条件与历史' : '修订条件与诊断历史' }}</span></NButton>
|
||||
<!-- 以下是与定位、复查和历史入口同排的刷新操作,不在展开正文另起一组工具。 -->
|
||||
<NButton v-if="showDetails" size="small" :loading="loading" @click="load"><template #icon><RefreshCw :size="14" aria-hidden="true" /></template>刷新记录</NButton>
|
||||
<NCollapse v-show="showDetails" v-model:expanded-names="expanded" class="diagnosis-shot-details">
|
||||
<NCollapseItem name="review" title="修订条件与诊断历史">
|
||||
<div class="space-y-3 text-xs leading-6">
|
||||
<NButton size="small" :loading="loading" @click="load"><template #icon><RefreshCw :size="14" aria-hidden="true" /></template>刷新记录</NButton>
|
||||
<p v-if="error" class="text-danger" role="alert">{{ error }}</p>
|
||||
<p v-if="loading" role="status" class="text-muted">正在核对当前镜头记录…</p>
|
||||
<p v-else-if="noRecords" class="text-muted">暂无修订或 AI 诊断记录。</p>
|
||||
<section v-if="readiness" class="space-y-2" aria-label="当前诊断修订条件">
|
||||
<p>{{ repairEligible ? '已满足人工修订的前提,仍需人工核对完整动作。' : '当前暂不能按这份诊断修订镜头。' }}</p>
|
||||
<p v-for="reason in readiness.blockingReasons" :key="reason" class="text-muted">{{ diagnosisReason(reason) }}</p>
|
||||
@@ -91,13 +96,12 @@ onScopeDispose(reset)
|
||||
<p>阶段 {{ candidate.phaseNo }} · {{ candidate.characterRef }}</p><p>{{ userFacingText(candidate.suggestion) }}</p>
|
||||
</article>
|
||||
</section>
|
||||
<section v-if="revisions" class="space-y-3" aria-label="正式修订历史">
|
||||
<section v-if="revisions?.revisions.length" class="space-y-3" aria-label="正式修订历史">
|
||||
<p class="font-medium">正式修订 · {{ revisions.count }} 条</p>
|
||||
<p v-if="!revisions.revisions.length" class="text-muted">尚无保存的正式修订。</p>
|
||||
<article v-for="record in revisions.revisions" :key="record.id" class="space-y-1"><p class="text-muted">{{ formatDate(record.createdAt) }}</p><p>{{ record.reason }}</p></article>
|
||||
</section>
|
||||
<section v-if="history" class="space-y-3" aria-label="诊断历史">
|
||||
<p v-if="!history.revisions.length" class="text-muted">尚无保存的诊断记录。</p>
|
||||
<section v-if="history?.revisions.length" class="space-y-3" aria-label="诊断历史">
|
||||
<p class="font-medium">AI 诊断 · {{ history.count }} 条</p>
|
||||
<article v-for="record in history.revisions" :key="record.id" class="space-y-1">
|
||||
<p>{{ formatDate(record.createdAt) }} · {{ diagnosisStatusLabels[record.effectiveStatus as keyof typeof diagnosisStatusLabels] || '结果待核对' }}</p>
|
||||
<p class="text-muted">{{ record.shotStale ? '镜头已变化' : '镜头内容一致' }} · {{ record.policyStatus === 'current' ? '规则版本一致' : record.policyStatus === 'stale' ? '规则版本已变化' : '缺少规则版本' }}</p>
|
||||
@@ -116,5 +120,7 @@ onScopeDispose(reset)
|
||||
/* 展开仍由 Naive 组件管理;入口使用独立可聚焦按钮,避免重复折叠标题。 */
|
||||
.diagnosis-shot-details { flex-basis: 100%; min-width: 0; }
|
||||
.diagnosis-shot-details :deep(.n-collapse-item__header) { display: none; }
|
||||
.diagnosis-shot-details :deep(.n-collapse-item__content-wrapper) { padding-top: 16px; }
|
||||
/* 隐藏默认折叠标题后清除两层顶部留白,正文与卡片操作共用间距。 */
|
||||
.diagnosis-shot-details :deep(.n-collapse-item__content-wrapper),
|
||||
.diagnosis-shot-details :deep(.n-collapse-item__content-inner) { padding-top: 0; }
|
||||
</style>
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { computed, inject, onScopeDispose, ref, watch } from 'vue'
|
||||
import { NButton, NCollapse, NCollapseItem, NInputNumber, NSelect, NSpin, NTag } from 'naive-ui'
|
||||
import { RefreshCw, ScanLine, MapPin, RotateCcw, Wrench } from '@lucide/vue'
|
||||
import { RefreshCw, ScanLine, MapPin, RotateCcw, Wrench, CircleCheck, CircleAlert } from '@lucide/vue'
|
||||
import { breakdownApi } from '../api'
|
||||
import { diagnosisInput, diagnosisStatusLabels, scopeDiagnosisShots, summarizeDiagnosis, diagnosisHasAttention, diagnosisCanStart, diagnosisReason, handAuditLabels, resourceAuditLabels, bodyDimensionLabels } from '../diagnosis'
|
||||
import { diagnosisInput, diagnosisStatusLabels, scopeDiagnosisShots, summarizeDiagnosis, diagnosisHasAttention, diagnosisOptionalReview, diagnosisAuditLabel, diagnosisAuditHasProblem, diagnosisCanStart, diagnosisReason, bodyDimensionLabels } from '../diagnosis'
|
||||
import type { DiagnosisLocation, DiagnosisScope } from '../diagnosis'
|
||||
import type {
|
||||
LegacyActionDiagnosisPreview,
|
||||
@@ -22,6 +22,7 @@ import DiagnosisShotDetails from './DiagnosisShotDetails.vue'
|
||||
import type { DiagnosisPreflight } from '../diagnosis.types'
|
||||
import { userFacingText } from '../../../lib/user-facing-text'
|
||||
import { errorMessage } from '../../../lib/http'
|
||||
import { projectContextKey } from '../../projects/context'
|
||||
|
||||
/** 当前分镜上下文;诊断入口与列表共用同一个正式剧集。 */
|
||||
const props = defineProps<{
|
||||
@@ -33,9 +34,13 @@ const props = defineProps<{
|
||||
episodeNos: number[]
|
||||
}>()
|
||||
/** 关闭弹窗后定位对应镜头或节拍。 */
|
||||
const emit = defineEmits<{ locate: [location: DiagnosisLocation] }>()
|
||||
const emit = defineEmits<{ locate: [location: DiagnosisLocation, problem: boolean] }>()
|
||||
/** 统一操作消息层。 */
|
||||
const message = useActionMessage()
|
||||
/** 复用项目当前阶段接口核对整体审核,独立使用诊断组件时不猜测审核已通过。 */
|
||||
const projectContext = inject(projectContextKey, null)
|
||||
/** 本次刷新得到的整体审核状态;未知时不展示已通过。 */
|
||||
const reviewed = ref<boolean | null>(null)
|
||||
/** 任务观察独立于弹窗显隐,关闭弹窗后继续跟踪真实进度。 */
|
||||
const execution = useWorkflowExecution(
|
||||
computed(() => props.projectId),
|
||||
@@ -46,7 +51,7 @@ const dialogOpen = ref(false)
|
||||
/** 首批诊断数据完成前保留固定加载区域,不渲染会闪现的空结果。 */
|
||||
const dialogDataReady = ref(false)
|
||||
/** 等待弹窗离场后再转移焦点,避免焦点陷阱把定位焦点拉回。 */
|
||||
const pendingLocation = ref<DiagnosisLocation | null>(null)
|
||||
const pendingLocation = ref<{ /** 正式镜头坐标。 */ location: DiagnosisLocation; /** 当前有明确问题。 */ problem: boolean } | null>(null)
|
||||
/** 等诊断抽屉离场后打开正式动作修订,不叠加主界面。 */
|
||||
const pendingRepair = ref<PreparationIssue | null>(null)
|
||||
/** 已交接到正式修订的真实目标。 */
|
||||
@@ -79,8 +84,8 @@ const previewError = ref('')
|
||||
const concurrency = ref(3)
|
||||
/** 批量任务的启动状态。 */
|
||||
const starting = ref(false)
|
||||
/** 结果列表默认聚焦冲突、异常和过期,未诊断记录按需查看。 */
|
||||
const resultFilter = ref<'attention' | 'pending' | 'all'>('attention')
|
||||
/** 实际问题与可选复查分别查看,默认只显示有明确问题的镜头。 */
|
||||
const resultFilter = ref<'attention' | 'review' | 'all'>('attention')
|
||||
/** 项目级结构化动作证据校验,明确区别于当前集 AI 诊断。 */
|
||||
const handDiagnostics = ref<StoryboardHandOccupancyDiagnostics | null>(null)
|
||||
/** 项目级校验的读取状态。 */
|
||||
@@ -127,16 +132,34 @@ const summaryCounts = computed(() => (episodeResults.value ? summarizeDiagnosis(
|
||||
const scopedShots = computed(() => scopeDiagnosisShots(results.value?.shots ?? [], scope.value))
|
||||
/** 当前范围的状态计数。 */
|
||||
const counts = computed(() => summarizeDiagnosis(scopedShots.value))
|
||||
/** 可选复查不会增加实际需要修复的数量。 */
|
||||
const optionalReviewCount = computed(() => scopedShots.value.filter(diagnosisOptionalReview).length)
|
||||
/** 当前真实问题数独立于历史 AI 状态统计。 */
|
||||
const repairCount = computed(() => scopedShots.value.filter(diagnosisHasAttention).length)
|
||||
/** 按状态筛选的结果记录。 */
|
||||
const visibleShots = computed(() =>
|
||||
scopedShots.value.filter(
|
||||
shot =>
|
||||
resultFilter.value === 'all' ||
|
||||
(resultFilter.value === 'pending'
|
||||
? shot.status === 'not_diagnosed'
|
||||
(resultFilter.value === 'review'
|
||||
? diagnosisOptionalReview(shot)
|
||||
: diagnosisHasAttention(shot))
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* 更新共享的正式阶段状态;该请求失败仅使审核状态未知,不清空已有诊断或推测通过。
|
||||
* @param projectId 本次查询所属项目
|
||||
* @returns 当前整体审核是否通过,未知时为空
|
||||
*/
|
||||
async function readCurrentReview(projectId: string): Promise<boolean | null> {
|
||||
if (!projectContext) return null
|
||||
try {
|
||||
await projectContext.refreshStageReadiness()
|
||||
const state = projectContext.stageReadiness.value
|
||||
return state?.projectId === projectId ? state.breakdown.ready === true : null
|
||||
} catch { return null }
|
||||
}
|
||||
/** 预览展示范围内的实际镜头总数,不把待补证据数量冒充付费数量。 */
|
||||
const previewCount = computed(() => previews.value?.reduce((sum, item) => sum + item.candidateCount, 0) ?? 0)
|
||||
/** 并发参数限制与后端请求契约一致。 */
|
||||
@@ -161,16 +184,26 @@ const confirmation = computed(
|
||||
() =>
|
||||
`${scopeLabel.value},范围内共 ${previewCount.value} 个镜头,并发 ${concurrency.value}。会产生模型费用,已有当前版本有效诊断的镜头将跳过;仅保存诊断记录,不修改镜头。`
|
||||
)
|
||||
/** 顶部只显示当前集覆盖情况,未取得结果时不推断为安全或未诊断。 */
|
||||
/** 当前正式检查结果复用导航的权威状态,不使用独立 AI 记录数量推测审核结论。 */
|
||||
const formalReviewState = computed(() => {
|
||||
const state = projectContext?.stageReadiness.value
|
||||
if (projectContext?.error.value || projectContext?.project.value?.id !== props.projectId || state?.projectId !== props.projectId) return null
|
||||
return state.breakdown.ready === true
|
||||
})
|
||||
/** 顶部优先显示实际问题与正式审核结果,独立 AI 记录仅使用中性的可选检查说明。 */
|
||||
const summaryText = computed(() => {
|
||||
const value = summaryCounts.value
|
||||
if (!props.episodeNo) return '尚无可诊断的剧集'
|
||||
if (summaryBusy.value) return '正在读取诊断记录…'
|
||||
if (summaryError.value) return '诊断记录读取失败'
|
||||
if (!value) return '尚未读取诊断记录'
|
||||
const problemCount = episodeResults.value?.shots.filter(diagnosisHasAttention).length ?? 0
|
||||
if (problemCount) return `${problemCount} 个镜头有实际问题待处理`
|
||||
if (formalReviewState.value === true) return '分镜校验与审核已通过 · AI 复查可选'
|
||||
if (formalReviewState.value === false) return '正式分镜检查待确认,请查看制作前检查'
|
||||
if (summaryBusy.value) return '正在读取可选 AI 复查记录…'
|
||||
if (summaryError.value) return '可选 AI 复查记录暂时无法读取'
|
||||
if (!value) return '尚未读取可选 AI 复查记录'
|
||||
if (!value.total) return '本集尚无可诊断镜头'
|
||||
if (value.pending === value.total) return `${value.total} 个镜头尚未诊断`
|
||||
return `共 ${value.total} 镜 · 已发现冲突 ${value.conflict} · 待诊断 ${value.pending} · 证据不足/无效 ${value.insufficient + value.invalid} · 已过期 ${value.stale} · 未发现冲突 ${value.clear}`
|
||||
if (value.pending === value.total) return `可选 AI 复查:${value.total} 个镜头暂无已保存记录`
|
||||
return `可选 AI 复查:当前版本记录 ${value.conflict + value.clear + value.insufficient + value.invalid} 镜 · 旧记录 ${value.stale} 镜 · 暂无记录 ${value.pending} 镜`
|
||||
})
|
||||
|
||||
/** 读取当前集摘要,切换剧集后丢弃旧结果,不增加后台轮询。 */
|
||||
@@ -203,12 +236,13 @@ async function loadResults() {
|
||||
resultsBusy.value = true
|
||||
resultsError.value = ''
|
||||
try {
|
||||
const data = await breakdownApi.legacyActionDiagnosisResults(
|
||||
id,
|
||||
target.kind === 'project' ? undefined : target.episodeNo
|
||||
)
|
||||
const [data, currentReview] = await Promise.all([
|
||||
breakdownApi.legacyActionDiagnosisResults(id, target.kind === 'project' ? undefined : target.episodeNo),
|
||||
readCurrentReview(id)
|
||||
])
|
||||
if (version !== resultsVersion) return
|
||||
results.value = data
|
||||
reviewed.value = currentReview
|
||||
if (target.kind !== 'project' && target.episodeNo === props.episodeNo) {
|
||||
++summaryVersion
|
||||
summaryBusy.value = false
|
||||
@@ -357,16 +391,17 @@ function open(location?: DiagnosisLocation) {
|
||||
|
||||
/**
|
||||
* 关闭弹窗后通知列表定位,保留当前任务观察。
|
||||
* @param location 待定位的镜头或节拍
|
||||
* @param location 待定位的真实镜头或节拍坐标
|
||||
* @param problem 是否存在当前明确的问题
|
||||
*/
|
||||
function locate(location: DiagnosisLocation) {
|
||||
pendingLocation.value = location
|
||||
function locate(location: DiagnosisLocation, problem = false) {
|
||||
pendingLocation.value = { location: { episodeNo: location.episodeNo, beatNo: location.beatNo, shotNo: location.shotNo }, problem }
|
||||
dialogOpen.value = false
|
||||
}
|
||||
|
||||
/** 弹窗关闭动画结束后定位镜头,键盘焦点与正文高亮保持一致。 */
|
||||
function finishLocate() {
|
||||
if (pendingLocation.value) { const location = pendingLocation.value; pendingLocation.value = null; emit('locate', location) }
|
||||
if (pendingLocation.value) { const target = pendingLocation.value; pendingLocation.value = null; emit('locate', target.location, target.problem) }
|
||||
if (pendingRepair.value) { repairTarget.value = pendingRepair.value; pendingRepair.value = null; repairOpen.value = true }
|
||||
}
|
||||
|
||||
@@ -456,6 +491,7 @@ watch(
|
||||
previewBusy.value = false
|
||||
previewError.value = ''
|
||||
results.value = null
|
||||
reviewed.value = null
|
||||
resultsBusy.value = false
|
||||
resultsError.value = ''
|
||||
resultFilter.value = 'attention'
|
||||
@@ -503,7 +539,7 @@ defineExpose({ open })
|
||||
>
|
||||
<NTag v-if="execution.active.value" type="info" size="small" :bordered="false">诊断中</NTag>
|
||||
</div>
|
||||
<NButton size="small" :disabled="!projectId" aria-haspopup="dialog" :aria-expanded="dialogOpen" @click="open()"
|
||||
<NButton text size="small" class="diagnosis-summary-trigger" :disabled="!projectId" aria-haspopup="dialog" :aria-expanded="dialogOpen" @click="open()"
|
||||
>查看诊断</NButton
|
||||
>
|
||||
</div>
|
||||
@@ -519,8 +555,8 @@ defineExpose({ open })
|
||||
<!-- 首批数据加载期间仅显示遮罩,避免先显示零计数或空结果再跳变 -->
|
||||
<div v-if="dialogDataReady" class="diagnosis-dialog-content">
|
||||
<!-- 以下是当前范围模块,剧集编号始终与阅读列表一致 -->
|
||||
<section class="diagnosis-section">
|
||||
<h3>诊断范围</h3>
|
||||
<section class="diagnosis-section diagnosis-scope-bar" aria-label="诊断范围">
|
||||
<div class="diagnosis-scope-heading"><h3>诊断范围</h3><span class="text-xs text-muted">{{ scopeLabel }}</span></div>
|
||||
<div class="diagnosis-scope-controls">
|
||||
<NButton
|
||||
size="small"
|
||||
@@ -536,12 +572,14 @@ defineExpose({ open })
|
||||
>全项目</NButton
|
||||
>
|
||||
</div>
|
||||
<p class="diagnosis-scope-label">{{ scopeLabel }}</p>
|
||||
</section>
|
||||
<!-- 以下是上下排列的检查结果与可选复查,两个区域统一底色与内边距 -->
|
||||
<div class="diagnosis-workspace">
|
||||
<div class="diagnosis-results-column">
|
||||
<!-- 以下是诊断结果模块,默认隐藏未诊断长列表 -->
|
||||
<section class="diagnosis-section">
|
||||
<div class="diagnosis-section-heading">
|
||||
<h3>诊断结果</h3>
|
||||
<h3>检查结果</h3>
|
||||
<!-- 刷新图标始终占位,加载前后按钮和标题行保持同一尺寸 -->
|
||||
<NButton
|
||||
text
|
||||
@@ -556,45 +594,44 @@ defineExpose({ open })
|
||||
</div>
|
||||
<p v-if="resultsError" class="text-danger" role="alert">{{ resultsError }}</p>
|
||||
<template v-else-if="results">
|
||||
<div class="diagnosis-counts">
|
||||
<span>范围内 {{ counts.total }} 镜</span
|
||||
><span :class="{ 'text-danger': counts.conflict }">冲突 {{ counts.conflict }}</span>
|
||||
<span>证据不足 {{ counts.insufficient }}</span
|
||||
><span>证据无效 {{ counts.invalid }}</span
|
||||
><span>已过期 {{ counts.stale }}</span> <span>未诊断 {{ counts.pending }}</span
|
||||
><span>未发现冲突 {{ counts.clear }}</span>
|
||||
<!-- 以下是面向日常操作的结论摘要,正式审核通过且没有实际问题时使用成功底色 -->
|
||||
<div class="diagnosis-result-overview" :class="{ 'problem-surface': repairCount > 0, 'diagnosis-result-success': reviewed === true && counts.total > 0 && repairCount === 0 }">
|
||||
<CircleAlert v-if="repairCount" :size="20" class="text-danger" aria-hidden="true" />
|
||||
<CircleCheck v-else-if="reviewed === true && counts.total" :size="20" class="text-(--app-success)" aria-hidden="true" />
|
||||
<ScanLine v-else :size="20" class="text-muted" aria-hidden="true" />
|
||||
<div class="min-w-0 space-y-1">
|
||||
<p class="font-medium">{{ !counts.total ? '当前范围尚无镜头' : repairCount ? `有 ${repairCount} 个镜头需要处理` : '当前范围没有需要修复的镜头' }}</p>
|
||||
<p class="text-xs text-muted">{{ scopeLabel }} · 共 {{ counts.total }} 个镜头</p>
|
||||
<p v-if="reviewed === true" class="text-xs text-muted">当前正式分镜已审核通过,AI 复查可按需进行。</p>
|
||||
<p v-else-if="reviewed === false" class="text-xs text-muted">正式分镜检查待确认,请查看制作前检查。</p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mb-3 text-xs text-muted">动作占用检查只核对已有证据,与 AI 复查、整体人工审核分别记录。</p>
|
||||
<div class="diagnosis-results-toolbar">
|
||||
<span class="text-xs text-muted">查看镜头</span>
|
||||
<NSelect
|
||||
v-model:value="resultFilter"
|
||||
aria-label="筛选诊断结果"
|
||||
size="small"
|
||||
class="diagnosis-result-filter"
|
||||
:options="[
|
||||
{ label: '需处理:冲突、证据异常与过期', value: 'attention' },
|
||||
{ label: `未诊断(${counts.pending})`, value: 'pending' },
|
||||
{ label: `需处理:实际问题(${repairCount})`, value: 'attention' },
|
||||
{ label: `可选 AI 复查(${optionalReviewCount})`, value: 'review' },
|
||||
{ label: `全部镜头(${counts.total})`, value: 'all' }
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="!visibleShots.length" class="diagnosis-empty">
|
||||
<p>
|
||||
{{
|
||||
counts.total === 0
|
||||
? '当前范围尚无镜头。'
|
||||
: counts.pending === counts.total
|
||||
? `${counts.pending} 个镜头尚未诊断,暂无法判断冲突情况。`
|
||||
: resultFilter === 'attention'
|
||||
? '当前没有需处理的诊断记录。'
|
||||
: resultFilter === 'attention'
|
||||
? reviewed === true ? '额外检查可按需进行,无需为继续制作重复运行。' : '这里只展示已检出的问题,额外 AI 复查可按需进行。'
|
||||
: resultFilter === 'review'
|
||||
? '当前没有可选复查记录。'
|
||||
: '当前筛选下没有镜头。'
|
||||
}}
|
||||
</p>
|
||||
<NButton
|
||||
v-if="counts.pending && resultFilter !== 'pending'"
|
||||
text
|
||||
size="small"
|
||||
@click="resultFilter = 'pending'"
|
||||
>查看未诊断镜头</NButton
|
||||
>
|
||||
</div>
|
||||
<div
|
||||
v-if="visibleShots.length"
|
||||
@@ -602,7 +639,7 @@ defineExpose({ open })
|
||||
tabindex="0"
|
||||
aria-label="镜头诊断列表"
|
||||
>
|
||||
<article v-for="item in visibleShots" :key="item.shotId" class="diagnosis-result-item" :class="{ 'problem-surface': item.status === 'conflict_found' || item.status === 'invalid_evidence' || item.handAudit?.status === 'conflict_found' || item.handAudit?.status === 'invalid_evidence' }">
|
||||
<article v-for="item in visibleShots" :key="item.shotId" class="diagnosis-result-item" :class="{ 'problem-surface': diagnosisHasAttention(item) }">
|
||||
<div class="diagnosis-section-heading">
|
||||
<span class="text-xs text-muted"
|
||||
>第 {{ item.episodeNo }} 集 / 节拍 {{ item.beatNo }} / 镜头
|
||||
@@ -610,7 +647,7 @@ defineExpose({ open })
|
||||
>
|
||||
<NTag
|
||||
:type="
|
||||
item.status === 'conflict_found'
|
||||
diagnosisHasAttention(item)
|
||||
? 'error'
|
||||
: item.status === 'no_conflict_found' && !diagnosisHasAttention(item)
|
||||
? 'success'
|
||||
@@ -630,15 +667,16 @@ defineExpose({ open })
|
||||
{{ userFacingText(description) }}
|
||||
</p>
|
||||
<!-- 以下是修订状态、局部手部检查与 AI 全身疑点,结论各自保留 -->
|
||||
<p v-if="item.requiresPostRepairDiagnosis" class="text-xs text-muted">镜头已修订,AI 待复查</p>
|
||||
<p v-if="item.repairStatus === 'repaired' && reviewed === true && !diagnosisHasAttention(item)" class="text-xs text-muted">已修订并审核通过,AI 复查可选。</p>
|
||||
<p v-else-if="item.requiresPostRepairDiagnosis" class="text-xs text-muted">镜头已修订,可按需进行 AI 复查。</p>
|
||||
<p v-else-if="item.repairStatus === 'repaired'" class="text-xs text-muted">镜头已修订,已有当前版本 AI 诊断</p>
|
||||
<p v-else-if="item.repairStatus === 'repair_history_stale'" class="text-xs text-muted">此前修订记录已过期</p>
|
||||
<p v-if="item.shotStale" class="text-xs text-muted">镜头内容已变化,旧诊断不作为当前结论。</p>
|
||||
<p v-if="item.policyStatus === 'stale'" class="text-xs text-muted">质量规则已变化,需要重新核对。</p>
|
||||
<p v-else-if="item.policyStatus === 'unknown'" class="text-xs text-muted">旧诊断没有完整的质量规则记录。</p>
|
||||
<div v-if="item.resourceAudit" class="space-y-1 text-xs text-muted"><p>{{ resourceAuditLabels[item.resourceAudit.status] }}<template v-if="item.resourceAudit.expectedActionCount > 0"> · 已覆盖 {{ item.resourceAudit.coveredActionCount }} / {{ item.resourceAudit.expectedActionCount }} 个动作</template></p></div>
|
||||
<div v-else-if="item.handAudit" class="space-y-1 text-xs text-muted">
|
||||
<p>{{ handAuditLabels[item.handAudit.status] }}<template v-if="item.handAudit.expectedActionCount > 0"> · 手部动作证据 {{ item.handAudit.coveredActionCount }} / {{ item.handAudit.expectedActionCount }}</template></p>
|
||||
<div v-if="item.resourceAudit && diagnosisAuditHasProblem(item.resourceAudit)" class="space-y-1 text-xs text-muted"><p>{{ diagnosisAuditLabel(item.resourceAudit) }}<template v-if="item.resourceAudit.expectedActionCount > 0"> · 已覆盖 {{ item.resourceAudit.coveredActionCount }} / {{ item.resourceAudit.expectedActionCount }} 个动作</template></p></div>
|
||||
<div v-else-if="!item.resourceAudit && item.handAudit && diagnosisAuditHasProblem(item.handAudit)" class="space-y-1 text-xs text-muted">
|
||||
<p>{{ diagnosisAuditLabel(item.handAudit, true) }}<template v-if="item.handAudit.expectedActionCount > 0"> · 手部动作证据 {{ item.handAudit.coveredActionCount }} / {{ item.handAudit.expectedActionCount }}</template></p>
|
||||
|
||||
</div>
|
||||
<article v-for="(finding, index) in item.bodyMotionFindings" :key="index" class="space-y-1 text-xs">
|
||||
@@ -647,9 +685,9 @@ defineExpose({ open })
|
||||
</article>
|
||||
<!-- 以下是明确的卡片操作区,按钮有独立底面和图标,不与说明混在一起 -->
|
||||
<div class="diagnosis-card-actions workspace-action-group">
|
||||
<NButton size="small" aria-label="定位镜头" title="定位镜头" @click="locate(item)"><template #icon><MapPin :size="15" aria-hidden="true" /></template><span class="diagnosis-action-label">定位镜头</span></NButton>
|
||||
<NButton v-if="item.requiresPostRepairDiagnosis || item.status === 'stale' || item.status === 'not_diagnosed'" size="small" aria-label="复查本镜头" title="复查本镜头" :disabled="starting || execution.active.value" @click="open(item)"><template #icon><RotateCcw :size="15" aria-hidden="true" /></template><span class="diagnosis-action-label">复查本镜头</span></NButton>
|
||||
<NButton size="small" aria-label="查看并修订动作" title="查看并修订动作" :disabled="starting || execution.active.value" @click="requestRepair(item)"><template #icon><Wrench :size="15" aria-hidden="true" /></template><span class="diagnosis-action-label">查看并修订动作</span></NButton>
|
||||
<NButton size="small" aria-label="定位镜头" title="定位镜头" @click="locate(item, diagnosisHasAttention(item))"><template #icon><MapPin :size="15" aria-hidden="true" /></template><span class="diagnosis-action-label">定位镜头</span></NButton>
|
||||
<NButton v-if="diagnosisOptionalReview(item) || diagnosisHasAttention(item)" size="small" aria-label="可选 AI 复查" title="可选 AI 复查" :disabled="starting || execution.active.value" @click="open(item)"><template #icon><RotateCcw :size="15" aria-hidden="true" /></template><span class="diagnosis-action-label">可选 AI 复查</span></NButton>
|
||||
<NButton v-if="diagnosisHasAttention(item)" size="small" aria-label="查看并修订动作" title="查看并修订动作" :disabled="starting || execution.active.value" @click="requestRepair(item)"><template #icon><Wrench :size="15" aria-hidden="true" /></template><span class="diagnosis-action-label">查看并修订动作</span></NButton>
|
||||
<DiagnosisShotDetails :project-id="projectId" :shot="item" />
|
||||
</div>
|
||||
</article>
|
||||
@@ -657,50 +695,13 @@ defineExpose({ open })
|
||||
</template>
|
||||
<p v-else class="text-muted">{{ resultsBusy ? '正在读取当前范围结果…' : '尚未读取结果' }}</p>
|
||||
</section>
|
||||
<!-- 以下是使用 Naive UI 折叠组件的全项目结构化校验模块,默认收起 -->
|
||||
<section class="diagnosis-section">
|
||||
<NCollapse class="diagnosis-evidence-collapse">
|
||||
<NCollapseItem name="hand-diagnostics">
|
||||
<template #header>
|
||||
<span class="diagnosis-evidence-title">结构化动作校验</span>
|
||||
<span class="ml-2 text-xs text-muted">全项目</span>
|
||||
</template>
|
||||
<!-- 校验刷新放在折叠标题右侧,仅展开时显示,点击不会切换折叠。 -->
|
||||
<template #header-extra="{ collapsed }">
|
||||
<NButton
|
||||
v-if="!collapsed"
|
||||
text
|
||||
size="small"
|
||||
class="diagnosis-refresh-button"
|
||||
:loading="handBusy"
|
||||
@click.stop="loadHandDiagnostics"
|
||||
>
|
||||
<template #icon><RefreshCw :size="14" aria-hidden="true" /></template>
|
||||
刷新校验
|
||||
</NButton>
|
||||
</template>
|
||||
<p class="text-xs text-muted">直接读取已有动作证据,不调用模型</p>
|
||||
<p v-if="handError" class="text-danger" role="alert">{{ handError }}</p>
|
||||
<template v-else-if="handDiagnostics">
|
||||
<p class="mt-2">
|
||||
有效动作证据 {{ handDiagnostics.evidenceShotCount }} /
|
||||
{{ handDiagnostics.shotCount }} 镜
|
||||
</p>
|
||||
<p class="text-muted">
|
||||
{{
|
||||
handDiagnostics.assessment === 'no_shots'
|
||||
? '全项目尚无镜头。'
|
||||
: handDiagnostics.assessment === 'insufficient_evidence'
|
||||
? '证据不足,暂无法判断冲突情况。'
|
||||
: handDiagnostics.assessment === 'partial_evidence'
|
||||
? `部分镜头缺少有效证据;现有证据发现 ${handDiagnostics.warningCount} 项冲突。`
|
||||
: `现有证据发现 ${handDiagnostics.warningCount} 项冲突。`
|
||||
}}
|
||||
</p>
|
||||
<!-- 以下是实际检出的手部冲突,普通区域仅展示明确问题,不因缺少记录提示修复。 -->
|
||||
<section v-if="!handError && handDiagnostics?.diagnostics.length" class="diagnosis-section">
|
||||
<h3>动作检查发现的问题 · 全项目</h3>
|
||||
<article
|
||||
v-for="(issue, index) in handDiagnostics.diagnostics"
|
||||
:key="index"
|
||||
class="diagnosis-result-item mt-3"
|
||||
class="diagnosis-result-item problem-surface mt-3"
|
||||
>
|
||||
<p class="text-xs text-muted">
|
||||
第 {{ issue.episodeNo }} 集 / 节拍 {{ issue.beatNo }} / 镜头
|
||||
@@ -709,7 +710,7 @@ defineExpose({ open })
|
||||
</p>
|
||||
<p>{{ issue.suggestion }}</p>
|
||||
<div class="diagnosis-scope-controls">
|
||||
<NButton text size="small" @click="locate(issue)">定位镜头</NButton>
|
||||
<NButton text size="small" @click="locate(issue, true)">定位镜头</NButton>
|
||||
<NButton
|
||||
text
|
||||
size="small"
|
||||
@@ -730,15 +731,48 @@ defineExpose({ open })
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
<!-- 以下是合并的高级检查详情,全项目覆盖与当前预览均默认收起。 -->
|
||||
<section class="diagnosis-section">
|
||||
<NCollapse class="diagnosis-evidence-collapse" :default-expanded-names="[]">
|
||||
<NCollapseItem name="advanced-checks">
|
||||
<template #header><span class="diagnosis-evidence-title">高级检查详情</span></template>
|
||||
<template #header-extra="{ collapsed }">
|
||||
<NButton v-if="!collapsed" text size="small" class="diagnosis-refresh-button" :loading="handBusy" @click.stop="loadHandDiagnostics">
|
||||
<template #icon><RefreshCw :size="14" aria-hidden="true" /></template>刷新校验
|
||||
</NButton>
|
||||
</template>
|
||||
<p v-else class="text-muted">{{ handBusy ? '正在读取全项目校验…' : '尚未读取校验' }}</p>
|
||||
<!-- 以下是紧凑的记录摘要,仅展示有值的分类,重复解释合并为末尾说明 -->
|
||||
<div class="diagnosis-inspection-details text-xs leading-6">
|
||||
<section v-if="results" class="diagnosis-inspection-row">
|
||||
<h4 class="font-medium">AI 复查记录</h4>
|
||||
<div class="diagnosis-counts">
|
||||
<span>本范围 {{ counts.total }} 镜</span><span v-if="counts.conflict" class="text-danger">发现冲突 {{ counts.conflict }} 镜</span>
|
||||
<span v-if="counts.insufficient">依据不足 {{ counts.insufficient }} 镜</span><span v-if="counts.invalid">依据不可用 {{ counts.invalid }} 镜</span>
|
||||
<span v-if="counts.stale">旧记录 {{ counts.stale }} 镜</span><span v-if="counts.pending">暂无记录 {{ counts.pending }} 镜</span><span v-if="counts.clear">未发现冲突 {{ counts.clear }} 镜</span>
|
||||
</div>
|
||||
</section>
|
||||
<p v-if="handError" class="text-danger" role="alert">{{ handError }}</p>
|
||||
<section class="diagnosis-inspection-row">
|
||||
<h4 class="font-medium">当前复查范围</h4>
|
||||
<div v-if="previews" class="diagnosis-counts">
|
||||
<span>{{ scopeLabel }} · {{ previewCount }} 个镜头</span>
|
||||
<span v-if="previews.some(item => item.invalidSnapshotCount > 0)" class="text-danger">镜头信息无法读取 {{ previews.reduce((sum, item) => sum + item.invalidSnapshotCount, 0) }} 镜</span>
|
||||
</div>
|
||||
<p v-else class="text-muted">尚未预览,可在底部预览范围。</p>
|
||||
</section>
|
||||
<p class="text-muted">仅查看已有记录,不调用 AI;未填写记录不代表镜头有误,也不改变正式审核结果。</p>
|
||||
</div>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
</section>
|
||||
<!-- 以下是诊断配置、预览与费用说明模块,执行操作统一保留在弹窗底栏 -->
|
||||
<section class="diagnosis-section">
|
||||
<h3>启动 AI 诊断</h3>
|
||||
<p class="text-muted mt-2">{{ scopeLabel }} · 已有当前版本有效结果的镜头将跳过。</p>
|
||||
</div>
|
||||
<!-- 以下是与检查结果采用相同背景和内边距的可选复查模块,执行操作统一保留在弹窗底栏 -->
|
||||
<section class="diagnosis-section diagnosis-review-panel" aria-label="可选 AI 复查设置">
|
||||
<div class="diagnosis-section-heading"><h3>AI 复查</h3><NTag size="small" :bordered="false">可选</NTag></div>
|
||||
<p class="diagnosis-review-description text-sm">需要额外检查动作是否合理时,再运行此项。</p>
|
||||
<p class="text-xs text-muted mt-2">已审核的分镜可继续制作,无需重复复查。</p>
|
||||
<div class="diagnosis-review-scope"><span class="text-xs text-muted">本次复查范围</span><p class="font-medium">{{ scopeLabel }}</p><p class="text-xs text-muted">已有当前版本有效结果的镜头将跳过。</p></div>
|
||||
<!-- 以下是使用 Naive UI 折叠组件的高级设置模块,默认收起 -->
|
||||
<NCollapse class="diagnosis-advanced">
|
||||
<NCollapseItem name="advanced-settings">
|
||||
@@ -755,25 +789,19 @@ defineExpose({ open })
|
||||
/></label>
|
||||
</NCollapseItem>
|
||||
</NCollapse>
|
||||
<div v-if="previews" class="diagnosis-preview" aria-live="polite">
|
||||
<p>{{ scopeLabel }} · 范围内 {{ previewCount }} 个镜头</p>
|
||||
<p class="text-xs text-muted">
|
||||
缺少结构化动作证据
|
||||
{{ previews.reduce((sum, item) => sum + item.needsEvidenceCount, 0) }} 镜 · 快照无效
|
||||
{{ previews.reduce((sum, item) => sum + item.invalidSnapshotCount, 0) }} 镜
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="preflight" class="mt-3 space-y-2 text-xs" :class="preflight.errors.length ? 'problem-surface p-4' : 'text-muted'">
|
||||
<div v-if="preflight" class="mt-3 space-y-2 text-xs text-muted">
|
||||
<p v-if="preflight.errors.length">可选 AI 复查暂不可用。这不代表当前镜头需要修复。</p>
|
||||
<p v-if="preflight.existingValid">本镜头已有同版本有效诊断,无需重复调用模型。</p>
|
||||
<p v-for="code in preflight.errors" :key="code">{{ diagnosisReason(code) }}</p>
|
||||
<p v-if="preflight.shouldDiagnose">已完成来源预检查,正式诊断仍会再次核对当前版本。</p>
|
||||
</div>
|
||||
<p v-if="previewError" class="text-danger" role="alert">{{ previewError }}</p>
|
||||
<p class="text-xs text-muted mt-3">AI 诊断会产生模型费用,仅保存诊断记录,不修改镜头。</p>
|
||||
<p class="text-xs text-muted mt-3">AI 复查会产生模型费用,仅保存检查记录,不修改镜头。请先在底部预览范围,再确认启动。</p>
|
||||
<p v-if="execution.active.value" class="text-xs text-muted mt-3">
|
||||
诊断任务进行中,可关闭弹窗继续查看分镜。
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
<!-- 以下是持久化诊断任务进度模块,刷新页面后仍可恢复 -->
|
||||
<WorkflowExecutionPanel
|
||||
v-if="execution.executionId.value"
|
||||
@@ -797,7 +825,7 @@ defineExpose({ open })
|
||||
>{{ previews ? '重新预览范围' : '预览诊断范围' }}</NButton
|
||||
>
|
||||
<ConfirmAction
|
||||
label="启动 AI 诊断"
|
||||
label="启动 AI 复查"
|
||||
:description="confirmation"
|
||||
primary
|
||||
:disabled="!canStart"
|
||||
@@ -822,17 +850,92 @@ defineExpose({ open })
|
||||
.storyboard-diagnosis-summary > .n-button {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
/* 查看入口在所有尺寸使用无底色文字按钮,仍保留足够的点击高度。 */
|
||||
.diagnosis-summary-trigger.n-button {
|
||||
min-height: 34px;
|
||||
padding-inline: 8px;
|
||||
}
|
||||
/* 加载占位保留最低高度,正文可随内容自然增高,最大高度由公共弹窗按视口限制。 */
|
||||
.diagnosis-dialog-body {
|
||||
min-height: 240px;
|
||||
}
|
||||
.diagnosis-dialog-content {
|
||||
display: grid;
|
||||
gap: 24px;
|
||||
gap: var(--app-content-gap);
|
||||
padding-bottom: 4px;
|
||||
}
|
||||
/* 各分区使用主题次级底色和留白区分,移除贯穿弹窗的分隔线。 */
|
||||
/* 检查结果在上、可选复查在下,所有屏幕尺寸都铺满正文可用宽度。 */
|
||||
.diagnosis-workspace {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
align-items: start;
|
||||
gap: var(--app-content-gap);
|
||||
}
|
||||
.diagnosis-results-column {
|
||||
display: grid;
|
||||
gap: var(--app-content-gap);
|
||||
min-width: 0;
|
||||
}
|
||||
/* 上下区域使用一致的容器底色和内边距,标题、结果与辅助检查形成完整分区。 */
|
||||
.diagnosis-results-column,
|
||||
.diagnosis-review-panel {
|
||||
padding: 20px;
|
||||
background: var(--app-subtle);
|
||||
}
|
||||
/* 范围、说明和切换操作合并成一行,避免每个短字段独占一行。 */
|
||||
.diagnosis-scope-bar,
|
||||
.diagnosis-scope-heading {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
.diagnosis-scope-bar {
|
||||
gap: 20px;
|
||||
}
|
||||
.diagnosis-scope-bar .diagnosis-scope-controls {
|
||||
margin-top: 0;
|
||||
}
|
||||
/* 主结论先于记录统计展示,只有真实问题使用错误底色。 */
|
||||
.diagnosis-result-overview {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
margin-top: var(--app-content-gap);
|
||||
}
|
||||
.diagnosis-result-overview.problem-surface {
|
||||
padding: 20px;
|
||||
background: var(--app-danger-soft);
|
||||
}
|
||||
/* 成功摘要仅强调当前审核已通过,沿用公共主题的柔和成功底色。 */
|
||||
.diagnosis-result-overview.diagnosis-result-success {
|
||||
padding: 20px;
|
||||
background: var(--app-success-soft);
|
||||
}
|
||||
.diagnosis-result-overview > svg {
|
||||
flex-shrink: 0;
|
||||
margin-top: 2px;
|
||||
}
|
||||
/* 筛选区上下沿用统一间距,避免下拉框紧贴结论或镜头卡片。 */
|
||||
.diagnosis-results-toolbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-block: var(--app-content-gap);
|
||||
}
|
||||
/* 可选复查首段说明沿用与主结果相同的标题间距。 */
|
||||
.diagnosis-review-description {
|
||||
margin-top: var(--app-content-gap);
|
||||
}
|
||||
.diagnosis-review-scope {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
/* 各分区依靠对齐和留白组织,保持辅助信息不抢占主结论。 */
|
||||
.diagnosis-section {
|
||||
min-width: 0;
|
||||
@apply text-sm leading-6;
|
||||
}
|
||||
.diagnosis-section h3,
|
||||
@@ -840,6 +943,7 @@ defineExpose({ open })
|
||||
@apply font-semibold text-sm;
|
||||
}
|
||||
.diagnosis-section-heading {
|
||||
min-height: 28px;
|
||||
@apply flex items-center justify-between gap-3;
|
||||
}
|
||||
/* 折叠标题与结果标题保持相同行高,展开后出现刷新按钮时不额外撑高标题。 */
|
||||
@@ -857,17 +961,32 @@ defineExpose({ open })
|
||||
.diagnosis-scope-controls {
|
||||
@apply flex flex-wrap items-center gap-2 mt-3;
|
||||
}
|
||||
.diagnosis-scope-label {
|
||||
@apply mt-3 font-medium;
|
||||
}
|
||||
.diagnosis-counts {
|
||||
@apply flex flex-wrap gap-x-4 gap-y-1 mt-3 mb-4 text-xs text-muted;
|
||||
@apply flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted;
|
||||
}
|
||||
/* 高级记录使用标签与数值对齐的紧凑行,窄屏自动将数值换到标签下方。 */
|
||||
.diagnosis-inspection-details {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
}
|
||||
.diagnosis-inspection-row {
|
||||
display: grid;
|
||||
grid-template-columns: 136px minmax(0, 1fr);
|
||||
align-items: start;
|
||||
gap: 8px 16px;
|
||||
}
|
||||
/* 各行统计复用相同列宽与行高,记录数量和后续状态保持上下对齐。 */
|
||||
.diagnosis-inspection-row .diagnosis-counts {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
|
||||
line-height: 24px;
|
||||
}
|
||||
.diagnosis-result-filter {
|
||||
@apply mb-3;
|
||||
width: 280px;
|
||||
max-width: 100%;
|
||||
}
|
||||
.diagnosis-empty {
|
||||
@apply py-4 text-muted;
|
||||
@apply flex flex-wrap items-center gap-3 pb-2 text-xs text-muted;
|
||||
}
|
||||
/* 镜头结果以略浅底色单独成组,不再给每条结果增加边框。 */
|
||||
.diagnosis-result-list {
|
||||
@@ -879,6 +998,7 @@ defineExpose({ open })
|
||||
.diagnosis-result-item.problem-surface {
|
||||
background: var(--app-danger-soft);
|
||||
}
|
||||
/* 卡片操作在所有尺寸保留图标和完整文字,空间不足时按按钮自然换行。 */
|
||||
.diagnosis-card-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
|
||||
.diagnosis-card-actions .n-button { min-height: 34px; }
|
||||
.diagnosis-result-item { padding: 20px; }
|
||||
@@ -895,17 +1015,14 @@ defineExpose({ open })
|
||||
@apply w-28;
|
||||
}
|
||||
/* 预览与修复建议沿用主题灰阶,与所在分区保留清晰层级。 */
|
||||
.diagnosis-preview {
|
||||
@apply bg-(--app-control) p-3 mt-3;
|
||||
}
|
||||
.diagnosis-repair {
|
||||
@apply bg-(--app-surface) p-3 mt-3;
|
||||
}
|
||||
@media (max-width: 639px) {
|
||||
.diagnosis-card-actions .diagnosis-action-label { display: none; }
|
||||
.diagnosis-card-actions .n-button { min-width: 34px; padding-inline: 8px; }
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.diagnosis-inspection-row {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
row-gap: 4px;
|
||||
}
|
||||
.storyboard-diagnosis-summary {
|
||||
@apply items-start;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import ContextNotice from '../../../components/ui/ContextNotice.vue'
|
||||
|
||||
import { NButton, NSelect, NTag } from 'naive-ui'
|
||||
import { computed, nextTick, ref } from 'vue'
|
||||
import { computed, nextTick, ref, watch } from 'vue'
|
||||
import { Clock3 } from '@lucide/vue'
|
||||
import { EmptyState } from '../../../components/ui'
|
||||
import type { EpisodePlan, EpisodeShots } from '../types'
|
||||
@@ -25,6 +25,15 @@ const selected = defineModel<number>('episodeNo')
|
||||
const root = ref<HTMLElement | null>(null)
|
||||
/** 最近定位的镜头或节拍标识,用于保留可见高亮。 */
|
||||
const locatedPosition = ref('')
|
||||
/** 定位来自当前明确的问题时才使用错误底色,普通查看不能推断问题。 */
|
||||
const locatedProblem = ref(false)
|
||||
/** 正文刷新后清除旧定位,避免已修订镜头继续沿用错误标记。 */
|
||||
watch(() => props.episodes, () => { locatedPosition.value = ''; locatedProblem.value = false })
|
||||
/** 定位样式的业务依据,与镜头坐标及诊断请求字段分开。 */
|
||||
interface LocateOptions {
|
||||
/** 是否来自当前实际问题,未提供时使用中性定位。 */
|
||||
problem?: boolean
|
||||
}
|
||||
/** 兼容只有正式镜头而没有单独规划的历史结果。 */
|
||||
const plans = computed(() => (props.plans.length ? props.plans : props.episodes.map(item => item.episodePlan)))
|
||||
/** 选择器与正文统一使用最终规划编号;初次读取或当前剧集被移除时回退到第一集。 */
|
||||
@@ -44,17 +53,19 @@ const purposeLabels: Record<string, string> = {
|
||||
hook: '钩子'
|
||||
}
|
||||
/**
|
||||
* 切换剧集并定位问题镜头,尊重系统减少动画设置。
|
||||
* @param location 问题所在的正式剧集、节拍与镜头坐标
|
||||
* 切换剧集并定位镜头,仅明确问题使用错误提示,尊重系统减少动画设置。
|
||||
* @param location 正式剧集、节拍与镜头坐标
|
||||
* @param options 当前定位是否确有问题
|
||||
* @returns 列表更新并完成定位
|
||||
*/
|
||||
async function locate(location: DiagnosisLocation) {
|
||||
async function locate(location: DiagnosisLocation, options: LocateOptions = {}) {
|
||||
selected.value = location.episodeNo
|
||||
await nextTick()
|
||||
const position = `${location.episodeNo}-${location.beatNo}${location.shotNo === undefined ? '' : `-${location.shotNo}`}`
|
||||
const element = root.value?.querySelector<HTMLElement>(`[data-shot-position="${position}"]`)
|
||||
if (!element) return
|
||||
locatedPosition.value = position
|
||||
locatedProblem.value = options.problem === true
|
||||
element.focus({ preventScroll: true })
|
||||
element.scrollIntoView({
|
||||
block: 'center',
|
||||
@@ -69,9 +80,8 @@ defineExpose({ locate })
|
||||
<div ref="root" class="breakdown-storyboard">
|
||||
<!-- 以下是当前剧集选择与分镜数量模块 -->
|
||||
<div v-if="plan" class="breakdown-storyboard-toolbar">
|
||||
<label v-if="plan" class="breakdown-episode-picker"
|
||||
><span>选择剧集</span
|
||||
><NSelect
|
||||
<div class="breakdown-episode-picker">
|
||||
<NSelect
|
||||
aria-label="选择分镜剧集"
|
||||
:value="plan.episodeNo"
|
||||
@update:value="selected = $event"
|
||||
@@ -82,7 +92,7 @@ defineExpose({ locate })
|
||||
}))
|
||||
"
|
||||
></NSelect
|
||||
></label>
|
||||
></div>
|
||||
<div class="breakdown-storyboard-summary">
|
||||
<span v-if="plan" class="breakdown-storyboard-count"
|
||||
>{{ plan.beats.length }} 个节拍 ·
|
||||
@@ -109,7 +119,7 @@ defineExpose({ locate })
|
||||
class="beat-section"
|
||||
tabindex="-1"
|
||||
:data-shot-position="`${plan.episodeNo}-${beat.beatNo}`"
|
||||
:class="{ 'diagnosis-located': locatedPosition === `${plan.episodeNo}-${beat.beatNo}` }"
|
||||
:class="{ 'diagnosis-located': locatedPosition === `${plan.episodeNo}-${beat.beatNo}`, 'diagnosis-problem-located': locatedProblem && locatedPosition === `${plan.episodeNo}-${beat.beatNo}` }"
|
||||
>
|
||||
<div class="beat-heading">
|
||||
<span class="beat-number">{{ String(beat.beatNo).padStart(2, '0') }}</span>
|
||||
@@ -134,7 +144,8 @@ defineExpose({ locate })
|
||||
tabindex="-1"
|
||||
:data-shot-position="`${plan.episodeNo}-${beat.beatNo}-${shot.shotNo}`"
|
||||
:class="{
|
||||
'diagnosis-located': locatedPosition === `${plan.episodeNo}-${beat.beatNo}-${shot.shotNo}`
|
||||
'diagnosis-located': locatedPosition === `${plan.episodeNo}-${beat.beatNo}-${shot.shotNo}`,
|
||||
'diagnosis-problem-located': locatedProblem && locatedPosition === `${plan.episodeNo}-${beat.beatNo}-${shot.shotNo}`
|
||||
}"
|
||||
>
|
||||
<div class="shot-label">
|
||||
@@ -190,11 +201,14 @@ defineExpose({ locate })
|
||||
<style>
|
||||
/* 本组件专属布局与 Naive 内部结构覆盖。 */
|
||||
@reference "../../../styles/styles.css";
|
||||
/* 问题定位使用柔和红色底面,不改变行高和间距;内部控件保留键盘焦点。 */
|
||||
/* 普通定位仅使用中性底面,明确的问题另用柔和红色,均不改变行高和间距。 */
|
||||
.breakdown-storyboard .diagnosis-located {
|
||||
background: var(--app-danger-soft);
|
||||
background: var(--app-control-hover);
|
||||
outline: none;
|
||||
}
|
||||
.breakdown-storyboard .diagnosis-problem-located {
|
||||
background: var(--app-danger-soft);
|
||||
}
|
||||
.beat-section {
|
||||
@apply mt-[25px] pt-[23px];
|
||||
}
|
||||
@@ -237,19 +251,19 @@ defineExpose({ locate })
|
||||
@apply min-w-0;
|
||||
}
|
||||
.breakdown-storyboard-toolbar {
|
||||
@apply flex items-center justify-between flex-wrap gap-y-3 gap-x-6 mb-4;
|
||||
/* 与主体列表保持一致:选择控件和统计文字靠左相邻排列。 */
|
||||
@apply flex items-center justify-start flex-wrap gap-y-2.5 gap-x-3;
|
||||
margin-bottom: var(--app-content-gap);
|
||||
}
|
||||
.breakdown-episode-picker {
|
||||
@apply flex items-center gap-3 flex-[0_1_420px] min-w-0 text-sm;
|
||||
}
|
||||
.breakdown-episode-picker > span {
|
||||
@apply shrink-0 whitespace-nowrap;
|
||||
/* 下拉框直接展示剧集名称,不再额外占用可见标签的宽度。 */
|
||||
@apply flex flex-[0_1_260px] min-w-0;
|
||||
}
|
||||
.breakdown-episode-picker .n-select {
|
||||
@apply flex-1 min-w-0;
|
||||
}
|
||||
.breakdown-storyboard-summary {
|
||||
@apply flex items-center flex-wrap gap-y-2 gap-x-5 min-h-[34px] ml-auto;
|
||||
@apply flex shrink-0 items-center min-h-[34px];
|
||||
}
|
||||
.breakdown-storyboard-count {
|
||||
@apply text-muted text-xs whitespace-nowrap;
|
||||
@@ -257,4 +271,13 @@ defineExpose({ locate })
|
||||
.breakdown-storyboard-summary .text-button {
|
||||
@apply min-h-[34px] whitespace-nowrap;
|
||||
}
|
||||
@media (max-width: 800px) {
|
||||
/* 手机端与道具搜索行一致,控件自适应剩余宽度,统计文字紧邻显示。 */
|
||||
.breakdown-storyboard-toolbar {
|
||||
@apply flex-nowrap gap-2;
|
||||
}
|
||||
.breakdown-episode-picker {
|
||||
@apply flex-1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -79,7 +79,7 @@ export const diagnosisStatusLabels = {
|
||||
insufficient_evidence: '证据不足',
|
||||
invalid_evidence: '证据无效',
|
||||
stale: '诊断过期',
|
||||
not_diagnosed: '尚未诊断'
|
||||
not_diagnosed: '暂无 AI 复查记录'
|
||||
} as const
|
||||
|
||||
/**
|
||||
@@ -91,8 +91,8 @@ export function diagnosisReason(code: string): string {
|
||||
const labels: Record<string, string> = {
|
||||
QUALITY_POLICY_NOT_CONFIRMED: '请先确认项目质量规则。',
|
||||
QUALITY_POLICY_VERSION_CONFLICT: '质量规则已更新,请重新核对。',
|
||||
QUALITY_POLICY_SNAPSHOT_UNKNOWN: '这份分镜缺少可信的质量规则记录,请先确认规则并重新生成拆解候选。',
|
||||
QUALITY_POLICY_SNAPSHOT_INVALID: '分镜的质量规则记录不完整,请重新生成拆解候选。',
|
||||
QUALITY_POLICY_SNAPSHOT_UNKNOWN: '本次 AI 复查缺少可信的质量规则记录,暂时不能启动。请在制作前检查中核对来源。',
|
||||
QUALITY_POLICY_SNAPSHOT_INVALID: '本次 AI 复查无法使用现有质量规则记录,暂时不能启动。请在制作前检查中核对来源。',
|
||||
QUALITY_POLICY_SNAPSHOT_STALE: '分镜与质量规则版本不一致,请核对最新拆解结果。',
|
||||
STORYBOARD_SOURCE_MISMATCH: '镜头与已提交分镜不一致,请刷新最新结果后核对。'
|
||||
}
|
||||
@@ -116,19 +116,53 @@ export function diagnosisCanStart(value: DiagnosisPreflight | null, projectId: s
|
||||
}
|
||||
|
||||
/**
|
||||
* 待复查和全身疑点即使没有手部冲突,也需要留在默认问题列表。
|
||||
* 仅将当前明确冲突或实时结构化证据问题列为需要修复,过期诊断与未复查不构成修复结论。
|
||||
* @param shot 当前镜头诊断
|
||||
* @returns 是否需要用户关注
|
||||
* @returns 当前镜头是否有明确需要处理的问题
|
||||
*/
|
||||
export function diagnosisHasAttention(shot: LegacyActionDiagnosisResults['shots'][number]): boolean {
|
||||
return !['not_diagnosed', 'no_conflict_found'].includes(shot.status) || shot.requiresPostRepairDiagnosis === true ||
|
||||
!!shot.bodyMotionFindings?.length || !!(shot.resourceAudit ?? shot.handAudit) && ['conflict_found', 'invalid_evidence', 'invalid_snapshot'].includes((shot.resourceAudit ?? shot.handAudit)!.status)
|
||||
const audit = shot.resourceAudit ?? shot.handAudit
|
||||
if (diagnosisAuditHasProblem(audit)) return true
|
||||
const current = shot.status !== 'stale' && shot.shotStale !== true && shot.policyStatus !== 'stale' && shot.policyStatus !== 'unknown'
|
||||
return current && (shot.status === 'conflict_found' || !!shot.bodyMotionFindings?.some(item => item.status === 'conflict'))
|
||||
}
|
||||
|
||||
/**
|
||||
* 区分实时检查中明确的问题和单纯未填写记录,未覆盖不作为错误。
|
||||
* @param audit 当前动作占用检查摘要
|
||||
* @returns 是否存在明确冲突或不可用的结构化信息
|
||||
*/
|
||||
export function diagnosisAuditHasProblem(audit: DiagnosisHandAudit | undefined): boolean {
|
||||
return !!audit && (audit.issueCount > 0 || ['conflict_found', 'invalid_evidence', 'invalid_snapshot'].includes(audit.status))
|
||||
}
|
||||
|
||||
/**
|
||||
* 缺少 AI 记录、旧诊断或不确定建议归为可选复查,不与当前修复问题混在一起。
|
||||
* @param shot 当前镜头诊断及实时证据摘要
|
||||
* @returns 是否可在独立的可选复查列表中查看
|
||||
*/
|
||||
export function diagnosisOptionalReview(shot: LegacyActionDiagnosisResults['shots'][number]): boolean {
|
||||
const audit = shot.resourceAudit ?? shot.handAudit
|
||||
return !diagnosisHasAttention(shot) && (shot.status !== 'no_conflict_found' || shot.requiresPostRepairDiagnosis === true ||
|
||||
!!shot.bodyMotionFindings?.length || !!audit && ['partial_evidence', 'insufficient_evidence'].includes(audit.status))
|
||||
}
|
||||
|
||||
/**
|
||||
* 没有可计算的覆盖范围时只说明尚无结论,不将零动作数描述成新问题。
|
||||
* @param audit 实时动作占用摘要
|
||||
* @param handOnly 是否为旧手部检查
|
||||
* @returns 当前可展示的覆盖结论
|
||||
*/
|
||||
export function diagnosisAuditLabel(audit: DiagnosisHandAudit, handOnly = false): string {
|
||||
if (audit.expectedActionCount === 0 && audit.issueCount === 0 && audit.status === 'insufficient_evidence')
|
||||
return handOnly ? '手部占用检查尚无覆盖结论' : '动作占用检查尚无覆盖结论'
|
||||
return (handOnly ? handAuditLabels : resourceAuditLabels)[audit.status]
|
||||
}
|
||||
|
||||
/** 免费手部检查的结论,不能据此标记 AI 已通过。 */
|
||||
export const handAuditLabels: Record<DiagnosisHandAudit['status'], string> = {
|
||||
insufficient_evidence: '手部证据不足', invalid_snapshot: '镜头记录不完整', invalid_evidence: '手部证据无效',
|
||||
conflict_found: '手部仍有冲突', partial_evidence: '部分动作缺少手部证据', no_conflict_found: '现有手部证据未发现冲突'
|
||||
insufficient_evidence: '手部记录尚未覆盖', invalid_snapshot: '镜头记录不完整', invalid_evidence: '手部证据无效',
|
||||
conflict_found: '手部仍有冲突', partial_evidence: '部分动作尚未覆盖手部检查', no_conflict_found: '现有手部证据未发现冲突'
|
||||
}
|
||||
/** 全身动作维度的中文说明。 */
|
||||
export const bodyDimensionLabels: Record<string, string> = {
|
||||
@@ -138,6 +172,6 @@ export const bodyDimensionLabels: Record<string, string> = {
|
||||
|
||||
/** 通用动作资源结论不冒充覆盖全部剧情语义。 */
|
||||
export const resourceAuditLabels: typeof handAuditLabels = {
|
||||
insufficient_evidence: '动作占用证据不足', invalid_snapshot: '镜头记录不完整', invalid_evidence: '动作占用证据无效',
|
||||
conflict_found: '动作占用仍有冲突', partial_evidence: '部分动作缺少占用证据', no_conflict_found: '现有动作占用证据未发现冲突'
|
||||
insufficient_evidence: '动作记录尚未覆盖', invalid_snapshot: '镜头记录不完整', invalid_evidence: '动作占用证据无效',
|
||||
conflict_found: '动作占用仍有冲突', partial_evidence: '部分动作占用记录尚未覆盖', no_conflict_found: '现有动作占用证据未发现冲突'
|
||||
}
|
||||
@@ -188,7 +188,8 @@ function exportScript() {
|
||||
</div>
|
||||
<NScrollbar v-if="tab !== 'episodes'" class="panel-scroll"
|
||||
><div v-if="tab === 'characters'" class="p-6 lg:p-8">
|
||||
<div v-if="project?.characters.length" class="record-list">
|
||||
<!-- 角色条目自带内边距,抵消列表的重复留白,使内容边界与世界观一致。 -->
|
||||
<div v-if="project?.characters.length" class="record-list -m-5">
|
||||
<article v-for="character in project.characters" :key="character.id">
|
||||
<div class="mb-3 flex items-center gap-3">
|
||||
<h3 class="text-lg font-semibold">{{ character.name }}</h3>
|
||||
|
||||
@@ -32,7 +32,7 @@ const paragraphs = [
|
||||
<!-- 以下是剧本内容标签与导出按钮占位模块 -->
|
||||
<div class="drama-skeleton-tabs">
|
||||
<NSkeleton v-for="(width, tab) in [56, 56, 48, 56]" :key="tab" :width="width" :height="14" />
|
||||
<NSkeleton class="drama-skeleton-action" :width="40" :height="40" />
|
||||
<NSkeleton class="drama-skeleton-action" />
|
||||
</div>
|
||||
<div class="drama-skeleton-reader panel">
|
||||
<!-- 以下是剧集目录占位模块 -->
|
||||
@@ -97,6 +97,8 @@ const paragraphs = [
|
||||
.drama-skeleton-action {
|
||||
/* 对齐方形导出图标按钮,右侧不添加额外留白。 */
|
||||
@apply ml-auto shrink-0;
|
||||
width: var(--app-toolbar-icon-size, 40px);
|
||||
height: var(--app-toolbar-icon-size, 40px);
|
||||
}
|
||||
.drama-skeleton-reader {
|
||||
@apply grid grid-cols-[clamp(190px,_22%,_240px)_minmax(0,_1fr)] flex-1 min-h-0 overflow-hidden;
|
||||
@@ -115,7 +117,7 @@ const paragraphs = [
|
||||
}
|
||||
.drama-skeleton-directory-heading {
|
||||
/* 占位标题与剧集条目使用同一左侧对齐线。 */
|
||||
@apply flex items-center justify-between gap-2 pt-[22px] px-3.5 pb-3.5;
|
||||
@apply flex items-center justify-between gap-2 pt-6 lg:pt-8 px-3.5 pb-3.5;
|
||||
}
|
||||
.drama-skeleton-episode {
|
||||
@apply flex flex-col justify-center gap-2 min-h-16 py-3 px-3.5 mb-1.5;
|
||||
@@ -137,7 +139,7 @@ const paragraphs = [
|
||||
@apply p-8 max-w-[900px];
|
||||
}
|
||||
.drama-skeleton-chapter-heading {
|
||||
@apply flex flex-col gap-3 pt-3.5 pb-[18px] mb-6;
|
||||
@apply flex flex-col gap-3 pb-[18px] mb-6;
|
||||
}
|
||||
.drama-skeleton-summary {
|
||||
@apply flex flex-col gap-3 pt-[17px] pb-[22px] mb-[23px];
|
||||
@@ -145,6 +147,12 @@ const paragraphs = [
|
||||
.drama-skeleton-paragraph {
|
||||
@apply flex flex-col gap-4 mb-7;
|
||||
}
|
||||
@media (max-width: 1023px) {
|
||||
/* 与刚统一的正文、角色设定和世界观使用相同内容留白。 */
|
||||
.drama-skeleton-content {
|
||||
@apply p-6;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1000px) {
|
||||
.drama-skeleton-reader {
|
||||
@apply grid-cols-[180px_minmax(0,_1fr)];
|
||||
@@ -164,11 +172,8 @@ const paragraphs = [
|
||||
@apply flex items-center justify-between min-h-11 shrink-0 px-3 bg-(--app-subtle);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
.drama-skeleton-content {
|
||||
@apply px-[18px] py-3;
|
||||
}
|
||||
.drama-skeleton-chapter-heading {
|
||||
@apply gap-1 py-2 mb-3;
|
||||
@apply gap-1 pb-2 mb-3;
|
||||
}
|
||||
.drama-skeleton-summary {
|
||||
@apply pt-0 pb-4 mb-4;
|
||||
|
||||
@@ -326,7 +326,7 @@ onBeforeUnmount(() => observer?.disconnect())
|
||||
}
|
||||
.reader-directory-heading {
|
||||
/* 目录标题与剧集条目统一左侧留白。 */
|
||||
@apply flex justify-between items-center shrink-0 gap-2 pt-[22px] px-3.5 pb-3.5 text-[13px];
|
||||
@apply flex justify-between items-center shrink-0 gap-2 pt-6 lg:pt-8 px-3.5 pb-3.5 text-[13px];
|
||||
}
|
||||
.reader-directory-heading h3 {
|
||||
@apply font-semibold;
|
||||
@@ -398,12 +398,13 @@ onBeforeUnmount(() => observer?.disconnect())
|
||||
}
|
||||
.reader-chapter:last-child {
|
||||
/* 末集较短时仍可定位到阅读线,不必把倒数第二集误认为当前集。 */
|
||||
min-height: max(160px, calc(var(--reader-height) - 64px));
|
||||
min-height: max(160px, calc(var(--reader-height) - var(--reader-gutter) - var(--reader-gutter)));
|
||||
}
|
||||
.reader-chapter-heading {
|
||||
@apply sticky top-0 z-[2] mb-6 bg-(--reader-background);
|
||||
margin-inline: calc(var(--reader-gutter) * -1);
|
||||
padding: 14px var(--reader-gutter) 18px;
|
||||
/* 顶部留白由正文容器统一提供,避免与世界观、角色设定相比重复叠加。 */
|
||||
padding: 0 var(--reader-gutter) 18px;
|
||||
}
|
||||
.reader-chapter-heading p {
|
||||
@apply text-muted text-[13px] font-medium mb-2.5;
|
||||
@@ -411,6 +412,28 @@ onBeforeUnmount(() => observer?.disconnect())
|
||||
.reader-chapter-heading h2 {
|
||||
@apply text-[clamp(18px,2cqw,24px)] font-semibold leading-[1.6] wrap-anywhere;
|
||||
}
|
||||
@media (min-width: 801px) {
|
||||
/* PC 吸顶时保留与目录标题一致的顶部留白,正文从遮挡层后滚过。 */
|
||||
.reader-chapter-heading {
|
||||
top: var(--reader-gutter);
|
||||
}
|
||||
.reader-chapter-heading::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset-inline: 0;
|
||||
top: calc(var(--reader-gutter) * -1);
|
||||
height: var(--reader-gutter);
|
||||
background: var(--reader-background);
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1023px) {
|
||||
/* 与角色设定、世界观的 p-6 / lg:p-8 使用相同的响应式内容边界。 */
|
||||
.reader-content {
|
||||
--reader-gutter: 24px;
|
||||
@apply p-6;
|
||||
}
|
||||
}
|
||||
@media (max-width: 1000px) {
|
||||
.episode-reader {
|
||||
@apply grid-cols-[180px_minmax(0,_1fr)];
|
||||
@@ -444,21 +467,12 @@ onBeforeUnmount(() => observer?.disconnect())
|
||||
/* 首集与末集的边界按钮保留禁用行为,并明确以灰色图标显示。 */
|
||||
color: var(--app-disabled-text);
|
||||
}
|
||||
.reader-content {
|
||||
--reader-gutter: 18px;
|
||||
/* 缩小手机阅读顶部留白,保持左右文字间距。 */
|
||||
@apply px-[18px] py-3;
|
||||
}
|
||||
.reader-chapter + .reader-chapter {
|
||||
@apply mt-8 pt-0;
|
||||
}
|
||||
.reader-chapter:last-child {
|
||||
/* 与手机正文上下 12px 留白配合,短末集仍能定位到阅读线。 */
|
||||
min-height: max(160px, calc(var(--reader-height) - 24px));
|
||||
}
|
||||
.reader-chapter-heading {
|
||||
@apply mb-3;
|
||||
padding-block: 8px;
|
||||
padding-block: 0 8px;
|
||||
}
|
||||
.reader-chapter-heading p {
|
||||
@apply mb-1;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import ContextNotice from '../../components/ui/ContextNotice.vue'
|
||||
import WorkspaceActionTooltip from '../../components/ui/WorkspaceActionTooltip.vue'
|
||||
|
||||
import { computed, h, inject, onScopeDispose, provide, ref, watch, watchEffect } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { Settings2 } from '@lucide/vue'
|
||||
import { NScrollbar, NButton, NPageHeader, NSpin, NEllipsis } from 'naive-ui'
|
||||
import { NScrollbar, NButton, NPageHeader, NSpin, NEllipsis, NSkeleton } from 'naive-ui'
|
||||
import { EmptyState, WorkspaceRefreshButton } from '../../components/ui'
|
||||
import { projectContextKey, useProjectData } from './context'
|
||||
import { getOperation, operationErrorText } from '../workflows/operations'
|
||||
@@ -256,20 +257,29 @@ onScopeDispose(() => {
|
||||
<template>
|
||||
<section class="project-frame">
|
||||
<header class="project-header">
|
||||
<!-- 以下是项目标题与全局配置入口模块,读取完成前标题留空 -->
|
||||
<!-- 以下是项目标题与全局配置入口模块,首次读取保留标题及两个操作的真实占位 -->
|
||||
<NPageHeader @back="router.push('/projects')">
|
||||
<template #title>
|
||||
<NEllipsis class="project-title" :tooltip="false">{{
|
||||
<div v-if="isProjectInitialLoading" class="project-title project-title-loading" aria-hidden="true"><NSkeleton :height="16" /></div>
|
||||
<NEllipsis v-else class="project-title" :tooltip="false">{{
|
||||
context.project.value?.title || context.project.value?.topic || ''
|
||||
}}</NEllipsis>
|
||||
</template>
|
||||
<template #extra>
|
||||
<!-- 以下是制作前检查入口,后续页面受限时仍可完成正式分镜审核 -->
|
||||
<div class="flex items-center gap-2">
|
||||
<StoryboardPreparation v-if="context.project.value?.id === id" :key="id" :project-id="id" :disabled="!!context.error.value" @changed="context.refresh()" />
|
||||
<NButton class="workspace-action-button" size="small" aria-label="项目配置" title="项目配置" :disabled="!context.project.value" @click="settingsOpen = true"
|
||||
><template #icon><Settings2 :size="15" aria-hidden="true" /></template><span class="project-config-label">项目配置</span></NButton
|
||||
>
|
||||
<div class="project-header-actions flex items-center gap-2">
|
||||
<template v-if="isProjectInitialLoading">
|
||||
<NSkeleton class="project-header-action-placeholder" aria-hidden="true" />
|
||||
<NSkeleton class="project-header-action-placeholder project-header-config-placeholder" aria-hidden="true" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<StoryboardPreparation v-if="context.project.value?.id === id" :key="id" :project-id="id" :disabled="!!context.error.value" @changed="context.refresh()" />
|
||||
<WorkspaceActionTooltip label="项目配置" mobile-only>
|
||||
<NButton class="workspace-action-button" size="small" aria-label="项目配置" :disabled="!context.project.value" @click="settingsOpen = true"
|
||||
><template #icon><Settings2 :size="15" aria-hidden="true" /></template><span class="project-config-label">项目配置</span></NButton
|
||||
>
|
||||
</WorkspaceActionTooltip>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</NPageHeader>
|
||||
@@ -348,6 +358,21 @@ onScopeDispose(() => {
|
||||
.project-title {
|
||||
@apply block max-w-full text-base font-semibold leading-normal;
|
||||
}
|
||||
/* 首次读取只显示装饰性骨架,不展示未知项目名称或可点击的设置入口。 */
|
||||
.project-title-loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: min(128px, 30vw);
|
||||
min-height: 1.5em;
|
||||
}
|
||||
.project-header-action-placeholder {
|
||||
width: 120px;
|
||||
height: 34px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.project-header-config-placeholder {
|
||||
width: 104px;
|
||||
}
|
||||
.project-notices.n-scrollbar {
|
||||
@apply shrink-0 h-auto max-h-[min(24dvh,160px)] overflow-hidden;
|
||||
}
|
||||
@@ -382,6 +407,33 @@ onScopeDispose(() => {
|
||||
@apply items-start flex-col gap-2;
|
||||
}
|
||||
}
|
||||
/* 手机端隐藏文字后,两个项目入口共用方形点击区域并将图标居中。 */
|
||||
@media (max-width: 639px) {
|
||||
.project-frame {
|
||||
/* 顶部入口与标签栏图标共用紧凑尺寸。 */
|
||||
--app-toolbar-icon-size: 32px;
|
||||
}
|
||||
.project-header-actions > .n-button.workspace-action-button {
|
||||
width: var(--app-toolbar-icon-size);
|
||||
min-width: var(--app-toolbar-icon-size);
|
||||
height: var(--app-toolbar-icon-size);
|
||||
min-height: var(--app-toolbar-icon-size);
|
||||
padding: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.project-header-action-placeholder {
|
||||
width: var(--app-toolbar-icon-size);
|
||||
height: var(--app-toolbar-icon-size);
|
||||
}
|
||||
.project-header-actions > .n-button .n-button__icon {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.project-header .n-skeleton {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -3,6 +3,7 @@ import { computed, ref, watch } from 'vue'
|
||||
import { NButton, NCheckbox, NFormItem, NInput, NTag } from 'naive-ui'
|
||||
import { ArrowLeft, CheckCheck, RefreshCw, Save, ShieldCheck, Wrench } from '@lucide/vue'
|
||||
import AppDrawer from '../../components/ui/AppDrawer.vue'
|
||||
import WorkspaceActionTooltip from '../../components/ui/WorkspaceActionTooltip.vue'
|
||||
import WorkspaceSectionHeading from '../../components/ui/WorkspaceSectionHeading.vue'
|
||||
import QualityPolicySettings from '../generation-config/components/QualityPolicySettings.vue'
|
||||
import FormalRepairEditor from './FormalRepairEditor.vue'
|
||||
@@ -147,8 +148,10 @@ async function repaired() { repairIssue.value = null; repairWriting.value = fals
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- 以下是项目顶部始终可到达的制作前检查入口 -->
|
||||
<NButton size="small" class="preparation-trigger workspace-action-button" :disabled="disabled || !projectId" aria-label="制作前检查" @click="open = true"><template #icon><ShieldCheck :size="15" aria-hidden="true" /></template><span class="preparation-trigger-label">制作前检查</span></NButton>
|
||||
<!-- 以下是项目顶部始终可到达的制作前检查入口及统一悬浮说明 -->
|
||||
<WorkspaceActionTooltip label="制作前检查" mobile-only>
|
||||
<NButton size="small" class="preparation-trigger workspace-action-button" :disabled="disabled || !projectId" aria-label="制作前检查" @click="open = true"><template #icon><ShieldCheck :size="15" aria-hidden="true" /></template><span class="preparation-trigger-label">制作前检查</span></NButton>
|
||||
</WorkspaceActionTooltip>
|
||||
<AppDrawer v-model:open="open" :title="repairIssue ? '修订正式分镜问题' : '制作前检查'" :busy="busy" description="先核对分镜、处理问题并完成人工审核,再补齐设计和进入镜头制作。">
|
||||
<!-- 以下是在同一抽屉内查看当前正式镜头的修订模块 -->
|
||||
<FormalRepairEditor v-if="open && repairIssue" ref="repairEditor" :project-id="projectId" :issue="repairIssue" :disabled="locked" @busy="repairWriting = $event" @saved="repaired" />
|
||||
|
||||
@@ -369,7 +369,7 @@ function diagnosisResultsResponse() {
|
||||
|
||||
/**
|
||||
* 提供完整结构化校验响应,通过证据数量区分当前与迟到结果。
|
||||
* @param evidenceShotCount 具有有效动作证据的镜头数量
|
||||
* @param evidenceShotCount 具有手部记录覆盖的镜头数量
|
||||
* @returns 后端结构化校验响应
|
||||
*/
|
||||
function handDiagnosticsResponse(evidenceShotCount: number) {
|
||||
@@ -595,8 +595,9 @@ describe('拆解页内容滚动', () => {
|
||||
const provided = mountPage([record])
|
||||
await selectTab('分镜')
|
||||
const toolbar = wrapper!.get('.breakdown-storyboard-toolbar')
|
||||
expect(toolbar.get('.breakdown-episode-picker > span').text()).toBe('选择剧集')
|
||||
expect(toolbar.find('.breakdown-episode-picker > span').exists()).toBe(false)
|
||||
const select = toolbar.getComponent(NSelect)
|
||||
expect(select.attributes('aria-label')).toBe('选择分镜剧集')
|
||||
expect(select.props('value')).toBe(1)
|
||||
expect(toolbar.text()).toContain('长剧集')
|
||||
expect(toolbar.get('.breakdown-storyboard-summary').text()).toContain('25 个节拍 · 25 个镜头')
|
||||
@@ -627,11 +628,11 @@ describe('拆解页内容滚动', () => {
|
||||
expect(wrapper!.find('.breakdown-storyboard router-link-stub').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('分镜顶部无叠加操作行,选择标签保持单行且统计操作垂直居中', () => {
|
||||
it('分镜顶部无叠加操作行,下拉框可收缩且统计操作垂直居中', () => {
|
||||
// 仅保护样式契约,DOM 环境不提供真实布局坐标。
|
||||
const css = readAllStyles()
|
||||
expect(css).toMatch(/\.breakdown-result-pad\s*\{[^}]*padding:\s*0(?:px)?/)
|
||||
expect(css).toMatch(/\.breakdown-episode-picker > span\s*\{[^}]*flex-shrink:\s*0;[^}]*white-space:\s*nowrap;/)
|
||||
expect(css).toMatch(/\.breakdown-episode-picker\s*\{[^}]*min-width:\s*0(?:px)?;/)
|
||||
expect(css).toMatch(/\.breakdown-storyboard-summary\s*\{[^}]*align-items:\s*center;/)
|
||||
})
|
||||
|
||||
@@ -747,7 +748,7 @@ describe('拆解页内容滚动', () => {
|
||||
expect(issues?.textContent).toContain('读取修复清单')
|
||||
})
|
||||
|
||||
it('诊断摘要与弹窗按需读取,展开结构化校验后展示证据不足', async () => {
|
||||
it('诊断摘要与弹窗按需读取,保留通用检查但不展示旧手部统计', async () => {
|
||||
const fetcher = vi.fn<typeof fetch>().mockImplementation(async input => {
|
||||
const url = String(input)
|
||||
if (url.includes('storyboard-legacy-action-diagnosis-results')) return diagnosisResultsResponse()
|
||||
@@ -767,12 +768,12 @@ describe('拆解页内容滚动', () => {
|
||||
expect(panel.get('.storyboard-diagnosis-dialog').attributes('aria-busy')).toBe('false')
|
||||
const footer = panel.get('.n-drawer-footer')
|
||||
expect(footer.text()).toContain('预览诊断范围')
|
||||
expect(footer.text()).toContain('启动 AI 诊断')
|
||||
expect(footer.text()).toContain('启动 AI 复查')
|
||||
expect(footer.text()).toContain('关闭')
|
||||
await panel.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
expect(panel.text()).toContain('有效动作证据 0 / 25 镜')
|
||||
expect(panel.text()).toContain('证据不足,暂无法判断冲突情况')
|
||||
expect(panel.text()).not.toContain('手部记录覆盖')
|
||||
expect(panel.text()).toContain('未填写记录不代表镜头有误')
|
||||
expect(panel.get('.n-collapse-item__header-extra button').text()).toBe('刷新校验')
|
||||
await panel.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
@@ -832,7 +833,7 @@ describe('拆解页内容滚动', () => {
|
||||
expect(panel.get('.diagnosis-dialog-content').element).toBe(content)
|
||||
})
|
||||
|
||||
it('刷新已加载的结构化校验保留证据正文和图标占位,不触发整窗遮罩', async () => {
|
||||
it('刷新通用动作检查保留高级摘要和图标占位,不触发整窗遮罩', async () => {
|
||||
let handRequests = 0
|
||||
let resolveRefresh: ((value: Response) => void) | undefined
|
||||
const fetcher = vi.fn<typeof fetch>().mockImplementation(async input => {
|
||||
@@ -856,14 +857,14 @@ describe('拆解页内容滚动', () => {
|
||||
const panel = qualityDialog()
|
||||
await panel.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
const evidence = panel.findAll('p').find(item => item.text().includes('有效动作证据'))!.element
|
||||
const evidence = panel.get('.diagnosis-inspection-details').element
|
||||
const refreshButton = panel.findAll('button').find(button => button.text() === '刷新校验')!
|
||||
const refreshIcon = refreshButton.find('.n-button__icon')
|
||||
await refreshButton.trigger('click')
|
||||
await flushPromises()
|
||||
try {
|
||||
expect(panel.text()).toContain('有效动作证据 0 / 25 镜')
|
||||
expect(panel.findAll('p').find(item => item.text().includes('有效动作证据'))!.element).toBe(evidence)
|
||||
expect(panel.text()).not.toContain('手部记录覆盖')
|
||||
expect(panel.get('.diagnosis-inspection-details').element).toBe(evidence)
|
||||
const spin = wrapper!
|
||||
.findAllComponents(NSpin)
|
||||
.find(item => item.classes().includes('storyboard-diagnosis-dialog'))!
|
||||
@@ -876,7 +877,7 @@ describe('拆解页内容滚动', () => {
|
||||
await flushPromises()
|
||||
}
|
||||
expect(refreshButton.classes()).not.toContain('n-button--loading')
|
||||
expect(panel.findAll('p').find(item => item.text().includes('有效动作证据'))!.element).toBe(evidence)
|
||||
expect(panel.get('.diagnosis-inspection-details').element).toBe(evidence)
|
||||
expect(panel.get('.n-collapse-item__header-extra button').element).toBe(refreshButton.element)
|
||||
})
|
||||
|
||||
@@ -918,7 +919,10 @@ describe('拆解页内容滚动', () => {
|
||||
expect((close.element as HTMLButtonElement).disabled).toBe(false)
|
||||
await close.trigger('click')
|
||||
await flushPromises()
|
||||
resolveFirst!(handDiagnosticsResponse(25))
|
||||
const late = await handDiagnosticsResponse(25).json()
|
||||
late.data.warningCount = 1
|
||||
late.data.diagnostics = [{ episodeNo: 1, beatNo: 1, shotNo: 1, phaseNo: 1, characterRef: '@CH0001', actionIds: ['a1', 'a2'], code: 'hand_occupancy_conflict', severity: 'warning', suggestion: '已失效的动作检查问题' }]
|
||||
resolveFirst!(new Response(JSON.stringify(late), { status: 200, headers: { 'Content-Type': 'application/json' } }))
|
||||
await flushPromises()
|
||||
await wrapper!.get('.storyboard-diagnosis-summary button').trigger('click')
|
||||
await flushPromises()
|
||||
@@ -926,8 +930,8 @@ describe('拆解页内容滚动', () => {
|
||||
expect(panel.get('.storyboard-diagnosis-dialog').attributes('aria-busy')).toBe('false')
|
||||
await panel.get('.n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
expect(panel.text()).not.toContain('有效动作证据 25 / 25')
|
||||
expect(panel.text()).toContain('有效动作证据 0 / 25 镜')
|
||||
expect(panel.text()).not.toContain('已失效的动作检查问题')
|
||||
expect(panel.text()).not.toContain('手部记录覆盖')
|
||||
expect(handRequests).toBe(2)
|
||||
})
|
||||
|
||||
|
||||
@@ -43,16 +43,21 @@ describe('候选预检查与最终提交门禁', () => {
|
||||
openPanel()
|
||||
expect(preview).not.toHaveBeenCalled()
|
||||
expect(commit).not.toHaveBeenCalled()
|
||||
expect(wrapper!.findAll('button').some(button => button.text() === '重新检查')).toBe(true)
|
||||
await wrapper!.findAll('button').find(button => button.text() === '重新检查')!.trigger('click')
|
||||
expect(wrapper!.emitted('refresh')).toHaveLength(1)
|
||||
await checkCandidate()
|
||||
expect(commit).not.toHaveBeenCalled()
|
||||
expect(document.querySelector('.app-dialog')?.textContent).toContain('确认提交候选为正式结果')
|
||||
await confirmCandidate()
|
||||
expect(preview).toHaveBeenCalledTimes(2)
|
||||
expect(commit).toHaveBeenCalledExactlyOnceWith('candidate-project')
|
||||
expect(wrapper!.emitted('refresh')).toHaveLength(1)
|
||||
expect(wrapper!.text()).toContain('候选已提交')
|
||||
expect(wrapper!.emitted('refresh')).toHaveLength(2)
|
||||
expect(wrapper!.text()).toContain('拆解结果已保存并采用')
|
||||
expect(wrapper!.findAll('button').some(button => button.text() === '重新检查')).toBe(false)
|
||||
await wrapper!.setProps({ state: candidateState({ storyboardPersisted: true, candidateCommitted: true }), quality: breakdownQuality(selectBreakdownSource([candidateCheckpoint(candidateState({ storyboardPersisted: true, candidateCommitted: true }))]), null) })
|
||||
expect(wrapper!.findAll('button').some(button => button.text() === '提交候选为正式结果')).toBe(false)
|
||||
expect(wrapper!.findAll('button').some(button => button.text() === '重新检查')).toBe(false)
|
||||
})
|
||||
it('ready=false 显示未通过项且不打开最终确认', async () => {
|
||||
const result = commitPreview()
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { diagnosisHasAttention, diagnosisReason } from '@/features/breakdown/diagnosis'
|
||||
import type { LegacyActionDiagnosisResults } from '@/features/breakdown/types'
|
||||
|
||||
/**
|
||||
* 修订后的镜头尚未做额外 AI 复查,动作占用没有报告具体问题。
|
||||
* @returns 与真实诊断列表一致的最小记录
|
||||
*/
|
||||
function repaired(): LegacyActionDiagnosisResults['shots'][number] {
|
||||
return { shotId: 'repaired-shot', episodeNo: 1, beatNo: 7, shotNo: 1, title: '已修订镜头', diagnosisId: null,
|
||||
status: 'not_diagnosed', issues: [], createdAt: null, repairStatus: 'repaired', requiresPostRepairDiagnosis: true,
|
||||
resourceAudit: { status: 'insufficient_evidence', issueCount: 0, evidenceCount: 2, expectedActionCount: 0, coveredActionCount: 0, coverage: null } }
|
||||
}
|
||||
|
||||
describe('实际修复问题与独立 AI 复查分类', () => {
|
||||
it('已修订但没有额外 AI 诊断不算需要修复', () => {
|
||||
expect(diagnosisHasAttention(repaired())).toBe(false)
|
||||
})
|
||||
it('过期的冲突或待核对建议不能当成当前动作问题', () => {
|
||||
expect(diagnosisHasAttention({ ...repaired(), status: 'stale', shotStale: true,
|
||||
bodyMotionFindings: [{ dimension: 'balance', status: 'conflict', description: '旧冲突', quote: '旧原文' }] })).toBe(false)
|
||||
expect(diagnosisHasAttention({ ...repaired(), status: 'insufficient_evidence' })).toBe(false)
|
||||
})
|
||||
it('当前明确冲突和实时资源问题始终保留,不能因已经修订而隐藏', () => {
|
||||
expect(diagnosisHasAttention({ ...repaired(), status: 'conflict_found', policyStatus: 'current', shotStale: false })).toBe(true)
|
||||
expect(diagnosisHasAttention({ ...repaired(), resourceAudit: { ...repaired().resourceAudit!, status: 'conflict_found', issueCount: 1 } })).toBe(true)
|
||||
expect(diagnosisHasAttention({ ...repaired(), status: 'no_conflict_found', policyStatus: 'current',
|
||||
bodyMotionFindings: [{ dimension: 'balance', status: 'conflict', description: '当前冲突', quote: '原文' }] })).toBe(true)
|
||||
})
|
||||
it('可选 AI 复查受限不要求重新拆解或替用户放开模型请求', () => {
|
||||
for (const code of ['QUALITY_POLICY_SNAPSHOT_UNKNOWN', 'QUALITY_POLICY_SNAPSHOT_INVALID']) {
|
||||
expect(diagnosisReason(code)).toContain('AI 复查')
|
||||
expect(diagnosisReason(code)).not.toContain('重新生成拆解候选')
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -25,6 +25,44 @@ beforeEach(() => { vi.spyOn(preparationApi, 'revisions').mockResolvedValue({ pro
|
||||
afterEach(() => { wrapper?.unmount(); wrapper = undefined; vi.restoreAllMocks(); vi.unstubAllGlobals(); document.body.innerHTML = '' })
|
||||
|
||||
describe('单镜头诊断收费前来源检查', () => {
|
||||
it('高级检查保留复查记录与范围,隐藏旧手部统计且不改变诊断启动条件', async () => {
|
||||
const start = mocks()
|
||||
vi.spyOn(breakdownApi, 'diagnosisPreflight').mockResolvedValue(checked())
|
||||
vi.mocked(breakdownApi.handOccupancyDiagnostics).mockResolvedValue({ projectId: 'diag-p', shotCount: 61, evidenceShotCount: 42,
|
||||
warningCount: 0, assessment: 'partial_evidence', diagnostics: [] } as never)
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
|
||||
wrapper.getComponent(StoryboardDiagnosis).vm.open({ episodeNo: 1, beatNo: 1, shotNo: 1 }); await flushPromises()
|
||||
const drawer = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
|
||||
expect(drawer.text()).toContain('高级检查详情')
|
||||
expect(drawer.find('.diagnosis-counts').exists()).toBe(false)
|
||||
expect(drawer.text()).not.toContain('42 / 61')
|
||||
expect(drawer.text()).not.toContain('缺少结构化动作证据')
|
||||
expect(drawer.find('.diagnosis-preview').exists()).toBe(false)
|
||||
const disabledBefore = drawer.get('[aria-label="启动 AI 复查"]').attributes('disabled')
|
||||
await drawer.get('.diagnosis-evidence-collapse .n-collapse-item__header-main').trigger('click')
|
||||
await flushPromises()
|
||||
expect(drawer.text()).not.toContain('手部记录覆盖')
|
||||
expect(drawer.text()).not.toContain('全项目手部记录')
|
||||
expect(drawer.find('.diagnosis-counts').exists()).toBe(true)
|
||||
expect(drawer.text()).not.toContain('未填写手部记录')
|
||||
expect(drawer.get('.diagnosis-evidence-collapse').text()).not.toContain('证据不足')
|
||||
expect(drawer.get('.diagnosis-evidence-collapse').text()).toContain('当前复查范围')
|
||||
expect(drawer.get('[aria-label="启动 AI 复查"]').attributes('disabled')).toBe(disabledBefore)
|
||||
expect(start).not.toHaveBeenCalled()
|
||||
})
|
||||
it('确实检出的结构化冲突在普通区域可见,不随高级详情一起隐藏', async () => {
|
||||
mocks()
|
||||
vi.mocked(breakdownApi.handOccupancyDiagnostics).mockResolvedValue({ projectId: 'diag-p', shotCount: 1, evidenceShotCount: 1,
|
||||
warningCount: 1, assessment: 'complete_evidence', diagnostics: [{ episodeNo: 1, beatNo: 1, shotNo: 1, phaseNo: 1,
|
||||
characterRef: '@CH0001', actionIds: ['a1','a2'], code: 'hand_occupancy_conflict', severity: 'warning', suggestion: '右手同时执行了冲突动作' }] } as never)
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
|
||||
await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
|
||||
const drawer = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
|
||||
expect(drawer.text()).toContain('右手同时执行了冲突动作')
|
||||
expect(drawer.find('.diagnosis-evidence-collapse').text()).not.toContain('右手同时执行了冲突动作')
|
||||
expect(drawer.findAll('.problem-surface').length).toBeGreaterThan(0)
|
||||
})
|
||||
|
||||
it('规则缺失、跨项目、已可复用和不完整检查都不能进入新诊断', () => {
|
||||
expect(diagnosisCanStart(checked(), 'diag-p', 'db-shot')).toBe(true)
|
||||
for (const invalid of [{ projectId: 'other' }, { shotId: 'other' }, { existingValid: true }, { shouldDiagnose: false }, { policyRevision: null }, { policyFingerprint: null }, { errors: ['QUALITY_POLICY_SNAPSHOT_UNKNOWN'] }, { eligibleForFurtherValidation: false }])
|
||||
@@ -38,7 +76,7 @@ describe('单镜头诊断收费前来源检查', () => {
|
||||
expect(read).toHaveBeenCalledWith('diag-p', 'db-shot')
|
||||
const drawer = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
|
||||
expect(drawer.text()).toContain('缺少可信的质量规则记录')
|
||||
expect(drawer.get('[aria-label="启动 AI 诊断"]').attributes('disabled')).toBeDefined()
|
||||
expect(drawer.get('[aria-label="启动 AI 复查"]').attributes('disabled')).toBeDefined()
|
||||
expect(start).not.toHaveBeenCalled()
|
||||
})
|
||||
it('费用确认后再次检查,规则变化时保留只读结果并撤销启动', async () => {
|
||||
@@ -46,13 +84,13 @@ describe('单镜头诊断收费前来源检查', () => {
|
||||
vi.spyOn(breakdownApi, 'diagnosisPreflight').mockResolvedValueOnce(checked()).mockResolvedValue({ ...checked(), policyRevision: 4, policyFingerprint: 'b'.repeat(64) })
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
|
||||
wrapper.getComponent(StoryboardDiagnosis).vm.open({ episodeNo: 1, beatNo: 1, shotNo: 1 }); await flushPromises()
|
||||
await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 诊断"]').trigger('click')
|
||||
await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 复查"]').trigger('click')
|
||||
await flushPromises()
|
||||
const confirmation = new DOMWrapper(document.querySelector('.app-dialog')!)
|
||||
await confirmation.findAll('button').find(button => button.text() === '确认启动 AI 诊断')!.trigger('click')
|
||||
await confirmation.findAll('button').find(button => button.text() === '确认启动 AI 复查')!.trigger('click')
|
||||
await flushPromises()
|
||||
expect(start).not.toHaveBeenCalled()
|
||||
expect(new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 诊断"]').attributes('disabled')).toBeDefined()
|
||||
expect(new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 复查"]').attributes('disabled')).toBeDefined()
|
||||
})
|
||||
it('镜头描述在费用确认期间变化时必须重新预览,不能直接诊断新内容', async () => {
|
||||
const start = mocks()
|
||||
@@ -60,8 +98,8 @@ describe('单镜头诊断收费前来源检查', () => {
|
||||
vi.mocked(breakdownApi.legacyActionDiagnosisPreview).mockResolvedValueOnce(preview()).mockResolvedValue({ ...preview(), candidates: [{ ...preview().candidates[0]!, description: '已更改的新镜头' }] })
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-p', episodeNo: 1, episodeNos: [1] } })
|
||||
wrapper.getComponent(StoryboardDiagnosis).vm.open({ episodeNo: 1, beatNo: 1, shotNo: 1 }); await flushPromises()
|
||||
await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 诊断"]').trigger('click'); await flushPromises()
|
||||
await new DOMWrapper(document.querySelector('.app-dialog')!).findAll('button').find(button => button.text() === '确认启动 AI 诊断')!.trigger('click'); await flushPromises()
|
||||
await new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!).get('[aria-label="启动 AI 复查"]').trigger('click'); await flushPromises()
|
||||
await new DOMWrapper(document.querySelector('.app-dialog')!).findAll('button').find(button => button.text() === '确认启动 AI 复查')!.trigger('click'); await flushPromises()
|
||||
expect(start).not.toHaveBeenCalled()
|
||||
})
|
||||
it('修订条件与历史按需读取,跨项目响应不显示为可修订', async () => {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { flushPromises, mount, DOMWrapper, type VueWrapper } from '@vue/test-utils'
|
||||
import { NSelect } from 'naive-ui'
|
||||
import StoryboardDiagnosis from '@/features/breakdown/components/StoryboardDiagnosis.vue'
|
||||
import { projectContextKey } from '@/features/projects/context'
|
||||
import { testProjectContext } from '@/testing/project-context'
|
||||
import WorkflowExecutionPanel from '@/features/workflows/WorkflowExecutionPanel.vue'
|
||||
import { breakdownApi } from '@/features/breakdown/api'
|
||||
import type { LegacyActionDiagnosisResults } from '@/features/breakdown/types'
|
||||
@@ -15,16 +18,71 @@ let wrapper: VueWrapper | undefined
|
||||
afterEach(() => { wrapper?.unmount(); wrapper = undefined; vi.restoreAllMocks(); vi.unstubAllGlobals(); document.body.innerHTML = '' })
|
||||
|
||||
describe('诊断版本及复查展示', () => {
|
||||
it('顶部摘要优先表达正式审核通过,不因没有额外 AI 记录提示分镜尚未诊断', async () => {
|
||||
const current = { ...shot, status: 'not_diagnosed' as const, policyStatus: 'not_diagnosed' as const, shotStale: false, bodyMotionFindings: [] }
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
|
||||
counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 }, shots: [current] })
|
||||
const context = testProjectContext('diag-update')
|
||||
wrapper = mount(StoryboardDiagnosis, { props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: context } } })
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('分镜校验与审核已通过')
|
||||
expect(wrapper.text()).not.toContain('尚未诊断')
|
||||
context.data.value!.stageReadiness.breakdown = { ready: false, reason: '审核已失效' }
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
|
||||
expect(wrapper.text()).toContain('正式分镜检查待确认')
|
||||
context.data.value!.stageReadiness.projectId = 'other-project'
|
||||
context.data.value!.stageReadiness.breakdown.ready = true
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
|
||||
})
|
||||
it('有当前真实问题时摘要仍明确提示处理,不被正式审核状态盖住', async () => {
|
||||
const current = { ...shot, status: 'conflict_found' as const, policyStatus: 'current' as const, shotStale: false, bodyMotionFindings: [] }
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
|
||||
counts: { total: 1, conflict: 1, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 0 }, shots: [current] })
|
||||
wrapper = mount(StoryboardDiagnosis, { props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } } })
|
||||
await flushPromises()
|
||||
expect(wrapper.text()).toContain('1 个镜头有实际问题待处理')
|
||||
expect(wrapper.text()).not.toContain('分镜校验与审核已通过')
|
||||
})
|
||||
|
||||
it('已修订并审核通过默认不列入需处理,可在可选复查中查看且没有修复按钮', async () => {
|
||||
const current = { ...shot, status: 'not_diagnosed' as const, policyStatus: 'not_diagnosed' as const,
|
||||
shotStale: false, bodyMotionFindings: [], handAudit: undefined,
|
||||
resourceAudit: { status: 'insufficient_evidence' as const, issueCount: 0, evidenceCount: 2, expectedActionCount: 0, coveredActionCount: 0, coverage: null } }
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1,
|
||||
counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 0, pending: 1 }, shots: [current] })
|
||||
vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({ projectId: 'diag-update', shotCount: 1, evidenceShotCount: 0, diagnostics: [] } as never)
|
||||
const start = vi.spyOn(breakdownApi, 'startLegacyActionDiagnosis')
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] },
|
||||
global: { provide: { [projectContextKey as symbol]: testProjectContext('diag-update') } } })
|
||||
await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
|
||||
const dialog = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
|
||||
expect(dialog.findAll('.diagnosis-result-item')).toHaveLength(0)
|
||||
expect(dialog.text()).toContain('当前正式分镜已审核通过')
|
||||
expect(dialog.findAll('button').some(item => item.text() === '查看可选 AI 复查')).toBe(false)
|
||||
wrapper!.getComponent(NSelect).vm.$emit('update:value', 'review')
|
||||
await flushPromises()
|
||||
expect(dialog.findAll('.diagnosis-result-item')).toHaveLength(1)
|
||||
expect(dialog.text()).toContain('已修订并审核通过')
|
||||
expect(dialog.text()).not.toContain('动作占用证据不足')
|
||||
expect(dialog.find('[aria-label="查看并修订动作"]').exists()).toBe(false)
|
||||
expect(start).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('修订完成不显示全部通过,展示规则和镜头过期、手部覆盖及全身疑点', async () => {
|
||||
vi.spyOn(breakdownApi, 'legacyActionDiagnosisResults').mockResolvedValue({ projectId: 'diag-update', episodeNo: 1, counts: { total: 1, conflict: 0, clear: 0, insufficient: 0, invalid: 0, stale: 1, pending: 0 }, shots: [shot] })
|
||||
vi.spyOn(breakdownApi, 'handOccupancyDiagnostics').mockResolvedValue({ projectId: 'diag-update', shotCount: 1, evidenceShotCount: 0, diagnostics: [] } as never)
|
||||
wrapper = mount(StoryboardDiagnosis, { attachTo: document.body, props: { projectId: 'diag-update', episodeNo: 1, episodeNos: [1] } })
|
||||
await flushPromises(); await wrapper.get('button').trigger('click'); await flushPromises()
|
||||
const dialog = new DOMWrapper(document.querySelector('[aria-label="动作诊断"]')!)
|
||||
expect(dialog.text()).toContain('镜头已修订,AI 待复查')
|
||||
wrapper!.getComponent(NSelect).vm.$emit('update:value', 'review'); await flushPromises()
|
||||
expect(dialog.text()).toContain('镜头已修订,可按需进行 AI 复查。')
|
||||
expect(dialog.text()).toContain('镜头内容已变化')
|
||||
expect(dialog.text()).toContain('质量规则已变化')
|
||||
expect(dialog.text()).toContain('手部动作证据 1 / 2')
|
||||
expect(dialog.text()).not.toContain('手部动作证据 1 / 2')
|
||||
expect(dialog.text()).toContain('重心需要核对')
|
||||
expect(dialog.text()).not.toContain('全部通过')
|
||||
})
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { flushPromises, mount, type VueWrapper } from '@vue/test-utils'
|
||||
import StoryboardList from '@/features/breakdown/components/StoryboardList.vue'
|
||||
import type { EpisodePlan, EpisodeShots } from '@/features/breakdown/types'
|
||||
|
||||
/** 一条不涉及实际服务的正式分镜,用于验证定位语义。 */
|
||||
const plan: EpisodePlan = { episodeNo: 1, episodeTitle: '第一集', storyGoal: '', centralConflict: '', emotionalArc: '', pacing: '', endingHook: '',
|
||||
beats: [{ beatNo: 1, title: '场景', purpose: 'establish', description: '内容', visualFocus: '', narrativeGoal: '', emotionalTone: '', estimatedDurationSeconds: 5, subjectRefs: [], isKeyBeat: false }] }
|
||||
/** 当前正式镜头正文。 */
|
||||
const episode: EpisodeShots = { episodeNo: 1, episodePlan: plan, beatShots: [{ beatNo: 1, shots: [{ shotNo: 1, title: '无问题镜头', description: '正文', visualFocus: '', subjectRefs: [], durationSeconds: 5 }] }] }
|
||||
let wrapper: VueWrapper | undefined
|
||||
afterEach(() => { wrapper?.unmount(); vi.restoreAllMocks() })
|
||||
|
||||
describe('分镜定位与问题状态分离', () => {
|
||||
it('只有从当前实际问题定位时使用错误标记,普通定位会清除旧错误标记', async () => {
|
||||
wrapper = mount(StoryboardList, { props: { plans: [plan], episodes: [episode] } })
|
||||
const target = wrapper.get('[data-shot-position="1-1-1"]')
|
||||
await wrapper.getComponent(StoryboardList).vm.locate({ episodeNo: 1, beatNo: 1, shotNo: 1 }, { problem: true })
|
||||
expect(target.classes()).toContain('diagnosis-problem-located')
|
||||
await wrapper.getComponent(StoryboardList).vm.locate({ episodeNo: 1, beatNo: 1, shotNo: 1 })
|
||||
expect(target.classes()).toContain('diagnosis-located')
|
||||
expect(target.classes()).not.toContain('diagnosis-problem-located')
|
||||
})
|
||||
it('正式数据刷新后清除旧定位,不让已处理的问题继续标红', async () => {
|
||||
wrapper = mount(StoryboardList, { props: { plans: [plan], episodes: [episode] } })
|
||||
await wrapper.getComponent(StoryboardList).vm.locate({ episodeNo: 1, beatNo: 1, shotNo: 1 }, { problem: true })
|
||||
await wrapper.setProps({ episodes: [structuredClone(episode)] })
|
||||
await flushPromises()
|
||||
expect(wrapper.find('.diagnosis-problem-located').exists()).toBe(false)
|
||||
expect(wrapper.find('.diagnosis-located').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
@@ -93,10 +93,10 @@ describe('连续剧本阅读器', () => {
|
||||
/\.reader-chapter-heading\s*\{[^}]*position:\s*sticky;[^}]*top:\s*0;[^}]*z-index:\s*2;[^}]*background:\s*var\(--reader-background\)/
|
||||
)
|
||||
expect(css).toMatch(
|
||||
/\.reader-chapter-heading\s*\{[^}]*margin-inline:\s*calc\(var\(--reader-gutter\) \* -1\);[^}]*padding:\s*14px var\(--reader-gutter\) 18px;/
|
||||
/\.reader-chapter-heading\s*\{[^}]*margin-inline:\s*calc\(var\(--reader-gutter\) \* -1\);[^}]*padding:\s*0 var\(--reader-gutter\) 18px;/
|
||||
)
|
||||
expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.reader-content\s*\{[^}]*padding-inline:\s*18px/)
|
||||
expect(css).toMatch(/@media \(max-width: 800px\)[\s\S]*?\.reader-content\s*\{[^}]*--reader-gutter:\s*18px/)
|
||||
expect(css).toMatch(/@media \(max-width: 1023px\)[\s\S]*?\.reader-content\s*\{[^}]*padding:\s*24px/)
|
||||
expect(css).toMatch(/@media \(max-width: 1023px\)[\s\S]*?\.reader-content\s*\{[^}]*--reader-gutter:\s*24px/)
|
||||
})
|
||||
|
||||
it('按编号连续渲染全部剧集、元数据和空正文,标题不截断,模型内容只按文本显示', () => {
|
||||
|
||||
@@ -217,11 +217,14 @@ describe('剧本完成前的下游访问限制', () => {
|
||||
expect(wrapper!.get(skeleton).attributes('aria-busy')).toBe('true')
|
||||
expect(wrapper!.find('.workspace-loading').exists()).toBe(false)
|
||||
expect(wrapper!.get('.project-title').text()).toBe('')
|
||||
expect(wrapper!.findAll('.project-header-action-placeholder')).toHaveLength(2)
|
||||
expect(wrapper!.find('.project-header .n-button').exists()).toBe(false)
|
||||
expect(mounted).not.toHaveBeenCalled()
|
||||
|
||||
resolveDetail(project('skeleton-first', 'completed'))
|
||||
await flushPromises()
|
||||
expect(wrapper!.find(skeleton).exists()).toBe(false)
|
||||
expect(wrapper!.find('.project-header-action-placeholder').exists()).toBe(false)
|
||||
expect(wrapper!.get('.workspace-probe').text()).toBe(section)
|
||||
|
||||
pending = new Promise<ProjectDetail>(resolve => {
|
||||
|
||||
Reference in new issue
Block a user