feat(short-drama-agent-front): 完善质量规则确认与中文交互

This commit is contained in:
GJ committed 2026-10-17 22:09:28 +08:00
1 parent 190333d4f9
commit c4b43b9725
85 files changed
+2059 -480

No files matched your search

@@ -1,4 +1,5 @@
<script setup lang="ts">
import { userFacingText } from '../../lib/user-facing-text'
import ContextNotice from '../../components/ui/ContextNotice.vue'
import { computed, ref, watch } from 'vue'
@@ -6,7 +7,7 @@ import { NButton, NCollapse, NCollapseItem, NInput, NSelect, NTab, NTabs } from
import { Download, Search } from '@lucide/vue'
import { AppDialog, EmptyState } from '../../components/ui'
import { usePolling } from '../../composables/usePolling'
import { downloadText, formatDate, nodeLabel } from '../../lib/format'
import { downloadText, formatDate, nodeLabel, workflowLabel } from '../../lib/format'
import { loadWorkflowDiagnostics } from './diagnostics'
import type { Checkpoint } from './types'
@@ -21,8 +22,8 @@ const workflow = ref('all')
const search = ref('')
const checkpointMap = computed(() => new Map(props.checkpoints.map(item => [item.checkpointId, item])))
const options = computed(() => [
{ label: '全部工作流', value: 'all' },
...[...new Set(props.checkpoints.map(item => item.workflowName))].map(value => ({ label: value, value }))
{ label: '全部制作任务', value: 'all' },
...[...new Set(props.checkpoints.map(item => item.workflowName))].map(value => ({ label: workflowLabel(value), value }))
])
const groups = computed(() =>
(query.data.value?.groups ?? [])
@@ -67,12 +68,12 @@ function exportReport() {
<template>
<AppDialog
v-model:open="open"
title="工作流运行诊断"
description="展示全项目已保存的 checkpoint 指标与完整时间线,不启动或恢复任务。"
title="制作任务记录"
description="查看这个项目的任务记录、耗时和处理顺序,不会启动或恢复任务。"
wide
>
<ContextNotice type="info" :show-icon="false" class="mt-4 text-xs"
>后端指标按保存记录累计;耗时之和不等于实际墙钟耗时,“completed”也不代表图片或视频成功。生产任务状态请以资产页面为准。</ContextNotice
>这里统计的是已保存的处理记录,累计耗时可能与实际等待时间不同。步骤结束也不代表图片或视频已生成,请以素材页的实际结果为准。</ContextNotice
>
<ContextNotice v-if="query.error.value" role="alert" type="error" :show-icon="false" class="mt-3"
>{{ query.error.value }},当前保留上次数据。</ContextNotice
@@ -105,11 +106,11 @@ function exportReport() {
<NInput
v-model:value="search"
clearable
placeholder="搜索节点或 checkpoint"
placeholder="搜索制作步骤或保存记录"
:input-props="{ 'aria-label': '搜索运行记录' }"
><template #prefix><Search :size="14" /></template
></NInput>
<NSelect v-model:value="workflow" :options="options" aria-label="筛选工作流" />
<NSelect v-model:value="workflow" :options="options" aria-label="筛选制作任务" />
<span class="text-xs text-muted">{{ nodes.length }} 条记录</span>
</div>
<NTabs v-model:value="tab" type="line" class="mt-3"
@@ -126,7 +127,7 @@ function exportReport() {
>
</div>
<p class="mt-2 text-xs text-muted">
{{ checkpointMap.get(node.checkpointId)?.workflowName || '未标注工作流' }} · {{ node.phase }} ·
{{ workflowLabel(checkpointMap.get(node.checkpointId)?.workflowName) }} · {{ userFacingText(node.phase, '其他阶段') }} ·
{{ node.durationText }} · {{ formatDate(node.createdAt) }}
</p>
<p class="mt-2 break-all font-mono text-[11px] text-muted">{{ node.checkpointId }}</p>
@@ -137,13 +138,13 @@ function exportReport() {
v-for="group in groups"
:key="group.phase"
:name="group.phase"
:title="`${group.phase} · ${group.nodes.length} 条`"
:title="`${userFacingText(group.phase, '其他阶段')} · ${group.nodes.length} 条`"
>
<div class="diagnostics-records">
<article v-for="node in group.nodes" :key="node.checkpointId" class="surface-inset p-4">
<p class="text-sm">{{ nodeLabel(node.nodeName) }} · {{ node.durationText }}</p>
<p class="mt-2 text-xs text-muted">
{{ checkpointMap.get(node.checkpointId)?.workflowName || '未标注工作流' }} ·
{{ workflowLabel(checkpointMap.get(node.checkpointId)?.workflowName) }} ·
{{ recordLabel(node.checkpointId) }}
</p>
<p class="mt-2 break-all font-mono text-[11px] text-muted">{{ node.checkpointId }}</p>
@@ -154,7 +155,7 @@ function exportReport() {
<EmptyState
v-if="!query.loading.value && !nodes.length"
title="暂无匹配的运行记录"
description="可清空筛选后重试;尚未保存 checkpoint 的任务不会出现在时间线中。"
description="可清空筛选后重试;尚未保存进度的任务不会出现在时间线中。"
/>
</AppDialog>
</template>