迁移质检与审核页签:质检清单/画面质检面板/审核表单/留痕
parent
88a05eb189
commit
8b9f8ebaa5
|
|
@ -1,4 +1,525 @@
|
|||
/** 待迁移:质检与审核(占位,见 .local/vue-ref/src/views/tabs/Review.vue) */
|
||||
/**
|
||||
* 质检与审核(图2 节点 ⑨ quality_check → ⑩ review → ⑪ revise 回路)
|
||||
* - 自动质检:解码完整性 / 时长偏差 / 分辨率 / 帧率 / 码率 / 黑屏 / 画面冻结
|
||||
* - 画面质检:大模型看判定帧,识别人物穿帮与镜头瑕疵
|
||||
* - 人工审核:合格 → 进入时间线;不合格 → 改写提示词并重新生成
|
||||
*/
|
||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||
import { useSearchParams } from 'react-router-dom'
|
||||
import * as api from '../../api/client'
|
||||
import { fmtTime, opt, reviewBadge, statusLabel } from '../../lib/format'
|
||||
import { fromShot, normalize } from '../../lib/media'
|
||||
import { useAutoRefresh } from '../../hooks'
|
||||
import { Select } from '../../components/forms'
|
||||
import { AudioPlay } from '../../components/media/AudioPlay'
|
||||
import { MediaThumb } from '../../components/media/MediaThumb'
|
||||
import {
|
||||
Actions, Between, Button, Check, Chip, ChipBar, Ctlbar, Divider, Empty, ErrorText, Field, FieldBlock,
|
||||
FormRow, Grid, Layout, LineHint, MONO, MUTED, MUTED_MONO, Panel, PanelHead, ProgressBar, Row,
|
||||
Spinner, Status, TabStack, Table, TableBox, Tag, cellCenter, cellRight, cellWrap
|
||||
} from '../../components/ui'
|
||||
import { refresh, useProjectStore } from '../../stores/project'
|
||||
import { notify } from '../../stores/notice'
|
||||
import { openPreview } from '../../stores/preview'
|
||||
|
||||
const KIND_OPTIONS = [
|
||||
{ value: '', label: '全部记录' },
|
||||
{ value: 'auto', label: '仅自动质检' },
|
||||
{ value: 'manual', label: '仅人工审核' }
|
||||
]
|
||||
const EMPTY_CELL = 'text-center py-[22px] leading-[1.7]'
|
||||
/** 检查项表固定列宽:右栏只有 ~460px,五列自动布局会把「标准」挤出容器 */
|
||||
const CHECK_COLS = ['w-[19%]', 'w-[13%] whitespace-nowrap', 'w-[28%]', 'w-[8%]', 'w-[32%]']
|
||||
const VISUAL_COLS = ['w-[22%]', 'w-[13%]', 'w-[17%]', 'w-[48%]']
|
||||
|
||||
/** 画面质检(大模型看图):checks 里 key 以 visual. 开头的都是它的结论 */
|
||||
const isVisual = (c: any) => { const k = String(c?.key || ''); return k.startsWith('visual.') || k === 'visual_error' }
|
||||
const visualShortLabel = (c: any) => String(c?.label || '').replace(/^画面质检·/, '')
|
||||
const visualVerdict = (c: any) => (c.passed ? '合格' : c.severity === 'warning' ? '提醒' : '需返工')
|
||||
const visualTone = (c: any) => (c.passed ? 'ok' : c.severity === 'warning' ? 'warn' : 'bad')
|
||||
const seq = (shot: any) => (shot ? `镜头 ${String(shot.order_index ?? 0).padStart(2, '0')} · ${shot.code || 'SH' + shot.id} · shot#${shot.id}` : '')
|
||||
|
||||
export default function Review() {
|
||||
return <div className="p-[26px] text-center text-faint text-body">质检与审核 迁移中…</div>
|
||||
const projectId = useProjectStore((s) => s.id)
|
||||
const [params] = useSearchParams()
|
||||
const [error, setError] = useState('')
|
||||
const [busy, setBusy] = useState('')
|
||||
const [qc, setQc] = useState<any>(null)
|
||||
const [shots, setShots] = useState<any[]>([])
|
||||
const [reviews, setReviews] = useState<any[]>([])
|
||||
const [kindFilter, setKindFilter] = useState('')
|
||||
const [selected, setSelected] = useState<number | null>(null)
|
||||
const [approve, setApprove] = useState({ notes: '', reviewer: 'studio' })
|
||||
const [reject, setReject] = useState({ notes: '', reviewer: 'studio', prompt: '', negative_prompt: '', regenerate: true, priority: 4 })
|
||||
|
||||
const rows: any[] = qc?.shots || []
|
||||
const byId = useMemo(() => {
|
||||
const map: Record<number, any> = {}
|
||||
shots.forEach((s) => { map[s.id] = s })
|
||||
return map
|
||||
}, [shots])
|
||||
const current = selected ? byId[selected] : null
|
||||
/**
|
||||
* 清单行的技术分。
|
||||
*
|
||||
* /qc 接口每行只带画面分(probe.visual_score),技术分在 shots[].qc.tech_score,
|
||||
* 两边按 shot_id 拼一下,避免列表里「画面 35 / 技术 —」这种半截结论。
|
||||
*/
|
||||
const techOf = (r: any) => byId[r.shot_id]?.qc?.tech_score ?? r.probe?.tech_score ?? null
|
||||
const checks: any[] = current?.qc?.checks || []
|
||||
const techChecks = checks.filter((c) => !isVisual(c))
|
||||
const visualChecks = checks.filter(isVisual)
|
||||
const shotQc = current?.qc || {}
|
||||
const visualProbe = shotQc.probe || {}
|
||||
const visualRan = visualProbe.visual_score !== null && visualProbe.visual_score !== undefined
|
||||
const visualScoreText = visualRan ? visualProbe.visual_score : '未检'
|
||||
const visualSkipNote = (() => {
|
||||
const skipped = visualChecks.find((c) => String(c.key).endsWith('.skipped'))
|
||||
if (skipped) return skipped.detail
|
||||
if (!visualChecks.length) return '该镜头还没跑过画面质检,点顶部「整批复检(含画面质检)」补上。'
|
||||
return ''
|
||||
})()
|
||||
const frameUrls: string[] = (visualProbe.visual_frames || []).filter(Boolean)
|
||||
const frameItems = frameUrls
|
||||
.map((url: string, i: number) => normalize(
|
||||
{ url, kind: 'image', exists: true, name: `判定帧 第 ${i + 1} 帧` },
|
||||
{ group: '画面质检', title: `${seq(current)} · 判定帧 第 ${i + 1} 帧` }))
|
||||
.filter(Boolean)
|
||||
/** 审核取证顺序:审片预览(平台配音)→ 模型原片 → 关键帧 → 尾帧 → 配音,←/→ 直接翻 */
|
||||
const currentQueue = useMemo(() => {
|
||||
if (!current) return []
|
||||
const wanted: Array<'preview' | 'output' | 'keyframe' | 'last_frame' | 'voiceover'> =
|
||||
current.preview_url ? ['preview', 'output', 'keyframe', 'last_frame', 'voiceover']
|
||||
: ['output', 'keyframe', 'last_frame', 'voiceover']
|
||||
return wanted.map((which) => fromShot(current, which)).filter(Boolean)
|
||||
}, [current])
|
||||
/** 取证条只列画面类素材:配音在下方有完整的播放条,缩略条里的 96px 音频块显示不全 */
|
||||
const evidenceStrips = currentQueue.map((m: any, i: number) => ({ m, i })).filter((x) => x.m.kind !== 'audio')
|
||||
const audioSourceHint = (() => {
|
||||
if (!current) return ''
|
||||
if (current.preview_url) return '主画面音轨 = 平台配音(IndexTTS2 声线),与成片一致'
|
||||
if (current.native_audio && current.voiceover_url) return '模型自带音轨与配音不一致时,请以此处下方配音为准;可点「封装审片预览」替换'
|
||||
if (current.voiceover_url) return '主画面无音轨,配音在下方试听'
|
||||
return '该镜头还没有配音'
|
||||
})()
|
||||
const generated = shots.filter((s) => s.output_exists)
|
||||
const approvable = rows.filter((r) => r.passed && !['pass'].includes(r.review_state))
|
||||
const rejected = shots.filter((s) => s.status === 'rejected')
|
||||
|
||||
const load = useCallback(async (silent = true) => {
|
||||
if (!projectId) return
|
||||
if (!silent) setBusy('读取质检结果')
|
||||
try {
|
||||
const [q, sh, rv] = await Promise.all([
|
||||
api.get(`/api/projects/${projectId}/qc`),
|
||||
api.get(`/api/projects/${projectId}/shots`),
|
||||
api.get(`/api/projects/${projectId}/reviews`, { kind: kindFilter })
|
||||
])
|
||||
const list: any[] = sh.shots || []
|
||||
setQc(q.qc)
|
||||
setShots(list)
|
||||
setReviews(rv.reviews || [])
|
||||
// 支持从分镜工作台带 ?shot= 直接跳到指定镜头;选中的镜头被删了就回到第一个
|
||||
const want = Number(params.get('shot') || 0)
|
||||
setSelected((cur) => {
|
||||
if (cur === null && want && list.some((s) => s.id === want)) return want
|
||||
if (cur === null && list.length) return list[0].id
|
||||
if (cur !== null && !list.some((s) => s.id === cur)) return list.length ? list[0].id : null
|
||||
return cur
|
||||
})
|
||||
setError('')
|
||||
} catch (exc: any) { setError(exc?.message || String(exc)) }
|
||||
finally { setBusy('') }
|
||||
}, [projectId, kindFilter, params])
|
||||
|
||||
useEffect(() => { void load(false) }, [load])
|
||||
useAutoRefresh(() => void load(), 12000, !!busy, !!busy)
|
||||
|
||||
async function run(label: string, fn: () => Promise<any>, message?: (res: any) => string) {
|
||||
setBusy(label); setError('')
|
||||
try {
|
||||
const res = await fn()
|
||||
const text = message ? message(res) : ''
|
||||
if (text) notify(text)
|
||||
await Promise.all([load(), refresh()])
|
||||
return res
|
||||
} catch (exc: any) { setError(exc?.message || String(exc)); return null }
|
||||
finally { setBusy('') }
|
||||
}
|
||||
|
||||
/** 单镜头重新质检:入队并同步排空(inline 模式可直接拿到结果) */
|
||||
const reQc = (shotId: number) => run('质检镜头', () => api.post(`/api/projects/${projectId}/shots/${shotId}/qc?drain=true`, {}),
|
||||
(r) => `质检完成:${r?.score ?? '—'} 分`)
|
||||
|
||||
const approveShot = () => run('审核通过', () => api.post(`/api/projects/${projectId}/shots/${selected}/approve`, {
|
||||
notes: approve.notes, reviewer: approve.reviewer
|
||||
}), () => `镜头 ${current?.code} 已通过审核`)
|
||||
|
||||
const rejectShot = () => run('驳回并重新生成', () => api.post(`/api/projects/${projectId}/shots/${selected}/reject`, {
|
||||
notes: reject.notes, reviewer: reject.reviewer,
|
||||
prompt: reject.prompt.trim() || null, negative_prompt: reject.negative_prompt.trim() || null,
|
||||
regenerate: reject.regenerate, priority: reject.priority
|
||||
}), (r) => reject.regenerate
|
||||
? `镜头已驳回,重新生成任务 ${r?.requeue?.created?.count ?? 0} 个(可在调度中心派发)`
|
||||
: '镜头已驳回')
|
||||
|
||||
async function approveAll() {
|
||||
if (!approvable.length) { setError('没有「质检通过且待审核」的镜头'); return }
|
||||
setBusy(`批量放行 ${approvable.length} 个镜头`); setError('')
|
||||
let ok = 0
|
||||
const failures: string[] = []
|
||||
for (const row of approvable) {
|
||||
try {
|
||||
await api.post(`/api/projects/${projectId}/shots/${row.shot_id}/approve`, { notes: '批量放行:自动质检通过', reviewer: 'studio' })
|
||||
ok += 1
|
||||
} catch (exc: any) { failures.push(`#${row.order_index} ${exc.message}`) }
|
||||
}
|
||||
setBusy('')
|
||||
await Promise.all([load(), refresh()])
|
||||
notify(`已放行 ${ok} 个镜头${failures.length ? `,失败 ${failures.length} 个:${failures[0]}` : ''}`)
|
||||
}
|
||||
|
||||
/** 整批复检:走后端 qc/run 批量入队,含画面质检;drain=false 交给调度派发,前端自动刷新轮询 */
|
||||
const recheckAll = () => run(`整批复检 ${generated.length} 个镜头`,
|
||||
() => api.post(`/api/projects/${projectId}/qc/run`, { include_approved: true, drain: false }),
|
||||
(r) => `已提交 ${r?.task_ids?.length ?? generated.length} 个镜头的整批复检(含画面质检),跑完后列表自动刷新`)
|
||||
|
||||
async function qcAll() {
|
||||
if (!generated.length) { setError('还没有生成产物,无法质检'); return }
|
||||
setBusy(`全量质检 ${generated.length} 个镜头`); setError('')
|
||||
let ok = 0
|
||||
for (const s of generated) {
|
||||
try { await api.post(`/api/projects/${projectId}/shots/${s.id}/qc?drain=true`, {}); ok += 1 } catch { /* 单镜头失败不中断整体 */ }
|
||||
}
|
||||
setBusy('')
|
||||
await Promise.all([load(), refresh()])
|
||||
notify(`已完成 ${ok} 个镜头的自动质检`)
|
||||
}
|
||||
|
||||
/** 审片预览:画面不变,只把音轨换成平台配音 */
|
||||
async function buildPreview(shot: any) {
|
||||
if (!shot?.id) return
|
||||
setBusy('封装审片预览')
|
||||
try {
|
||||
await api.post(`/api/projects/${projectId}/shots/${shot.id}/preview`, { force: true, actor: 'review' })
|
||||
notify('审片预览已封装:画面不变,声音换成平台配音')
|
||||
await load(true)
|
||||
} catch (e: any) {
|
||||
notify(e?.message || '封装审片预览失败')
|
||||
} finally {
|
||||
setBusy('')
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<TabStack>
|
||||
<Between>
|
||||
<Row>
|
||||
<Chip as="span">已质检 {qc?.checked ?? 0}</Chip>
|
||||
<Chip as="span">通过 {qc?.passed ?? 0}</Chip>
|
||||
<Chip as="span">不合格 {qc?.failed ?? 0}</Chip>
|
||||
<Chip as="span">平均分 {qc?.average_score ?? '—'}</Chip>
|
||||
<Chip as="span">待人工审核 {approvable.length}</Chip>
|
||||
<Chip as="span">被驳回 {rejected.length}</Chip>
|
||||
</Row>
|
||||
<Row>
|
||||
{busy ? <span className={MUTED}><Spinner /> {busy}…</span> : null}
|
||||
<Button variant="outline" size="sm" disabled={!!busy} onClick={qcAll}>↻ 全量重跑质检</Button>
|
||||
<Button variant="outline" size="sm" disabled={!!busy} onClick={recheckAll}
|
||||
title="对所有已生成产物重新质检:技术指标 + 大模型看图判定人物/穿帮/镜头瑕疵">👁 整批复检(含画面质检)</Button>
|
||||
<Button variant="primary" size="sm" disabled={!!busy || !approvable.length} onClick={approveAll}
|
||||
title={busy ? '有任务正在执行,请稍候'
|
||||
: approvable.length ? `${approvable.length} 个镜头质检通过且待人工审核`
|
||||
: '没有可放行的镜头:需要「质检通过」且「人工未放行」;若已全部放行,此处会保持置灰'}>✓ 批量放行质检合格镜头</Button>
|
||||
</Row>
|
||||
</Between>
|
||||
<ErrorText>{error}</ErrorText>
|
||||
|
||||
<Layout>
|
||||
{/* ===== 自动质检清单 ===== */}
|
||||
<Panel>
|
||||
<PanelHead eyebrow="PIPELINE · 质量检查"
|
||||
title={<span title="质检项由 QC_THRESHOLD 与镜头目标时长/分辨率决定;不合格项会阻塞时间线,需驳回重做。">自动质检清单</span>}
|
||||
right={<span className={MUTED}>产物 {generated.length} / 镜头 {shots.length}</span>} />
|
||||
<TableBox maxHeight={520}>
|
||||
<Table pickable minWidth={820}>
|
||||
<thead>
|
||||
<tr><th className={`${cellCenter} w-[34px]`}>#</th><th>镜头</th><th>状态</th>
|
||||
<th className={cellRight}>得分</th><th>问题</th><th className={cellRight}>操作</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map((r: any) => {
|
||||
const shot = byId[r.shot_id]
|
||||
const mark = reviewBadge(shot)
|
||||
return (
|
||||
<tr key={r.shot_id} data-chosen={selected === r.shot_id || undefined} onClick={() => setSelected(r.shot_id)}>
|
||||
<td className={cellCenter}><b>{r.order_index}</b></td>
|
||||
<td>{r.title}
|
||||
<div className={MUTED_MONO}>shot#{r.shot_id} · {r.probe?.width || '?'}×{r.probe?.height || '?'} · {r.probe?.duration ? `${r.probe.duration.toFixed(2)}s` : '—'}</div>
|
||||
</td>
|
||||
<td><Status value={r.status} />
|
||||
{r.review_state && r.review_state !== 'pending'
|
||||
? <div className="mt-1">
|
||||
<Tag tone={(mark?.tone as any) || (r.review_state === 'pass' ? 'ok' : 'bad')}
|
||||
title={shot?.review_notes || ''}>
|
||||
{mark?.text || (r.review_state === 'pass' ? '人工合格' : '人工不合格')}
|
||||
</Tag>
|
||||
</div>
|
||||
: null}
|
||||
</td>
|
||||
<td className={cellRight}>
|
||||
<b className={MONO}>{r.score === null ? '—' : r.score}</b>
|
||||
<ProgressBar className="mt-1" value={Math.max(0, Math.min(100, Number(r.score || 0)))} bad={!r.passed} />
|
||||
{r.probe?.visual_score !== null && r.probe?.visual_score !== undefined
|
||||
? <div className={`${MUTED_MONO} text-[10px]`}>画面 {r.probe.visual_score} / 技术 {techOf(r) ?? '—'}</div>
|
||||
: <div className={`${MUTED} text-[10px]`}>画面未检</div>}
|
||||
</td>
|
||||
<td className={cellWrap}>
|
||||
{!r.issues?.length && !r.warnings?.length ? <span className={MUTED}>无</span> : null}
|
||||
{(r.issues || []).map((x: string) => <div key={`i${x}`} className="text-danger">{x}</div>)}
|
||||
{(r.warnings || []).map((x: string) => <div key={`w${x}`} className={MUTED}>⚠ {x}</div>)}
|
||||
</td>
|
||||
<td className={cellRight}>
|
||||
<Button variant="outline" size="sm" disabled={!!busy || !shot?.output_exists}
|
||||
onClick={(e) => { e.stopPropagation(); reQc(r.shot_id) }}>重跑</Button>
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
})}
|
||||
{!rows.length ? <tr><td colSpan={6} className={`${MUTED} ${EMPTY_CELL}`}>项目还没有镜头。</td></tr> : null}
|
||||
</tbody>
|
||||
</Table>
|
||||
</TableBox>
|
||||
</Panel>
|
||||
|
||||
{/* ===== 人工审核 ===== */}
|
||||
<Panel>
|
||||
<PanelHead eyebrow="PIPELINE · 人工审核 / 修改重生成" title="人工审核"
|
||||
right={current
|
||||
? <span className={MUTED_MONO} title="审核记录按 shot_id 关联,避免把 review id 当镜号">{seq(current)}</span>
|
||||
: undefined} />
|
||||
{!current ? <Empty>在左侧选择一个镜头开始审核。</Empty> : (
|
||||
<>
|
||||
{current.output_url
|
||||
? <MediaThumb item={currentQueue[0]} size="lg" queue={currentQueue} index={0} radius={10}
|
||||
title={current.preview_url ? '审片预览(平台配音)' : '成片预览'} />
|
||||
: <Empty>该镜头还没有生成产物,请先在调度中心生成。</Empty>}
|
||||
|
||||
{current.output_url
|
||||
? <ChipBar top>
|
||||
{/* 音源提示是一整句话: nowrap 的 chip 在 341px 的右栏里会顶出整页横向滚动,
|
||||
所以这一条单独允许折行、允许被压缩(其它短状态标签仍保持单行)。 */}
|
||||
<Tag tone={current.preview_url ? 'ok' : 'warn'}
|
||||
className="min-w-0 max-w-full shrink whitespace-normal text-left leading-[1.55]">{audioSourceHint}</Tag>
|
||||
{current.voiceover_url && !current.preview_url && current.native_audio
|
||||
? <Button variant="outline" size="sm" disabled={!!busy} onClick={() => buildPreview(current)}>封装审片预览(用平台配音替换模型原声)</Button> : null}
|
||||
{current.preview_url
|
||||
? <Button variant="outline" size="sm" disabled={!!busy} onClick={() => buildPreview(current)}>重新封装预览</Button> : null}
|
||||
</ChipBar>
|
||||
: null}
|
||||
|
||||
{evidenceStrips.length > 1
|
||||
? <div className="mt-[10px] flex flex-wrap gap-2">
|
||||
{evidenceStrips.map(({ m, i }: any) => (
|
||||
<button key={m.key} type="button" onClick={() => openPreview(currentQueue, i)}
|
||||
className="group flex w-24 flex-col gap-1 border-0 bg-transparent p-0 text-left hover:[&_span]:text-accent-bright">
|
||||
<MediaThumb item={m} size="sm" clickable={false} radius={6} />
|
||||
<span className="text-[10px] text-faint">{m.kindLabel}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
: null}
|
||||
|
||||
{current.voiceover_url
|
||||
? <div className="mt-[10px]">
|
||||
<AudioPlay src={current.voiceover_url} label={`${current.title || current.code} 配音`}
|
||||
durationMs={current.voiceover_duration_ms} hint="审核可边听边核对口型与台词" />
|
||||
</div>
|
||||
: null}
|
||||
|
||||
<ChipBar top>
|
||||
<Status value={current.status} />
|
||||
<Chip as="span">目标 {current.duration}s</Chip>
|
||||
<Chip as="span">模式 {opt('mode', current.mode)}</Chip>
|
||||
<Chip as="span">{current.effective_provider} / {current.effective_model || '默认'}</Chip>
|
||||
<Chip as="span">尝试 {current.attempts} 次</Chip>
|
||||
{current.voiceover_url ? <Tag tone="ok">已有配音</Tag> : null}
|
||||
</ChipBar>
|
||||
|
||||
{checks.length ? (
|
||||
<>
|
||||
<ChipBar>
|
||||
<Chip as="span">总分 <b className={MONO}>{shotQc.score ?? '—'}</b></Chip>
|
||||
<Chip as="span">技术 <b className={MONO}>{shotQc.tech_score ?? '—'}</b></Chip>
|
||||
<Tag tone={!visualRan ? 'warn' : Number(shotQc.visual_score) >= 80 ? 'ok' : 'bad'}>画面 <b className={MONO}>{visualScoreText}</b></Tag>
|
||||
{visualProbe.visual_model ? <Chip as="span" className={MUTED_MONO}>{visualProbe.visual_model}</Chip> : null}
|
||||
{visualProbe.visual_cast?.length
|
||||
? <Chip as="span">出场:{visualProbe.visual_cast.map((c: any) => `${c.name}${(c.frames || []).length ? `(${c.frames.join(',')})` : '·未出现'}`).join('、')}</Chip>
|
||||
: null}
|
||||
</ChipBar>
|
||||
|
||||
{visualChecks.length || visualRan
|
||||
? <VisualQc probe={visualProbe} checks={visualChecks} frames={frameUrls} frameItems={frameItems} note={visualSkipNote} />
|
||||
: null}
|
||||
|
||||
{techChecks.length
|
||||
? <>
|
||||
<h3 className="mt-[14px] mb-3 text-ui">📐 技术指标</h3>
|
||||
<CheckTable items={techChecks} cols={CHECK_COLS} />
|
||||
</>
|
||||
: null}
|
||||
</>
|
||||
) : null}
|
||||
|
||||
<Divider />
|
||||
<Grid cols={2} oneAt="narrow">
|
||||
<div>
|
||||
<h3 className="m-0 mb-2 text-ui">✓ 合格</h3>
|
||||
<FormRow>
|
||||
<Field label="审核人"><input value={approve.reviewer} onChange={(e) => setApprove((f) => ({ ...f, reviewer: e.target.value }))} /></Field>
|
||||
</FormRow>
|
||||
<FieldBlock label="备注">
|
||||
<textarea rows={2} placeholder="例如:构图与角色一致性合格"
|
||||
value={approve.notes} onChange={(e) => setApprove((f) => ({ ...f, notes: e.target.value }))} />
|
||||
</FieldBlock>
|
||||
<Actions><Button variant="primary" size="sm" disabled={!!busy || !current.output_exists} onClick={approveShot}>标记合格</Button></Actions>
|
||||
</div>
|
||||
<div>
|
||||
<h3 className="m-0 mb-2 text-ui">✕ 不合格(可改提示词重做)</h3>
|
||||
<FormRow>
|
||||
<Field label="审核人"><input value={reject.reviewer} onChange={(e) => setReject((f) => ({ ...f, reviewer: e.target.value }))} /></Field>
|
||||
</FormRow>
|
||||
<FieldBlock label="问题描述">
|
||||
<textarea rows={2} placeholder="例如:角色发型与原画不一致"
|
||||
value={reject.notes} onChange={(e) => setReject((f) => ({ ...f, notes: e.target.value }))} />
|
||||
</FieldBlock>
|
||||
<FieldBlock label="覆盖提示词(可选)">
|
||||
<textarea rows={2} placeholder="留空则沿用原提示词"
|
||||
value={reject.prompt} onChange={(e) => setReject((f) => ({ ...f, prompt: e.target.value }))} />
|
||||
</FieldBlock>
|
||||
<FormRow>
|
||||
<Field label="覆盖负面提示词(可选)" width="full">
|
||||
<input value={reject.negative_prompt} onChange={(e) => setReject((f) => ({ ...f, negative_prompt: e.target.value }))} />
|
||||
</Field>
|
||||
</FormRow>
|
||||
<Check checked={reject.regenerate} onChange={(v) => setReject((f) => ({ ...f, regenerate: v }))}>立即重新入队生成</Check>
|
||||
{reject.regenerate
|
||||
? <FormRow className="mt-[10px]">
|
||||
<Field label={<span title="数字越小越先派发;重做会强制覆盖已有产物,配音任务排在生成之前">任务优先级</span>}>
|
||||
<input type="number" min={0} max={9} value={reject.priority}
|
||||
onChange={(e) => setReject((f) => ({ ...f, priority: Number(e.target.value) }))} />
|
||||
</Field>
|
||||
</FormRow>
|
||||
: null}
|
||||
<Actions><Button variant="secondary" size="sm" disabled={!!busy} onClick={rejectShot}>驳回</Button></Actions>
|
||||
</div>
|
||||
</Grid>
|
||||
</>
|
||||
)}
|
||||
</Panel>
|
||||
</Layout>
|
||||
|
||||
{/* ===== 审核留痕 ===== */}
|
||||
<Panel>
|
||||
<PanelHead eyebrow="REVIEW LOG" title="审核留痕"
|
||||
right={<Ctlbar className="mb-0">
|
||||
<Field label="类型" width="narrow">
|
||||
<Select size="sm" ariaLabel="审核记录类型筛选" value={kindFilter} onChange={setKindFilter} options={KIND_OPTIONS} />
|
||||
</Field>
|
||||
</Ctlbar>} />
|
||||
<TableBox maxHeight={320}>
|
||||
<Table minWidth={900}>
|
||||
<thead>
|
||||
<tr><th className={cellCenter}>时间</th><th className={cellCenter}>类型</th><th>镜头</th>
|
||||
<th className={cellCenter}>结论</th><th className={cellRight}>得分</th><th>审核人</th><th>说明</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{reviews.map((rv: any) => (
|
||||
<tr key={rv.id}>
|
||||
<td className={`${cellCenter} ${MUTED_MONO}`}>{fmtTime(rv.created_at)}</td>
|
||||
<td className={cellCenter}>{statusLabel(rv.kind)}</td>
|
||||
<td className={MONO}>{byId[rv.shot_id] ? `镜头 ${String(byId[rv.shot_id].order_index).padStart(2, '0')}` : '未知'}
|
||||
<div className={MUTED}>shot#{rv.shot_id}</div>
|
||||
</td>
|
||||
<td className={cellCenter}><Tag tone={rv.verdict === 'pass' ? 'ok' : 'bad'}>{rv.verdict === 'pass' ? '合格' : '不合格'}</Tag></td>
|
||||
<td className={`${cellRight} ${MONO}`}>{rv.score ?? '—'}</td>
|
||||
<td className={MUTED}>{rv.reviewer}</td>
|
||||
<td className={cellWrap}>{rv.notes || '—'}
|
||||
{rv.checks?.checks
|
||||
? <div className={MUTED_MONO}>检查:{rv.checks.checks.filter((c: any) => !c.passed).map((c: any) => c.label).join('、') || '全部达标'}</div>
|
||||
: null}
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
{!reviews.length ? <tr><td colSpan={7} className={`${MUTED} ${EMPTY_CELL}`}>暂无审核记录。</td></tr> : null}
|
||||
</tbody>
|
||||
</Table>
|
||||
</TableBox>
|
||||
</Panel>
|
||||
</TabStack>
|
||||
)
|
||||
}
|
||||
|
||||
/** 画面质检面板(大模型看图):判定帧可以直接点开灯箱,逐条结论单独列表 */
|
||||
function VisualQc({ probe, checks, frames, frameItems, note }: {
|
||||
probe: any; checks: any[]; frames: string[]; frameItems: any[]; note: string
|
||||
}) {
|
||||
return (
|
||||
<div className="mb-1 rounded-[10px] bg-tint-info p-[10px]">
|
||||
<div className="flex items-center justify-between gap-3 flex-wrap">
|
||||
<b className="text-caption">👁 画面质检(大模型看图)</b>
|
||||
<span className={MUTED}>{probe.visual_frames ? `${probe.visual_frames.length} 张判定帧` : ''}</span>
|
||||
</div>
|
||||
{probe.visual_summary
|
||||
? <p className="mt-[6px] mb-0 text-caption leading-[1.6] text-dim break-words">{probe.visual_summary}</p> : null}
|
||||
{frames.length
|
||||
? <div className="mt-2 flex flex-wrap gap-2">
|
||||
{frames.map((u, i) => (
|
||||
<button key={u} type="button" onClick={() => openPreview(frameItems, i)}
|
||||
className="group flex w-[108px] flex-col gap-1 border-0 bg-transparent p-0 text-left hover:[&_span]:text-accent-bright">
|
||||
<MediaThumb src={u} kind="image" size="sm" clickable={false} radius={6} />
|
||||
<span className="text-[10px] text-faint">第 {i + 1} 帧</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
: null}
|
||||
{note ? <LineHint className="mt-[6px]">{note}</LineHint> : null}
|
||||
{checks.length
|
||||
? <div className="mt-2">
|
||||
<CheckTable items={checks} cols={VISUAL_COLS} visual />
|
||||
</div>
|
||||
: null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** 质检结论表:窄栏里必须固定布局 + 百分比列宽,否则「标准」列被挤出容器;长串实测值要允许折行 */
|
||||
function CheckTable({ items, cols, visual }: { items: any[]; cols: string[]; visual?: boolean }) {
|
||||
return (
|
||||
<TableBox maxHeight={visual ? 210 : 230}>
|
||||
<Table minWidth={0} className="table-fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
{(visual ? ['画面问题', '结论', '位置', '说明'] : ['检查项', '结论', '实测', '权重', '标准'])
|
||||
.map((h, i) => <th key={h} className={`${cols[i]} ${visual ? 'whitespace-normal' : 'whitespace-nowrap'}`}>{h}</th>)}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{items.map((c: any) => (
|
||||
<tr key={c.key}>
|
||||
<td className={visual ? 'whitespace-normal' : 'whitespace-nowrap'}>{visual ? visualShortLabel(c) : c.label}</td>
|
||||
<td className={cellCenter}>
|
||||
<Tag tone={(visual ? visualTone(c) : c.passed ? 'ok' : c.severity === 'warning' ? 'warn' : 'bad') as any}>
|
||||
{visual ? visualVerdict(c) : c.passed ? '合格' : c.severity === 'warning' ? '提醒' : '不合格'}
|
||||
</Tag>
|
||||
</td>
|
||||
<td className={`${MONO} whitespace-normal break-words`}>{c.value}</td>
|
||||
{visual ? null : <td className={`${cellRight} ${MONO}`}>{c.weight}</td>}
|
||||
<td className={`${cellWrap} ${MUTED} break-words`}>{c.detail}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</Table>
|
||||
</TableBox>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue