align(视频任务): 卡片补任务模式/生成时间(completed||submitted)/调试链接复制信息行、下载按钮无视频禁用、明细补模式/生成时间/调试链接(对齐 admin.js renderImageVideoCard/copyImageVideoDebugUrl)

This commit is contained in:
2026-09-05 23:24:11 +08:00
parent 1c9deea8df
commit bd44855d95
3 changed files with 101 additions and 7 deletions
@@ -22,6 +22,8 @@ export interface ImageVideoRow {
status: TaskStatus
cozeStatus: string
cozeExecuteId: string
/** 任务模式(对齐 admin.js 卡片「任务模式」信息行)。 */
mode?: string
videos: ImageVideoVideo[]
videoUrl: string
debugUrl: string
@@ -104,9 +106,21 @@ export function toImageVideoRow(raw: unknown): ImageVideoRow | null {
if (submittedAt) task.submittedAt = submittedAt
const completedAt = text(r.completed_at ?? r.completedAt)
if (completedAt) task.completedAt = completedAt
const mode = text(r.mode)
if (mode) task.mode = mode
return task
}
/** 生成时间口径(对齐 admin.js:1331 completed_at || submitted_at || '-')。 */
export function imageVideoGeneratedAt(task: Pick<ImageVideoRow, 'completedAt' | 'submittedAt'>): string {
return task.completedAt || task.submittedAt || '-'
}
/** 卡片是否带可播放/可下载视频(对齐 admin.js hasVideo 判定)。 */
export function imageVideoHasDisplayUrl(card: Pick<ImageVideoCard, 'video'>): boolean {
return !!(card.video && card.video.displayUrl)
}
/** 把任务行展平为“任务:视频下标”卡片;无 videos 的任务展为一张空卡。 */
export function flattenImageVideoTasks(items: readonly ImageVideoRow[]): ImageVideoCard[] {
const cards: ImageVideoCard[] = []