视频创作解决已发现问题
This commit is contained in:
@@ -556,7 +556,7 @@ export function OmniHistoryPage({
|
||||
navigate: NavigateFn;
|
||||
onNotify?: (type: "success" | "error" | "info", text: string) => void;
|
||||
}) {
|
||||
const [filter, setFilter] = useState<"all" | "running" | "completed">("all");
|
||||
const [modeFilter, setModeFilter] = useState<"all" | "video" | "image">("all");
|
||||
const [items, setItems] = useState<CreationConversation[] | null>(null);
|
||||
const [deleteTarget, setDeleteTarget] = useState<CreationConversation | null>(null);
|
||||
// 同会话页:onNotify 是内联箭头,进依赖会让列表每次 App 重渲染都重拉一遍
|
||||
@@ -567,7 +567,7 @@ export function OmniHistoryPage({
|
||||
let cancelled = false;
|
||||
setItems(null);
|
||||
api
|
||||
.listCreations(filter === "all" ? {} : { status: filter })
|
||||
.listCreations(modeFilter === "all" ? {} : { mode: modeFilter })
|
||||
.then((page) => {
|
||||
if (!cancelled) setItems(page.results || []);
|
||||
})
|
||||
@@ -579,7 +579,7 @@ export function OmniHistoryPage({
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [filter]);
|
||||
}, [modeFilter]);
|
||||
|
||||
const remove = async (id: string) => {
|
||||
// 软删:会话没了,已生成的图和视频仍留在资产库里
|
||||
@@ -602,20 +602,20 @@ export function OmniHistoryPage({
|
||||
</button>
|
||||
<h1>创作历史</h1>
|
||||
</div>
|
||||
<p>查看和继续全能创作中的每一次独立会话。</p>
|
||||
<p>按视频创作或图片创作查看,并继续每一次独立会话。</p>
|
||||
</div>
|
||||
<div className="omni-history-tools">
|
||||
<div className="omni-history-toolbar">
|
||||
{([
|
||||
["all", "全部"],
|
||||
["running", "进行中"],
|
||||
["completed", "已完成"],
|
||||
["video", "视频创作"],
|
||||
["image", "图片创作"],
|
||||
] as const).map(([key, label]) => (
|
||||
<button
|
||||
type="button"
|
||||
key={key}
|
||||
className={filter === key ? "active" : ""}
|
||||
onClick={() => setFilter(key)}
|
||||
className={modeFilter === key ? "active" : ""}
|
||||
onClick={() => setModeFilter(key)}
|
||||
>
|
||||
{label}
|
||||
</button>
|
||||
@@ -634,7 +634,13 @@ export function OmniHistoryPage({
|
||||
</div>
|
||||
) : items.length === 0 ? (
|
||||
<div className="omni-history-empty">
|
||||
<p>还没有创作记录,从全能创作开始。</p>
|
||||
<p>
|
||||
{modeFilter === "video"
|
||||
? "还没有视频创作记录,从全能创作开始。"
|
||||
: modeFilter === "image"
|
||||
? "还没有图片创作记录,从全能创作开始。"
|
||||
: "还没有创作记录,从全能创作开始。"}
|
||||
</p>
|
||||
<button type="button" onClick={() => navigate("omniCreate")}>
|
||||
去全能创作
|
||||
<ChevronRight size={14} />
|
||||
|
||||
Reference in New Issue
Block a user