From 27758f95ddbe1b6f745c2a30b21e11ba5a80e78c Mon Sep 17 00:00:00 2001 From: huangjianwu Date: Mon, 23 Mar 2026 16:09:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(ui):=20=E5=B7=A5=E4=BD=9C=E5=8C=BA?= =?UTF-8?q?=E5=92=8C=E7=94=9F=E6=88=90=E5=8E=86=E5=8F=B2=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=8A=98=E5=8F=A0/=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- BillNote_frontend/src/layouts/HomeLayout.tsx | 113 +++++++++++++++++-- 1 file changed, 104 insertions(+), 9 deletions(-) diff --git a/BillNote_frontend/src/layouts/HomeLayout.tsx b/BillNote_frontend/src/layouts/HomeLayout.tsx index 3f7b53d..ecba5aa 100644 --- a/BillNote_frontend/src/layouts/HomeLayout.tsx +++ b/BillNote_frontend/src/layouts/HomeLayout.tsx @@ -1,5 +1,5 @@ -import React, { FC } from 'react' -import { SlidersHorizontal } from 'lucide-react' +import React, { FC, useRef, useState } from 'react' +import { SlidersHorizontal, PanelLeftClose, PanelLeftOpen, History as HistoryIcon } from 'lucide-react' import { Tooltip, TooltipContent, @@ -7,24 +7,39 @@ import { TooltipTrigger, } from '@/components/ui/tooltip.tsx' -import { useState } from 'react' import { Link } from 'react-router-dom' import { ResizablePanel, ResizablePanelGroup, ResizableHandle } from '@/components/ui/resizable' -import {ScrollArea} from "@/components/ui/scroll-area.tsx"; +import { ScrollArea } from "@/components/ui/scroll-area.tsx" +import type { ImperativePanelHandle } from 'react-resizable-panels' import logo from '@/assets/icon.svg' + interface IProps { NoteForm: React.ReactNode Preview: React.ReactNode History: React.ReactNode } + const HomeLayout: FC = ({ NoteForm, Preview, History }) => { const [, setShowSettings] = useState(false) + const [isLeftCollapsed, setIsLeftCollapsed] = useState(false) + const [isMiddleCollapsed, setIsMiddleCollapsed] = useState(false) + const leftPanelRef = useRef(null) + const middlePanelRef = useRef(null) return (
{/* 左边表单 */} - + setIsLeftCollapsed(true)} + onExpand={() => setIsLeftCollapsed(false)} + >
-
+
+ + + + + + + 收起工作区 + + + setShowSettings(true)}> @@ -49,24 +79,89 @@ const HomeLayout: FC = ({ NoteForm, Preview, History }) => {
-
{NoteForm}
+
{NoteForm}
+ {/* 左面板折叠时的展开按钮 */} + {isLeftCollapsed && ( + + + + + + + 展开工作区 + + + + )} + {/* 中间历史 */} - + setIsMiddleCollapsed(true)} + onExpand={() => setIsMiddleCollapsed(false)} + > + {/* 中间面板折叠时的展开按钮 */} + {isMiddleCollapsed && ( + + + + + + + 展开历史 + + + + )} + {/* 右边预览 */}
{Preview}