forked from 77media/video-flow
260 lines
6.7 KiB
TypeScript
260 lines
6.7 KiB
TypeScript
// 主项目(产品)类型枚举
|
|
export enum ProjectTypeEnum {
|
|
SCRIPT_TO_VIDEO = 1, // "剧本转视频"
|
|
VIDEO_TO_VIDEO = 2, // "视频复刻视频"
|
|
}
|
|
|
|
// 模式枚举
|
|
export enum ModeEnum {
|
|
MANUAL = 'manual', // "手动"
|
|
AUTOMATIC = 'automatic', // "自动"
|
|
}
|
|
|
|
// 分辨率枚举
|
|
export enum ResolutionEnum {
|
|
HD_720P = '720p', // "720p"
|
|
FULL_HD_1080P = '1080p', // "1080p"
|
|
UHD_2K = '2k', // "2k"
|
|
UHD_4K = '4k', // "4k"
|
|
}
|
|
|
|
// 视频时长枚举
|
|
export enum VideoDurationEnum {
|
|
ONE_MINUTE = '1min', // "一分钟"
|
|
TWO_MINUTES = '2min', // "两分钟"
|
|
THREE_MINUTES = '3min', // "三分钟"
|
|
}
|
|
|
|
// 工作流阶段枚举
|
|
export enum FlowStageEnum {
|
|
PREVIEW = 1, // "预览图列表分镜草图"
|
|
CHARACTERS = 2, // "角色列表"
|
|
SHOTS = 3, // "分镜视频列表"
|
|
BGM = 4, // "背景音乐列表"
|
|
POST_PRODUCTION = 5, // "后期操作中"
|
|
MERGE_VIDEO = 6, // "合并视频完成"
|
|
ERROR = 99, // "出错"
|
|
}
|
|
|
|
// 任务状态枚举
|
|
export enum TaskStatusEnum {
|
|
PENDING = "pending", // "待处理"
|
|
PROCESSING = "processing", // "处理中"
|
|
COMPLETED = "completed", // "已完成"
|
|
FAILED = "failed", // "失败"
|
|
RETRYING = "retrying", // "重试中"
|
|
CANCELLED = "cancelled", // "已取消"
|
|
}
|
|
|
|
// 项目类型映射
|
|
export const ProjectTypeMap = {
|
|
[ProjectTypeEnum.SCRIPT_TO_VIDEO]: {
|
|
value: "script_to_video",
|
|
label: "script",
|
|
tab: "script"
|
|
},
|
|
[ProjectTypeEnum.VIDEO_TO_VIDEO]: {
|
|
value: "video_to_video",
|
|
label: "clone",
|
|
tab: "clone"
|
|
}
|
|
} as const;
|
|
|
|
// 模式映射
|
|
export const ModeMap = {
|
|
[ModeEnum.MANUAL]: {
|
|
value: "manual",
|
|
label: "手动"
|
|
},
|
|
[ModeEnum.AUTOMATIC]: {
|
|
value: "automatic",
|
|
label: "自动"
|
|
}
|
|
} as const;
|
|
|
|
// 分辨率映射
|
|
export const ResolutionMap = {
|
|
[ResolutionEnum.HD_720P]: {
|
|
value: "720p",
|
|
label: "720P"
|
|
},
|
|
[ResolutionEnum.FULL_HD_1080P]: {
|
|
value: "1080p",
|
|
label: "1080P"
|
|
},
|
|
[ResolutionEnum.UHD_2K]: {
|
|
value: "2k",
|
|
label: "2K"
|
|
},
|
|
[ResolutionEnum.UHD_4K]: {
|
|
value: "4k",
|
|
label: "4K"
|
|
}
|
|
} as const;
|
|
|
|
// 视频时长映射
|
|
export const VideoDurationMap = {
|
|
[VideoDurationEnum.ONE_MINUTE]: {
|
|
value: "1min",
|
|
label: "One Minute"
|
|
},
|
|
[VideoDurationEnum.TWO_MINUTES]: {
|
|
value: "2min",
|
|
label: "Two Minutes"
|
|
},
|
|
[VideoDurationEnum.THREE_MINUTES]: {
|
|
value: "3min",
|
|
label: "Three Minutes"
|
|
}
|
|
} as const;
|
|
|
|
// 工作流阶段映射
|
|
export const FlowStageMap = {
|
|
[FlowStageEnum.PREVIEW]: {
|
|
value: "preview",
|
|
label: "预览图列表分镜草图"
|
|
},
|
|
[FlowStageEnum.CHARACTERS]: {
|
|
value: "characters",
|
|
label: "角色列表"
|
|
},
|
|
[FlowStageEnum.SHOTS]: {
|
|
value: "shots",
|
|
label: "分镜视频列表"
|
|
},
|
|
[FlowStageEnum.BGM]: {
|
|
value: "bgm",
|
|
label: "背景音乐列表"
|
|
},
|
|
[FlowStageEnum.POST_PRODUCTION]: {
|
|
value: "post_production",
|
|
label: "后期操作中"
|
|
},
|
|
[FlowStageEnum.MERGE_VIDEO]: {
|
|
value: "merge_video",
|
|
label: "合并视频完成"
|
|
},
|
|
[FlowStageEnum.ERROR]: {
|
|
value: "error",
|
|
label: "出错"
|
|
}
|
|
} as const;
|
|
|
|
// 任务状态映射
|
|
export const TaskStatusMap = {
|
|
[TaskStatusEnum.PENDING]: {
|
|
value: "pending",
|
|
label: "待处理"
|
|
},
|
|
[TaskStatusEnum.PROCESSING]: {
|
|
value: "processing",
|
|
label: "处理中"
|
|
},
|
|
[TaskStatusEnum.COMPLETED]: {
|
|
value: "completed",
|
|
label: "已完成"
|
|
},
|
|
[TaskStatusEnum.FAILED]: {
|
|
value: "failed",
|
|
label: "失败"
|
|
},
|
|
[TaskStatusEnum.RETRYING]: {
|
|
value: "retrying",
|
|
label: "重试中"
|
|
},
|
|
[TaskStatusEnum.CANCELLED]: {
|
|
value: "cancelled",
|
|
label: "已取消"
|
|
}
|
|
} as const;
|
|
|
|
// 分镜脚本编辑器类型定义
|
|
export interface StoryboardCard {
|
|
id: string;
|
|
shotId: string; // 分镜ID
|
|
scene?: SceneOption; // 场景
|
|
characters: CharacterOption[]; // 出现人物
|
|
description: string; // 分镜描述
|
|
shotType: string; // 分镜类型
|
|
cameraMove: string; // 相机运动
|
|
dialogues: DialogueItem[];
|
|
notes?: string;
|
|
}
|
|
|
|
export interface CharacterRef {
|
|
id: string;
|
|
name: string;
|
|
}
|
|
|
|
export interface DialogueItem {
|
|
id: string;
|
|
speaker: string;
|
|
text: string; // 对话内容,支持关键词标记,如 #角色# [场景]
|
|
}
|
|
|
|
export interface CharacterInfo {
|
|
avatar: string;
|
|
gender: string;
|
|
age: string;
|
|
description: string;
|
|
}
|
|
|
|
export interface SceneInfo {
|
|
image: string;
|
|
location: string;
|
|
time: string;
|
|
}
|
|
|
|
export interface SceneOption {
|
|
sceneId: string;
|
|
name: string;
|
|
image: string;
|
|
location: string;
|
|
time: string;
|
|
}
|
|
|
|
export interface CharacterOption {
|
|
characterId: string;
|
|
name: string;
|
|
image: string;
|
|
gender: string;
|
|
age: string;
|
|
description: string;
|
|
}
|
|
|
|
// Mock 数据
|
|
export const mockSceneOptions: SceneOption[] = [
|
|
{ sceneId: '1', name: '暮色森林', image: 'https://c.huiying.video/images/7fd3f2d6-840a-46ac-a97d-d3d1b37ec4e0.jpg', location: '西境边陲', time: '傍晚' }
|
|
];
|
|
|
|
export const mockCharacterOptions: CharacterOption[] = [
|
|
{ characterId: '1', name: '艾琳', image: 'https://c.huiying.video/images/32f6b07c-bceb-4b63-8a13-4749703ab08d.jpg', gender: '女', age: '24', description: '银发女剑士' },
|
|
{ characterId: '2', name: '影子猎手', image: 'https://c.huiying.video/images/97c6c59a-50cc-4159-aacd-94ab9d208150.jpg', gender: '男', age: '35', description: '神秘追踪者' },
|
|
];
|
|
|
|
export const mockStoryboards: StoryboardCard[] = [
|
|
{
|
|
id: '1',
|
|
shotId: 'SC-01',
|
|
scene: mockSceneOptions[0],
|
|
characters: [mockCharacterOptions[0], mockCharacterOptions[1]],
|
|
description: '艾琳警惕地穿过森林,影子猎手的身影若隐若现艾琳警惕地穿过森林,影子猎手的身影若隐若现艾琳警惕地穿过森林,影子猎手的身影若隐若现艾琳警惕地穿过森林,影子猎手的身影若隐若现',
|
|
shotType: '中景',
|
|
cameraMove: '缓慢推进',
|
|
dialogues: [
|
|
{ id: 'd1', speaker: '艾琳', text: '我们必须在 #影子猎手# 到来前穿过 [暮色森林]。' },
|
|
{ id: 'd2', speaker: '影子猎手', text: '你以为能逃出这里?' },
|
|
],
|
|
notes: '镜头缓慢推进至人物背影',
|
|
},
|
|
];
|
|
|
|
export const characterInfoMap: Record<string, CharacterInfo> = {
|
|
'艾琳': { avatar: 'https://c.huiying.video/images/32f6b07c-bceb-4b63-8a13-4749703ab08d.jpg', gender: '女', age: '24', description: '银发女剑士' },
|
|
'影子猎手': { avatar: 'https://c.huiying.video/images/97c6c59a-50cc-4159-aacd-94ab9d208150.jpg', gender: '男', age: '35', description: '神秘追踪者' },
|
|
};
|
|
|
|
export const sceneInfoMap: Record<string, SceneInfo> = {
|
|
'暮色森林': { image: 'https://c.huiying.video/images/7fd3f2d6-840a-46ac-a97d-d3d1b37ec4e0.jpg', location: '西境边陲', time: '傍晚' },
|
|
};
|