feat: 增加视觉模板预览卡片

This commit is contained in:
que01 committed 2026-09-22 23:47:16 +08:00
1 parent 6e8a49162c
commit 4c9f9a05d0
3 files changed
+29 -2

No files matched your search

@@ -233,6 +233,32 @@ export function WorkspacePage() {
) : null}
<MutationError error={rollbackVisual.error} />
</Space>
<Space direction="vertical" style={{ width: "100%" }}>
<Typography.Text strong>可用视觉模板</Typography.Text>
<Space wrap>
{(templateCatalog.data?.visuals ?? []).map((visual) => (
<Card key={visual.key} size="small" style={{ width: 260 }}>
<Typography.Text strong>{visual.name}</Typography.Text>
<Typography.Paragraph type="secondary" ellipsis={{ rows: 2 }}>
{visual.description}
</Typography.Paragraph>
<Space wrap>
{Object.entries(visual.theme.colors).map(([name, color]) => (
<Tag key={name} color={color.startsWith("#") ? "default" : "blue"}>
{name}
</Tag>
))}
</Space>
<Typography.Paragraph
type="secondary"
style={{ marginTop: 12, marginBottom: 0 }}
>
{Object.values(visual.variants).join(" / ")}
</Typography.Paragraph>
</Card>
))}
</Space>
</Space>
<Modal
title="确认切换视觉模板"
open={visualTarget !== null}
+1
View File
@@ -51,6 +51,7 @@
- [x] 后台展示视觉模板历史并支持安全回滚。
- [x] 模板中心行业 / 视觉目录由后端注册表接口驱动。
- [x] 行业模板安装增加版本、描述和能力依赖确认。
- [x] Admin 展示视觉模板主题色、适用场景和模块变体预览卡片。
- [ ] Phase 4:Capability Plugin。
- [ ] Phase 5:林境门作与第二行业双模板验证。
- [ ] Phase 6:Stitch 到 Manifest 的转换流水线。
+2 -2
View File
@@ -371,7 +371,7 @@ export class ApiClient {
key: string;
version: string;
name: string;
theme: unknown;
theme: { colors: Record<string, string> };
variants: Record<string, string>;
} | null;
available: string[];
@@ -400,7 +400,7 @@ export class ApiClient {
name: string;
description: string;
variants: Record<string, string>;
theme: unknown;
theme: { colors: Record<string, string> };
}>;
}> {
return this.request("/public/templates");