Your Name 0ab58b7e6e fix: 代理商平台显示 + Brief 下载预览功能
- 后端 TaskResponse.ProjectInfo 新增 platform 字段
- 修复代理商 6 个页面硬编码 platform='douyin' 的问题,改为读取实际值
- Brief 预览弹窗:占位符改为 iframe/img 实际展示文件内容
  - PDF 用 iframe 在线预览
  - 图片直接展示
  - 其他类型提示下载
- Brief 下载:改用 a 标签触发下载

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 19:15:03 +08:00

165 lines
3.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 任务相关类型定义
* 与后端 TaskStage/TaskStatus/TaskResponse 对齐
*/
// 任务阶段(对应后端 TaskStage
export type TaskStage =
| 'script_upload'
| 'script_ai_review'
| 'script_agency_review'
| 'script_brand_review'
| 'video_upload'
| 'video_ai_review'
| 'video_agency_review'
| 'video_brand_review'
| 'completed'
| 'rejected'
// 审核状态(对应后端 TaskStatus
export type TaskStatus =
| 'pending'
| 'processing'
| 'passed'
| 'rejected'
| 'force_passed'
// 关联信息
export interface ProjectInfo {
id: string
name: string
brand_name?: string | null
platform?: string | null
}
export interface AgencyInfo {
id: string
name: string
}
export interface CreatorInfo {
id: string
name: string
avatar?: string | null
}
// AI 审核结果
export interface AIReviewResult {
score: number
violations: Array<{
type: string
content: string
severity: string
suggestion: string
timestamp?: number
source?: string
}>
soft_warnings: Array<{
type: string
content: string
suggestion: string
}>
summary?: string
}
// 任务响应(对应后端 TaskResponse
export interface TaskResponse {
id: string
name: string
sequence: number
stage: TaskStage
// 关联
project: ProjectInfo
agency: AgencyInfo
creator: CreatorInfo
// 脚本信息
script_file_url?: string | null
script_file_name?: string | null
script_uploaded_at?: string | null
script_ai_score?: number | null
script_ai_result?: AIReviewResult | null
script_agency_status?: TaskStatus | null
script_agency_comment?: string | null
script_brand_status?: TaskStatus | null
script_brand_comment?: string | null
// 视频信息
video_file_url?: string | null
video_file_name?: string | null
video_duration?: number | null
video_thumbnail_url?: string | null
video_uploaded_at?: string | null
video_ai_score?: number | null
video_ai_result?: AIReviewResult | null
video_agency_status?: TaskStatus | null
video_agency_comment?: string | null
video_brand_status?: TaskStatus | null
video_brand_comment?: string | null
// 申诉
appeal_count: number
is_appeal: boolean
appeal_reason?: string | null
// 时间
created_at: string
updated_at: string
}
export interface TaskListResponse {
items: TaskResponse[]
total: number
page: number
page_size: number
}
export interface TaskSummary {
id: string
name: string
stage: TaskStage
creator_name: string
creator_avatar?: string | null
project_name: string
is_appeal: boolean
appeal_reason?: string | null
created_at: string
updated_at: string
}
export interface ReviewTaskListResponse {
items: TaskSummary[]
total: number
page: number
page_size: number
}
// 请求类型
export interface TaskCreateRequest {
project_id: string
creator_id: string
name?: string
}
export interface TaskScriptUploadRequest {
file_url: string
file_name: string
}
export interface TaskVideoUploadRequest {
file_url: string
file_name: string
duration?: number
thumbnail_url?: string
}
export interface TaskReviewRequest {
action: 'pass' | 'reject' | 'force_pass'
comment?: string
}
export interface AppealRequest {
reason: string
}