feat: 业务列表支持跳转页面编辑
This commit is contained in:
1 parent
20eb160abf
commit
20e7e8bb81
1 file changed
+24
@@ -28,8 +28,10 @@ import {
|
||||
readPresentationValue,
|
||||
} from "../brand/presentation-bindings.js";
|
||||
import { MutationError, QueryState } from "../../components/QueryState.js";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
export function ServicesPage() {
|
||||
const navigate = useNavigate();
|
||||
const client = createApiClient();
|
||||
const queryClient = useQueryClient();
|
||||
const [offeringForm] = Form.useForm();
|
||||
@@ -70,6 +72,13 @@ export function ServicesPage() {
|
||||
const detailSections = (workspace.data?.templateContent?.admin.sections ?? []).filter(
|
||||
(section) => section.target === "offering" && section.page === "detail",
|
||||
);
|
||||
const visualOfferingTarget = (workspace.data?.templateContent?.admin.sections ?? [])
|
||||
.filter((section) => section.target === "offering" && section.page === "offerings")
|
||||
.flatMap((section) => section.previewTargets ?? [])
|
||||
.find((target) => templateFields.some((field) => field.previewTarget === target.key)) ?? {
|
||||
key: "linjing-editorial.offerings.item",
|
||||
label: "业务卡片",
|
||||
};
|
||||
const hasTemplateDetailCopy = templateFields.some(
|
||||
(field) => field.binding === "offering.config.details.background",
|
||||
);
|
||||
@@ -320,6 +329,21 @@ export function ServicesPage() {
|
||||
以下模板字段与小程序页面编辑的是同一份业务数据;可在此集中修改,也可到页面编辑中点选对应卡片。
|
||||
</Typography.Paragraph>
|
||||
<RecordContentFields section={templateFieldSection} />
|
||||
{editingOffering ? (
|
||||
<Button
|
||||
htmlType="button"
|
||||
onClick={() =>
|
||||
navigate("/admin/brand", {
|
||||
state: {
|
||||
targetKey: visualOfferingTarget.key,
|
||||
recordId: editingOffering.id,
|
||||
},
|
||||
})
|
||||
}
|
||||
>
|
||||
在小程序页面编辑
|
||||
</Button>
|
||||
) : null}
|
||||
</>
|
||||
) : null}
|
||||
</Form>
|
||||
|
||||
Reference in new issue
Block a user