From f46cf18ae1146c5ea3361ec7b0e5e3cef1a5a3d6 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 30 Jul 2026 09:10:16 +0800 Subject: [PATCH] =?UTF-8?q?refactor(PipConfigPanel):=20=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=8C=96=E4=B8=BB=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PipConfigPanel/index.tsx | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 apps/web/src/pages/editing-planner/components/PipConfigPanel/index.tsx diff --git a/apps/web/src/pages/editing-planner/components/PipConfigPanel/index.tsx b/apps/web/src/pages/editing-planner/components/PipConfigPanel/index.tsx new file mode 100644 index 000000000..118b15a57 --- /dev/null +++ b/apps/web/src/pages/editing-planner/components/PipConfigPanel/index.tsx @@ -0,0 +1,106 @@ +/** + * 混剪配置面板 — Drawer 形式 + * 左侧图层列表 + 右侧单图层配置 + 迷你预览区 + */ +import React from "react" +import { Drawer, Switch } from "antd" +import type { PipConfig } from "../types" + +import { usePipConfigPanel } from "./hooks/usePipConfigPanel" +import { LayerList } from "./components/LayerList" +import { PipPreview } from "./components/PipPreview" +import { LayerConfig } from "./components/LayerConfig" + +export interface PipConfigPanelProps { + open: boolean + onClose: () => void + config: PipConfig + onChange: (config: PipConfig) => void + totalDuration: number +} + +const PipConfigPanel: React.FC = ({ + open, + onClose, + config, + onChange, + totalDuration, +}) => { + const { + selectedId, + setSelectedId, + selectedLayer, + handleAddLayer, + handleDeleteLayer, + updateLayer, + handleEnableToggle, + handleReset, + handleGridClick, + handleWidthChange, + handleHeightChange, + } = usePipConfigPanel({ config, onChange }) + + return ( + + {/* ═══ 顶部工具栏 ═══ */} +
+
+ +
+
+ 启用 + +
+
+ + {/* ═══ 主体:图层列表 + 配置区 ═══ */} +
+ {/* 左侧图层列表 */} + + + {/* 右侧配置区 */} + {!selectedLayer ? ( +
+
选择或添加图层以配置
+
+ ) : ( + <> + + + + )} +
+ + {/* ── 底部操作 ── */} +
+ +
+
+ ) +} + +export default PipConfigPanel +export type { PipConfigPanelProps }