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
@@ -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" />
|
||||
|
||||
Reference in new issue
Block a user