feat: 完善模板字段编辑与分类治理
This commit is contained in:
1 parent
91322fa9a0
commit
26bcb2b66e
23 files changed
+631
-250
No files matched your search
@@ -119,6 +119,14 @@ export class PublicWorkspaceService {
|
||||
const templatePackageManifest =
|
||||
releaseSnapshot.templatePackageManifest ??
|
||||
getTemplatePackageManifestForVisualKey(visualTemplateKey);
|
||||
const categoryOptions = new Map(
|
||||
(templatePackageManifest?.admin.sections ?? [])
|
||||
.filter((section) => section.target === "offering")
|
||||
.flatMap((section) => section.fields)
|
||||
.filter((field) => field.binding === "offering.config.categoryKey")
|
||||
.flatMap((field) => field.options ?? [])
|
||||
.map((option) => [option.value, option.label]),
|
||||
);
|
||||
// 标准 BrandProfile 字段优先,兼容旧模板仍使用的 config 字段。
|
||||
// 这样后台编辑 description/contactPhone 等标准字段后,旧模板也会立即读取新值。
|
||||
const runtimeBrand = projectBrandAliases(brandData, brandConfig);
|
||||
@@ -177,7 +185,9 @@ export class PublicWorkspaceService {
|
||||
...this.jsonObject(config.presentation),
|
||||
categoryKey: typeof config.categoryKey === "string" ? config.categoryKey : "custom",
|
||||
categoryLabel:
|
||||
typeof config.categoryLabel === "string" ? config.categoryLabel : "业务提供项",
|
||||
categoryOptions.get(
|
||||
typeof config.categoryKey === "string" ? config.categoryKey : "custom",
|
||||
) ?? "",
|
||||
heroImage:
|
||||
typeof config.detailHero === "string"
|
||||
? config.detailHero
|
||||
|
||||
Reference in new issue
Block a user