fix: 修复模板画布点选与保存切页回归

This commit is contained in:
que01 committed 2026-10-18 13:40:01 +08:00
1 parent e6d843b4a7
commit cd2992c00a
15 files changed
+98 -40

No files matched your search

@@ -2,11 +2,7 @@ import { Alert, Button, Grid, Select, Segmented, Space, Typography } from "antd"
import { useQueryClient } from "@tanstack/react-query";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useNavigate } from "react-router-dom";
import type {
AdminTemplateContent,
RuntimeWorkspace,
TemplateAdminSection,
} from "@personal-brand/api-client";
import type { AdminTemplateContent, RuntimeWorkspace } from "@personal-brand/api-client";
import type { BrandProfile } from "@personal-brand/api-client";
import { StatusTag } from "../../components/StatusTag.js";
import { RecordContentEditor } from "../../components/RecordContentEditor.js";
@@ -18,10 +14,7 @@ import {
type PreviewSelection,
type PreviewTarget,
} from "./preview-selection.js";
import {
filterSectionsForPreviewTarget,
type PresentationValues,
} from "../../lib/presentation/presentation-bindings.js";
import { filterSectionsForPreviewTarget } from "../../lib/presentation/presentation-bindings.js";
import "./PresentationEditor.css";
import { useEditorDraft } from "./use-editor-draft.js";
import {
@@ -213,7 +206,14 @@ export function PresentationEditor({
: pageLinks;
const formState = useBrandPresentationForm({ brand, config, sections });
const { form, initialValues } = formState;
const save = useBrandSaveMutation({ ...formState, brand, config, sections, queryClient });
const save = useBrandSaveMutation({
...formState,
brand,
config,
sections,
queryClient,
onSaved: () => setBrandDirty(false),
});
useEffect(() => {
const initialPage =