feat(short-drama-agent-front): 接入正式审核执行历史

This commit is contained in:
GJ committed 2026-11-07 14:03:38 +08:00
1 parent 518b630a46
commit c808a58a3f
17 files changed
+1129 -175

No files matched your search

@@ -8,10 +8,15 @@ import { userFacingText } from '../../../lib/user-facing-text'
import { formatDate } from '../../../lib/format'
/** 单次视觉审核执行状态,完成和质量通过分别表达。 */
const props = defineProps<{
/** 正式执行记录。 */ execution: WorkflowExecution
/** 只读刷新状态。 */ loading: boolean
}>()
const props = withDefaults(
defineProps<{
/** 正式执行记录。 */ execution: WorkflowExecution
/** 只读刷新状态。 */ loading: boolean
/** 历史记录与当前观察使用不同标题。 */ title?: string
/** 历史列表统一刷新,不对每行重复放置按钮。 */ refreshable?: boolean
}>(),
{ title: '当前审核执行', refreshable: true }
)
/** 仅触发只读刷新。 */
const emit = defineEmits<{ refresh: [] }>()
/** 只有明确质量通过且未标记恢复才使用成功语义。 */
@@ -26,26 +31,40 @@ const passed = computed(
const label = computed(() => {
if (passed.value) return '审核质量通过'
if (props.execution.status === 'failed') return '执行失败,质量未确认'
if (props.execution.status === 'completed')
return props.execution.result?.passed === false ? '执行完成,质量未通过' : '执行完成,质量待核对'
return props.execution.status === 'pending' ? '等待审核' : '审核进行中'
if (props.execution.status === 'completed') {
const quality = props.execution.result?.qualityDecision
const labels: Record<string, string> = {
failed: '质量未通过',
needs_review: '质量待复核',
stale: '审核来源已失效',
blocked: '质量受阻',
insufficient_evidence: '证据不足'
}
return `执行完成,${typeof quality === 'string' && labels[quality] ? labels[quality] : props.execution.result?.passed === false ? '质量未通过' : '质量待核对'}`
}
return props.execution.status === 'pending'
? '等待审核'
: props.execution.status === 'running'
? '审核进行中'
: '状态待确认'
})
</script>
<template>
<!-- 以下是正式执行与实际质量结论模块,不用满格绿色进度暗示通过 -->
<section class="mt-4 space-y-2 text-sm" role="status" :class="passed ? 'bg-(--app-success-soft) p-3' : ''">
<WorkspaceSectionHeading title="当前审核执行"
<WorkspaceSectionHeading :title="title"
><template #actions
><NButton :loading="loading" @click="emit('refresh')">刷新进度</NButton></template
><NButton v-if="refreshable" :loading="loading" @click="emit('refresh')">刷新进度</NButton></template
></WorkspaceSectionHeading
>
<p>{{ label }} · {{ executionStageLabel(execution.stage) }}</p>
<p v-if="execution.total > 0">已处理步骤:{{ execution.current }} / {{ execution.total }}</p>
<p v-if="execution.total > 0">审核计划进度:{{ execution.current }} / {{ execution.total }}</p>
<p v-else>尚无可确认的步骤进度。</p>
<p class="wrap-anywhere text-xs text-muted">
执行编号:{{ execution.id }} · {{ formatDate(execution.updatedAt) }}
</p>
<p v-if="typeof execution.result?.summary === 'string'">{{ userFacingText(execution.result.summary) }}</p>
<p v-if="execution.error">{{ userFacingText(execution.error) }}</p>
</section>
</template>