feat: 接入模板组合预览
This commit is contained in:
1 parent
6c049b8672
commit
f9c63a6895
2 files changed
+49
No files matched your search
@@ -35,6 +35,8 @@ export function WorkspacePage() {
|
|||||||
description: string;
|
description: string;
|
||||||
capabilities: string[];
|
capabilities: string[];
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
const [previewIndustry, setPreviewIndustry] = useState("personal");
|
||||||
|
const [previewVisual, setPreviewVisual] = useState("linjing-editorial");
|
||||||
const [form] = Form.useForm<Record<string, unknown>>();
|
const [form] = Form.useForm<Record<string, unknown>>();
|
||||||
const [inquiryForm] = Form.useForm<Record<string, unknown>>();
|
const [inquiryForm] = Form.useForm<Record<string, unknown>>();
|
||||||
const query = useQuery({
|
const query = useQuery({
|
||||||
@@ -49,6 +51,11 @@ export function WorkspacePage() {
|
|||||||
queryKey: ["template-catalog"],
|
queryKey: ["template-catalog"],
|
||||||
queryFn: () => client.listPublicTemplates(),
|
queryFn: () => client.listPublicTemplates(),
|
||||||
});
|
});
|
||||||
|
const combinationPreview = useQuery({
|
||||||
|
queryKey: ["template-combination-preview", previewIndustry, previewVisual],
|
||||||
|
queryFn: () => client.previewPublicTemplateCombination(previewIndustry, previewVisual),
|
||||||
|
enabled: Boolean(templateCatalog.data),
|
||||||
|
});
|
||||||
const visualTemplate = useMutation({
|
const visualTemplate = useMutation({
|
||||||
mutationFn: (key: string) =>
|
mutationFn: (key: string) =>
|
||||||
client.updateAdminBrand({
|
client.updateAdminBrand({
|
||||||
@@ -356,6 +363,47 @@ export function WorkspacePage() {
|
|||||||
{industryTarget?.capabilities.join("、") || "无"}。
|
{industryTarget?.capabilities.join("、") || "无"}。
|
||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
<Card title="模板组合预览" style={{ marginBottom: 24 }}>
|
||||||
|
<Space wrap>
|
||||||
|
<Select
|
||||||
|
value={previewIndustry}
|
||||||
|
onChange={setPreviewIndustry}
|
||||||
|
options={(templateCatalog.data?.industries ?? []).map((item) => ({
|
||||||
|
value: item.key,
|
||||||
|
label: item.name,
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
<Select
|
||||||
|
value={previewVisual}
|
||||||
|
onChange={setPreviewVisual}
|
||||||
|
options={(templateCatalog.data?.visuals ?? []).map((item) => ({
|
||||||
|
value: item.key,
|
||||||
|
label: item.name,
|
||||||
|
}))}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
{combinationPreview.isLoading ? (
|
||||||
|
<Card loading style={{ marginTop: 16 }} />
|
||||||
|
) : combinationPreview.data ? (
|
||||||
|
<Space direction="vertical" style={{ width: "100%", marginTop: 16 }}>
|
||||||
|
<Typography.Text strong>
|
||||||
|
{combinationPreview.data.industry.name} × {combinationPreview.data.visual.name}
|
||||||
|
</Typography.Text>
|
||||||
|
<Space wrap>
|
||||||
|
{combinationPreview.data.runtime.modules.map((item) => (
|
||||||
|
<Tag key={item.key}>
|
||||||
|
{item.title} · {item.variant}
|
||||||
|
</Tag>
|
||||||
|
))}
|
||||||
|
</Space>
|
||||||
|
<Typography.Text type="secondary">
|
||||||
|
能力:
|
||||||
|
{combinationPreview.data.runtime.capabilities.map((item) => item.key).join("、") ||
|
||||||
|
"无"}
|
||||||
|
</Typography.Text>
|
||||||
|
</Space>
|
||||||
|
) : null}
|
||||||
|
</Card>
|
||||||
<Card
|
<Card
|
||||||
title="动态咨询表单"
|
title="动态咨询表单"
|
||||||
extra={
|
extra={
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
- [x] 行业模板安装增加版本、描述和能力依赖确认。
|
- [x] 行业模板安装增加版本、描述和能力依赖确认。
|
||||||
- [x] Admin 展示视觉模板主题色、适用场景和模块变体预览卡片。
|
- [x] Admin 展示视觉模板主题色、适用场景和模块变体预览卡片。
|
||||||
- [x] 增加行业模板与视觉模板的安装前组合预览接口,不写入品牌配置。
|
- [x] 增加行业模板与视觉模板的安装前组合预览接口,不写入品牌配置。
|
||||||
|
- [x] Admin 接入模板组合预览,可在安装前查看模块变体和能力依赖。
|
||||||
- [ ] Phase 4:Capability Plugin。
|
- [ ] Phase 4:Capability Plugin。
|
||||||
- [ ] Phase 5:林境门作与第二行业双模板验证。
|
- [ ] Phase 5:林境门作与第二行业双模板验证。
|
||||||
- [ ] Phase 6:Stitch 到 Manifest 的转换流水线。
|
- [ ] Phase 6:Stitch 到 Manifest 的转换流水线。
|
||||||
|
|||||||
Reference in new issue
Block a user