优化脚本

This commit is contained in:
Azmat@qq.com
2026-08-25 16:40:22 +08:00
parent e2ec2d14af
commit df6784b90c
22 changed files with 893 additions and 156 deletions
+7 -16
View File
@@ -440,20 +440,7 @@ export function FreeCreatePage({ modelConfigs, onNotify, onTaskSettled, onBack }
}
}, [refs, mode, model, ratio, resolution, duration, seed, doSubmit, notify]);
const handleRetry = useCallback((task: FreeVideoTask) => {
void doSubmit({
prompt: task.prompt,
mode: task.mode,
model: task.model,
aspect_ratio: task.aspect_ratio,
resolution: task.resolution,
duration: task.duration,
seed: task.seed,
references: task.references
});
}, [doSubmit]);
// 再次生成:参数 + 素材 + 提示词(含 mention chip)全部回填输入条
// 失败重试 / 再次生成:不立刻再跑同一条任务,把提示词+参数+素材回填到底部操作区,用户改完再点生成
const handleReuse = useCallback((task: FreeVideoTask) => {
setDetailId(null);
setMode(task.mode);
@@ -463,7 +450,11 @@ export function FreeCreatePage({ modelConfigs, onNotify, onTaskSettled, onBack }
setDuration(task.duration);
setSeed(task.seed ?? -1);
setRefs(task.references.map((r) => ({ ...r, key: nextRefKey() })));
window.setTimeout(() => promptRef.current?.setContent(task.prompt, task.references), 0);
window.setTimeout(() => {
promptRef.current?.setContent(task.prompt, task.references);
promptRef.current?.focus();
document.querySelector(".fc-composer")?.scrollIntoView({ behavior: "smooth", block: "end" });
}, 0);
notify("info", "已回填参数,可修改后重新生成");
}, [notify]);
@@ -665,7 +656,7 @@ export function FreeCreatePage({ modelConfigs, onNotify, onTaskSettled, onBack }
task={task}
progress={progress[task.id] || 3}
onOpen={() => setDetailId(task.id)}
onRetry={() => handleRetry(task)}
onRetry={() => handleReuse(task)}
onToggleFavorite={() => handleFavorite(task)}
onDelete={() => setDeleteTarget(task)}
onDownload={() => void handleDownload(task)}