feat: 完成模板区域与咨询字段编辑闭环

This commit is contained in:
que01 committed 2026-10-09 17:33:39 +08:00
1 parent c5db30f817
commit 66dbba5748
6 files changed
+211 -24

No files matched your search

+1
View File
@@ -103,6 +103,7 @@ export function Inquiry({
<View
className={`form-field ${food && ["people", "date", "budget", "delivery"].includes(field.key) ? "half-field" : ""}`}
key={field.key}
data-editor-target={preview ? `inquiry-field:${field.key}` : undefined}
>
<Text className="field-label">
{field.label}
@@ -258,6 +258,21 @@ test("Admin 按通用预览目标筛选字段并同步品牌草稿", async ({ pa
if (url.pathname === "/admin/config/brand") return route.fulfill({ json: brand });
if (url.pathname === "/admin/workspace/offerings")
return route.fulfill({ json: [adminOffering] });
if (url.pathname === "/admin/workspace/forms")
return route.fulfill({
json: [
{
id: "brand-inquiry",
name: "品牌咨询",
version: 1,
isEnabled: true,
purpose: "inquiry",
targetType: "brand",
submissionAction: "create-inquiry",
fieldsSnapshot: runtimeWorkspace.inquiryForms[0].fields,
},
],
});
if (
url.pathname === `/admin/workspace/offerings/${adminOffering.id}` &&
request.method() === "PATCH"
@@ -417,6 +432,8 @@ test("Admin 按通用预览目标筛选字段并同步品牌草稿", async ({ pa
await expect(preview.locator(".inquiry-form .form-field")).toHaveCount(2);
await expect(preview.locator(".inquiry-form")).toContainText("称呼");
await expect(preview.locator(".inquiry-form")).toContainText("需求说明");
await preview.locator('[data-editor-target="inquiry-field:name"]').click();
await expect(page.getByLabel("字段标题")).toHaveValue("称呼");
await preview.locator(".inquiry-form").scrollIntoViewIfNeeded();
await preview.screenshot({ path: "../../.codex-tasks/preview-proportion/inquiry.png" });
const formOverflow = await preview