fix: 修复剧本拆解结果滚动并收拢配置
This commit is contained in:
1 parent
0279c701b4
commit
badea1b798
6 files changed
+541
-235
No files matched your search
@@ -3,7 +3,7 @@ import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
import { NScrollbar, NAlert, NButton, NCheckbox, NInputNumber, NProgress, NTab, NTable, NTabs, NTag } from 'naive-ui'
|
||||
import { computed, onScopeDispose, ref, watch } from 'vue'
|
||||
import { Download, Layers, LoaderCircle, ArrowRight } from '@lucide/vue'
|
||||
import { EmptyState, StatusBadge } from '../../components/ui'
|
||||
import { EmptyState, StatusBadge, WorkspaceTools } from '../../components/ui'
|
||||
import { useProjectContext } from '../projects/context'
|
||||
import { breakdownApi } from './api'
|
||||
import type { BreakdownAction, BreakdownInput, BreakdownModule, BreakdownPreview } from './types'
|
||||
@@ -24,6 +24,7 @@ const preview = ref<BreakdownPreview | null>(null)
|
||||
const previewBusy = ref(false)
|
||||
const previewError = ref('')
|
||||
const tab = ref('character')
|
||||
const toolsOpen = ref(false)
|
||||
const moduleOptions: { value: BreakdownModule; label: string; description: string }[] = [
|
||||
{ value: 'character', label: '人物', description: '人物身份、外观与形态' },
|
||||
{ value: 'scene', label: '场景', description: '故事空间与环境特征' },
|
||||
@@ -132,117 +133,15 @@ function exportResult() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WorkspacePage
|
||||
><template #header
|
||||
><h2 class="text-lg font-semibold">剧本拆解</h2>
|
||||
<p class="text-xs text-muted">分组抽取、主体整理与分镜结果</p></template
|
||||
>
|
||||
<div v-if="!project?.episodes.length" class="panel">
|
||||
<EmptyState
|
||||
title="还没有可拆解的剧集"
|
||||
description="先完成剧本创作。拆解会读取数据库中的正式剧集,不需要上传 checkpoint。"
|
||||
><RouterLink class="button button-primary" :to="`/projects/${project?.id}/create-drama`"
|
||||
>前往剧本创作<ArrowRight :size="14" /></RouterLink
|
||||
></EmptyState>
|
||||
</div>
|
||||
<template v-else>
|
||||
<section class="panel p-5 lg:p-6">
|
||||
<div class="mb-5 flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h2 class="flex items-center gap-2 font-semibold"><Layers :size="17" />拆解设置</h2>
|
||||
<p class="mt-2 text-xs leading-5 text-muted">
|
||||
读取已保存的
|
||||
{{ project.episodes.length }} 集剧本。每个分组分别抽取所选模块,再生成主体与分镜。
|
||||
</p>
|
||||
</div>
|
||||
<NTag size="small" :bordered="false">来源:正式剧集</NTag>
|
||||
</div>
|
||||
<div class="breakdown-config">
|
||||
<div>
|
||||
<label class="field-label" for="group-size">每组集数</label>
|
||||
<div class="flex items-center gap-3">
|
||||
<NInputNumber
|
||||
:disabled="operation.pending"
|
||||
:input-props="{ id: 'group-size' }"
|
||||
class="w-24"
|
||||
:value="typeof groupSize === 'number' ? groupSize : null"
|
||||
@update:value="groupSize = $event ?? 0"
|
||||
:min="1"
|
||||
:step="1"
|
||||
></NInputNumber
|
||||
><span class="text-sm text-muted">集 / 组</span>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="flex flex-wrap gap-5 border-0 p-0">
|
||||
<legend class="field-label mb-3">抽取模块</legend>
|
||||
<NCheckbox
|
||||
:checked="modules.includes(option.value)"
|
||||
:disabled="operation.pending"
|
||||
:aria-label="option.label"
|
||||
@update:checked="toggleModule(option.value, $event)"
|
||||
v-for="option in moduleOptions"
|
||||
:key="option.value"
|
||||
class="flex cursor-pointer items-start gap-2.5"
|
||||
><span
|
||||
><span class="block text-sm font-medium">{{ option.label }}</span
|
||||
><span class="mt-1 block text-[11px] text-muted">{{ option.description }}</span></span
|
||||
></NCheckbox
|
||||
>
|
||||
</fieldset>
|
||||
<NButton
|
||||
:disabled="!configValid || previewBusy || operation.pending || !!error"
|
||||
@click="loadPreview"
|
||||
class="self-end"
|
||||
><LoaderCircle v-if="previewBusy" :size="14" class="animate-spin" />预览分组
|
||||
</NButton>
|
||||
</div>
|
||||
<p v-if="!configValid" class="mt-4 text-xs text-danger">
|
||||
每组集数必须是正整数,并至少选择一个抽取模块。
|
||||
</p>
|
||||
<NAlert v-if="previewError" role="alert" type="error" :show-icon="false" class="mt-4">{{
|
||||
previewError
|
||||
}}</NAlert>
|
||||
<div v-if="preview" class="group-preview">
|
||||
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
|
||||
<p class="text-sm">
|
||||
<strong>{{ preview.groupCount }}</strong> 个分组 <span class="mx-2 text-faint">/</span>
|
||||
<strong>{{ preview.estimatedTaskCount }}</strong> 个抽取任务
|
||||
</p>
|
||||
<ConfirmAction
|
||||
:label="records.length ? '重新拆解' : '开始拆解'"
|
||||
:description="
|
||||
records.length
|
||||
? '这会重新运行整个 Breakdown,可能替换已保存的主体与分镜。只想恢复失败阶段时,请使用下方对应恢复操作。'
|
||||
: '将按当前预览配置启动完整的 Breakdown 工作流。抽取结束后仍需完成主体整理、分镜生成与入库。'
|
||||
"
|
||||
:acknowledgement="records.length > 0"
|
||||
primary
|
||||
:disabled="!canStart"
|
||||
@confirm="run('start')"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<div v-for="group in preview.groups" :key="group.groupId" class="group-chip">
|
||||
<span class="text-muted">{{ String(group.groupNo).padStart(2, '0') }}</span
|
||||
><span>第 {{ group.startEpisodeNo }}–{{ group.endEpisodeNo }} 集</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="project.status === 'generating'" class="mt-4 text-xs text-danger">
|
||||
剧本仍在生成,暂不允许启动拆解,避免读取到不完整的剧集。
|
||||
</p>
|
||||
<p v-if="records.length && !taskStopped" class="mt-4 text-xs leading-5 text-muted">
|
||||
后端尚无明确的完成或失败记录。为避免重复执行,已禁用整条重新拆解;如进程已中断,请先核实后台,再选择对应恢复操作。
|
||||
</p>
|
||||
</section>
|
||||
<section v-if="snapshot" class="mt-5">
|
||||
<div class="mb-3 flex flex-wrap items-center justify-between gap-3">
|
||||
<h2 class="text-sm font-medium">
|
||||
最近可用拆解快照
|
||||
<span class="ml-2 text-xs font-normal text-muted">{{
|
||||
nodeLabel(records.at(-1)?.metadata?.nodeName)
|
||||
}}</span>
|
||||
</h2>
|
||||
<WorkspacePage split compact class="breakdown-workspace-page">
|
||||
<template #header>
|
||||
<div class="workspace-toolbar">
|
||||
<h2 class="font-semibold">剧本拆解</h2>
|
||||
<div v-if="snapshot" class="toolbar-summary">
|
||||
<span v-if="summary"
|
||||
>抽取 {{ summary.completed }} / {{ summary.total }} · 失败 {{ summary.failed }}</span
|
||||
>
|
||||
<span>主体 {{ subjects.length }} · 分镜剧集 {{ shots.length }} / {{ plans.length }}</span>
|
||||
<StatusBadge
|
||||
:status="execution?.status || 'unknown'"
|
||||
:label="
|
||||
@@ -250,70 +149,218 @@ function exportResult() {
|
||||
? '工作流已完成'
|
||||
: execution?.status === 'failed'
|
||||
? '工作流失败'
|
||||
: '阶段快照 · 执行状态待确认'
|
||||
: '执行状态待确认'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="summary" class="flex flex-wrap items-center gap-x-6 gap-y-2 text-xs text-muted">
|
||||
<span
|
||||
>抽取完成 <strong class="text-ink">{{ summary.completed }} / {{ summary.total }}</strong></span
|
||||
><span>失败 {{ summary.failed }}</span
|
||||
><span>主体 {{ subjects.length }}</span
|
||||
><span>分镜剧集 {{ shots.length }} / {{ plans.length }}</span>
|
||||
<div v-if="project?.episodes.length" class="toolbar-actions">
|
||||
<WorkspaceTools v-model:open="toolsOpen" title="拆解设置与恢复" label="拆解设置与恢复">
|
||||
<section class="panel p-5 lg:p-6">
|
||||
<div class="mb-5 flex flex-wrap items-start justify-between gap-3">
|
||||
<div>
|
||||
<h2 class="flex items-center gap-2 font-semibold"><Layers :size="17" />拆解设置</h2>
|
||||
<p class="mt-2 text-xs leading-5 text-muted">
|
||||
读取已保存的
|
||||
{{ project.episodes.length }}
|
||||
集剧本。每个分组分别抽取所选模块,再生成主体与分镜。
|
||||
</p>
|
||||
</div>
|
||||
<NTag size="small" :bordered="false">来源:正式剧集</NTag>
|
||||
</div>
|
||||
<div class="breakdown-config">
|
||||
<div>
|
||||
<label class="field-label" for="group-size">每组集数</label>
|
||||
<div class="flex items-center gap-3">
|
||||
<NInputNumber
|
||||
:disabled="operation.pending"
|
||||
:input-props="{ id: 'group-size' }"
|
||||
class="w-24"
|
||||
:value="typeof groupSize === 'number' ? groupSize : null"
|
||||
@update:value="groupSize = $event ?? 0"
|
||||
:min="1"
|
||||
:step="1"
|
||||
></NInputNumber
|
||||
><span class="text-sm text-muted">集 / 组</span>
|
||||
</div>
|
||||
</div>
|
||||
<fieldset class="flex flex-wrap gap-5 border-0 p-0">
|
||||
<legend class="field-label mb-3">抽取模块</legend>
|
||||
<NCheckbox
|
||||
:checked="modules.includes(option.value)"
|
||||
:disabled="operation.pending"
|
||||
:aria-label="option.label"
|
||||
@update:checked="toggleModule(option.value, $event)"
|
||||
v-for="option in moduleOptions"
|
||||
:key="option.value"
|
||||
class="flex cursor-pointer items-start gap-2.5"
|
||||
><span
|
||||
><span class="block text-sm font-medium">{{ option.label }}</span
|
||||
><span class="mt-1 block text-[11px] text-muted">{{
|
||||
option.description
|
||||
}}</span></span
|
||||
></NCheckbox
|
||||
>
|
||||
</fieldset>
|
||||
<NButton
|
||||
:disabled="!configValid || previewBusy || operation.pending || !!error"
|
||||
@click="loadPreview"
|
||||
class="self-end"
|
||||
><LoaderCircle v-if="previewBusy" :size="14" class="animate-spin" />预览分组
|
||||
</NButton>
|
||||
</div>
|
||||
<p v-if="!configValid" class="mt-4 text-xs text-danger">
|
||||
每组集数必须是正整数,并至少选择一个抽取模块。
|
||||
</p>
|
||||
<NAlert v-if="previewError" role="alert" type="error" :show-icon="false" class="mt-4">{{
|
||||
previewError
|
||||
}}</NAlert>
|
||||
<div v-if="preview" class="group-preview">
|
||||
<div class="mb-4 flex flex-wrap items-center justify-between gap-3">
|
||||
<p class="text-sm">
|
||||
<strong>{{ preview.groupCount }}</strong> 个分组
|
||||
<span class="mx-2 text-faint">/</span>
|
||||
<strong>{{ preview.estimatedTaskCount }}</strong> 个抽取任务
|
||||
</p>
|
||||
<ConfirmAction
|
||||
:label="records.length ? '重新拆解' : '开始拆解'"
|
||||
:description="
|
||||
records.length
|
||||
? '这会重新运行整个 Breakdown,可能替换已保存的主体与分镜。只想恢复失败阶段时,请使用下方对应恢复操作。'
|
||||
: '将按当前预览配置启动完整的 Breakdown 工作流。抽取结束后仍需完成主体整理、分镜生成与入库。'
|
||||
"
|
||||
:acknowledgement="records.length > 0"
|
||||
primary
|
||||
:disabled="!canStart"
|
||||
@confirm="run('start')"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<div v-for="group in preview.groups" :key="group.groupId" class="group-chip">
|
||||
<span class="text-muted">{{ String(group.groupNo).padStart(2, '0') }}</span
|
||||
><span>第 {{ group.startEpisodeNo }}–{{ group.endEpisodeNo }} 集</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="project.status === 'generating'" class="mt-4 text-xs text-danger">
|
||||
剧本仍在生成,暂不允许启动拆解,避免读取到不完整的剧集。
|
||||
</p>
|
||||
<p v-if="records.length && !taskStopped" class="mt-4 text-xs leading-5 text-muted">
|
||||
后端尚无明确的完成或失败记录。为避免重复执行,已禁用整条重新拆解;如进程已中断,请先核实后台,再选择对应恢复操作。
|
||||
</p>
|
||||
</section>
|
||||
<section v-if="snapshot" class="mt-5">
|
||||
<div class="mb-3 flex flex-wrap items-center justify-between gap-3">
|
||||
<h2 class="text-sm font-medium">
|
||||
最近可用拆解快照
|
||||
<span class="ml-2 text-xs font-normal text-muted">{{
|
||||
nodeLabel(records.at(-1)?.metadata?.nodeName)
|
||||
}}</span>
|
||||
</h2>
|
||||
<StatusBadge
|
||||
:status="execution?.status || 'unknown'"
|
||||
:label="
|
||||
execution?.status === 'completed'
|
||||
? '工作流已完成'
|
||||
: execution?.status === 'failed'
|
||||
? '工作流失败'
|
||||
: '阶段快照 · 执行状态待确认'
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div v-if="summary" class="flex flex-wrap items-center gap-x-6 gap-y-2 text-xs text-muted">
|
||||
<span
|
||||
>抽取完成
|
||||
<strong class="text-ink"
|
||||
>{{ summary.completed }} / {{ summary.total }}</strong
|
||||
></span
|
||||
><span>失败 {{ summary.failed }}</span
|
||||
><span>主体 {{ subjects.length }}</span
|
||||
><span>分镜剧集 {{ shots.length }} / {{ plans.length }}</span>
|
||||
</div>
|
||||
<NProgress
|
||||
v-if="summary?.total"
|
||||
aria-label="已完成抽取任务"
|
||||
type="line"
|
||||
:show-indicator="false"
|
||||
:height="4"
|
||||
:percentage="
|
||||
Math.min(100, Math.max(0, (summary.completed / Math.max(1, summary.total)) * 100))
|
||||
"
|
||||
class="mt-3"
|
||||
></NProgress>
|
||||
<NAlert
|
||||
v-if="execution?.errorMessage"
|
||||
role="alert"
|
||||
type="error"
|
||||
:show-icon="false"
|
||||
class="mt-4"
|
||||
>{{ execution.errorMessage }}</NAlert
|
||||
>
|
||||
<NAlert v-if="validation && !validation.valid" type="error" :show-icon="false" class="mt-4"
|
||||
><p class="font-medium">分镜校验未通过</p>
|
||||
<ul class="mt-2 list-inside list-disc space-y-1">
|
||||
<li v-for="(issue, index) in validation.issues" :key="index">
|
||||
第 {{ issue.episodeNo }} 集<span v-if="issue.beatNo">
|
||||
/ Beat {{ issue.beatNo }}</span
|
||||
><span v-if="issue.shotNo"> / Shot {{ issue.shotNo }}</span
|
||||
>:{{ issue.message }}
|
||||
</li>
|
||||
</ul></NAlert
|
||||
>
|
||||
<div v-if="showRecovery" class="recovery-strip mt-4">
|
||||
<div>
|
||||
<p class="text-sm font-medium">从中断处继续</p>
|
||||
<p class="mt-1 text-xs leading-5 text-muted">
|
||||
抽取失败、镜头缺失、主体绑定异常分别处理。禁用表示近期 checkpoint
|
||||
不具备所需数据。
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<ConfirmAction
|
||||
label="重试失败抽取"
|
||||
description="只重试 character / scene / prop 抽取任务中的失败项。不能用于镜头阶段失败。"
|
||||
acknowledgement
|
||||
:disabled="!recovery.retry || operation.pending || !!error"
|
||||
@confirm="run('retry')"
|
||||
/><ConfirmAction
|
||||
label="补齐缺失镜头"
|
||||
description="复用已完成剧集的镜头,仅生成尚未完成的 Episode Shot,再进行校验与入库。"
|
||||
acknowledgement
|
||||
:disabled="!recovery.shots || operation.pending || !!error"
|
||||
@confirm="run('resume-shots')"
|
||||
/><ConfirmAction
|
||||
label="修复分镜绑定"
|
||||
description="复用已有镜头,修复 SubjectRef 与视觉 Form 绑定,再校验并保存。"
|
||||
acknowledgement
|
||||
:disabled="!recovery.storyboard || operation.pending || !!error"
|
||||
@confirm="run('resume-storyboard')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</WorkspaceTools>
|
||||
</div>
|
||||
<NProgress
|
||||
v-if="summary?.total"
|
||||
aria-label="已完成抽取任务"
|
||||
type="line"
|
||||
:show-indicator="false"
|
||||
:height="4"
|
||||
:percentage="Math.min(100, Math.max(0, (summary.completed / Math.max(1, summary.total)) * 100))"
|
||||
class="mt-3"
|
||||
></NProgress>
|
||||
<NAlert v-if="execution?.errorMessage" role="alert" type="error" :show-icon="false" class="mt-4">{{
|
||||
</div>
|
||||
</template>
|
||||
<NScrollbar v-if="!project?.episodes.length" class="panel-scroll panel">
|
||||
<EmptyState
|
||||
title="还没有可拆解的剧集"
|
||||
description="先完成剧本创作。拆解会读取数据库中的正式剧集,不需要上传 checkpoint。"
|
||||
><RouterLink class="button button-primary" :to="`/projects/${project?.id}/create-drama`"
|
||||
>前往剧本创作<ArrowRight :size="14" /></RouterLink
|
||||
></EmptyState>
|
||||
</NScrollbar>
|
||||
<template v-else>
|
||||
<NScrollbar v-if="execution?.errorMessage || (validation && !validation.valid)" class="workspace-feedback">
|
||||
<NAlert v-if="execution?.errorMessage" role="alert" type="error" :show-icon="false">{{
|
||||
execution.errorMessage
|
||||
}}</NAlert>
|
||||
<NAlert v-if="validation && !validation.valid" type="error" :show-icon="false" class="mt-4"
|
||||
><p class="font-medium">分镜校验未通过</p>
|
||||
<ul class="mt-2 list-inside list-disc space-y-1">
|
||||
<li v-for="(issue, index) in validation.issues" :key="index">
|
||||
第 {{ issue.episodeNo }} 集<span v-if="issue.beatNo"> / Beat {{ issue.beatNo }}</span
|
||||
><span v-if="issue.shotNo"> / Shot {{ issue.shotNo }}</span
|
||||
>:{{ issue.message }}
|
||||
</li>
|
||||
</ul></NAlert
|
||||
>
|
||||
<div v-if="showRecovery" class="recovery-strip mt-4">
|
||||
<div>
|
||||
<p class="text-sm font-medium">从中断处继续</p>
|
||||
<p class="mt-1 text-xs leading-5 text-muted">
|
||||
抽取失败、镜头缺失、主体绑定异常分别处理。禁用表示近期 checkpoint 不具备所需数据。
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<ConfirmAction
|
||||
label="重试失败抽取"
|
||||
description="只重试 character / scene / prop 抽取任务中的失败项。不能用于镜头阶段失败。"
|
||||
acknowledgement
|
||||
:disabled="!recovery.retry || operation.pending || !!error"
|
||||
@confirm="run('retry')"
|
||||
/><ConfirmAction
|
||||
label="补齐缺失镜头"
|
||||
description="复用已完成剧集的镜头,仅生成尚未完成的 Episode Shot,再进行校验与入库。"
|
||||
acknowledgement
|
||||
:disabled="!recovery.shots || operation.pending || !!error"
|
||||
@confirm="run('resume-shots')"
|
||||
/><ConfirmAction
|
||||
label="修复分镜绑定"
|
||||
description="复用已有镜头,修复 SubjectRef 与视觉 Form 绑定,再校验并保存。"
|
||||
acknowledgement
|
||||
:disabled="!recovery.storyboard || operation.pending || !!error"
|
||||
@confirm="run('resume-storyboard')"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="mt-7">
|
||||
<NAlert v-if="validation && !validation.valid" role="alert" type="error" :show-icon="false">
|
||||
分镜校验未通过,共 {{ validation.issues.length }} 项问题。
|
||||
<NButton text @click="toolsOpen = true">查看详情与恢复操作</NButton>
|
||||
</NAlert>
|
||||
</NScrollbar>
|
||||
<section class="breakdown-results-section">
|
||||
<div class="result-toolbar">
|
||||
<NTabs v-model:value="tab" type="line" size="small" aria-label="拆解结果"
|
||||
><NTab v-for="option in moduleOptions" :key="option.value" :name="option.value"
|
||||
@@ -324,75 +371,83 @@ function exportResult() {
|
||||
><Download :size="14" />导出 JSON
|
||||
</NButton>
|
||||
</div>
|
||||
<div class="content-with-history panel mt-4">
|
||||
<div class="content-with-history panel">
|
||||
<main class="min-w-0">
|
||||
<template v-for="option in moduleOptions" :key="option.value"
|
||||
><div v-if="tab === option.value">
|
||||
<SubjectList
|
||||
:project-id="project?.id"
|
||||
:subjects="subjects.filter(item => item.module === option.value)"
|
||||
:forms="forms"
|
||||
/></div
|
||||
></template>
|
||||
<div v-if="tab === 'storyboard'">
|
||||
<div class="mb-4 flex justify-end">
|
||||
<RouterLink :to="`/projects/${project?.id}/storyboard`" class="text-button"
|
||||
>进入分镜设计<ArrowRight :size="14"
|
||||
/></RouterLink>
|
||||
<!-- 所有结果标签共用有界的内容滚动;切换标签回到顶部,不继承上一列表的位置。 -->
|
||||
<NScrollbar :key="tab" class="panel-scroll breakdown-results-scroll">
|
||||
<template v-for="option in moduleOptions" :key="option.value"
|
||||
><div v-if="tab === option.value">
|
||||
<SubjectList
|
||||
:project-id="project?.id"
|
||||
:subjects="subjects.filter(item => item.module === option.value)"
|
||||
:forms="forms"
|
||||
/></div
|
||||
></template>
|
||||
<div v-if="tab === 'storyboard'">
|
||||
<div class="mb-4 flex justify-end">
|
||||
<RouterLink :to="`/projects/${project?.id}/storyboard`" class="text-button"
|
||||
>进入分镜设计<ArrowRight :size="14"
|
||||
/></RouterLink>
|
||||
</div>
|
||||
<StoryboardList :plans="plans" :episodes="shots" />
|
||||
</div>
|
||||
<StoryboardList :plans="plans" :episodes="shots" />
|
||||
</div>
|
||||
<div v-if="tab === 'tasks'" class="p-5">
|
||||
<NScrollbar x-scrollable v-if="snapshot?.tasks?.length" class="table-scroll">
|
||||
<NTable :single-line="false" class="project-table"
|
||||
><thead>
|
||||
<tr>
|
||||
<th>分组</th>
|
||||
<th>模块</th>
|
||||
<th>状态</th>
|
||||
<th>尝试</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="task in snapshot.tasks" :key="task.taskId"
|
||||
><tr>
|
||||
<td>
|
||||
第 {{ task.group.startEpisodeNo }}–{{ task.group.endEpisodeNo }} 集
|
||||
</td>
|
||||
<td>
|
||||
{{ moduleOptions.find(item => item.value === task.module)?.label }}
|
||||
</td>
|
||||
<td>
|
||||
<StatusBadge
|
||||
:status="task.status"
|
||||
:label="
|
||||
{
|
||||
pending: '等待中',
|
||||
running: '执行中',
|
||||
completed: '完成',
|
||||
failed: '失败'
|
||||
}[task.status]
|
||||
"
|
||||
/>
|
||||
</td>
|
||||
<td>{{ task.attempt }}</td>
|
||||
<div v-if="tab === 'tasks'" class="p-5">
|
||||
<NScrollbar x-scrollable v-if="snapshot?.tasks?.length" class="table-scroll">
|
||||
<NTable :single-line="false" class="project-table"
|
||||
><thead>
|
||||
<tr>
|
||||
<th>分组</th>
|
||||
<th>模块</th>
|
||||
<th>状态</th>
|
||||
<th>尝试</th>
|
||||
</tr>
|
||||
<tr v-if="task.errorMessage">
|
||||
<td colspan="4" class="text-danger">{{ task.errorMessage }}</td>
|
||||
</tr></template
|
||||
>
|
||||
</tbody></NTable
|
||||
>
|
||||
</NScrollbar>
|
||||
<EmptyState
|
||||
v-else
|
||||
title="尚无抽取任务记录"
|
||||
description="启动拆解后,任务会在后端保存 checkpoint 时更新。预览中的任务尚未执行。"
|
||||
/>
|
||||
</div>
|
||||
</thead>
|
||||
<tbody>
|
||||
<template v-for="task in snapshot.tasks" :key="task.taskId"
|
||||
><tr>
|
||||
<td>
|
||||
第 {{ task.group.startEpisodeNo }}–{{ task.group.endEpisodeNo }}
|
||||
集
|
||||
</td>
|
||||
<td>
|
||||
{{
|
||||
moduleOptions.find(item => item.value === task.module)
|
||||
?.label
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
<StatusBadge
|
||||
:status="task.status"
|
||||
:label="
|
||||
{
|
||||
pending: '等待中',
|
||||
running: '执行中',
|
||||
completed: '完成',
|
||||
failed: '失败'
|
||||
}[task.status]
|
||||
"
|
||||
/>
|
||||
</td>
|
||||
<td>{{ task.attempt }}</td>
|
||||
</tr>
|
||||
<tr v-if="task.errorMessage">
|
||||
<td colspan="4" class="text-danger">{{ task.errorMessage }}</td>
|
||||
</tr></template
|
||||
>
|
||||
</tbody></NTable
|
||||
>
|
||||
</NScrollbar>
|
||||
<EmptyState
|
||||
v-else
|
||||
title="尚无抽取任务记录"
|
||||
description="启动拆解后,任务会在后端保存 checkpoint 时更新。预览中的任务尚未执行。"
|
||||
/>
|
||||
</div>
|
||||
</NScrollbar>
|
||||
</main>
|
||||
<HistoryPanel :checkpoints="checkpoints" workflow="breakdown" />
|
||||
</div>
|
||||
</div> </template
|
||||
></WorkspacePage>
|
||||
</section>
|
||||
</template>
|
||||
</WorkspacePage>
|
||||
</template>
|
||||
Reference in new issue
Block a user