feat: 在后台展示当前行业模板定义

This commit is contained in:
que01 committed 2026-09-19 21:27:11 +08:00
1 parent c6785892ed
commit 6ee0dffdb8
2 files changed
+19 -1

No files matched your search

+9 -1
View File
@@ -8,6 +8,11 @@ export function BrandPage() {
const queryClient = useQueryClient();
const [form] = Form.useForm<BrandProfile>();
const brand = useQuery({ queryKey: ["admin-brand"], queryFn: () => client.getAdminBrand() });
const template = useQuery({
queryKey: ["template", brand.data?.templateKey],
queryFn: () => client.getPublicTemplate(brand.data!.templateKey as "personal" | "food"),
enabled: Boolean(brand.data?.templateKey),
});
const save = useMutation({
mutationFn: (values: Partial<BrandProfile>) => client.updateAdminBrand(values),
onSuccess: () => {
@@ -18,7 +23,10 @@ export function BrandPage() {
if (brand.isLoading) return <Card loading />;
if (brand.isError || !brand.data) return <Card>品牌配置加载失败</Card>;
return (
<Card title="品牌信任配置">
<Card
title="品牌信任配置"
extra={template.data ? `${template.data.name}:${template.data.description}` : undefined}
>
<Form
form={form}
layout="vertical"