diff --git a/BillNote_frontend/package.json b/BillNote_frontend/package.json index 7ab46a7..f38bae3 100644 --- a/BillNote_frontend/package.json +++ b/BillNote_frontend/package.json @@ -39,6 +39,7 @@ "react-hook-form": "^7.55.0", "react-hot-toast": "^2.5.2", "react-markdown": "^10.1.0", + "react-resizable-panels": "^2.1.8", "react-router-dom": "^7.5.1", "react-syntax-highlighter": "^15.6.1", "remark-gfm": "1.0.0", diff --git a/BillNote_frontend/src/components/ui/resizable.tsx b/BillNote_frontend/src/components/ui/resizable.tsx new file mode 100644 index 0000000..569328f --- /dev/null +++ b/BillNote_frontend/src/components/ui/resizable.tsx @@ -0,0 +1,54 @@ +import * as React from "react" +import { GripVerticalIcon } from "lucide-react" +import * as ResizablePrimitive from "react-resizable-panels" + +import { cn } from "@/lib/utils" + +function ResizablePanelGroup({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function ResizablePanel({ + ...props +}: React.ComponentProps) { + return +} + +function ResizableHandle({ + withHandle, + className, + ...props +}: React.ComponentProps & { + withHandle?: boolean +}) { + return ( + div]:rotate-90", + className + )} + {...props} + > + {withHandle && ( +
+ +
+ )} +
+ ) +} + +export { ResizablePanelGroup, ResizablePanel, ResizableHandle } diff --git a/BillNote_frontend/src/index.css b/BillNote_frontend/src/index.css index 2f2aaed..d1bcf28 100644 --- a/BillNote_frontend/src/index.css +++ b/BillNote_frontend/src/index.css @@ -2,10 +2,10 @@ @import 'tw-animate-css'; @custom-variant dark (&:is(.dark *)); -html,body{ +html, body, #root { height: 100%; - width: 100%; } + /* 修改滚动条轨道颜色 */ ::-webkit-scrollbar { width: 8px; /* 控制滚动条的宽度 */ diff --git a/BillNote_frontend/src/layouts/HomeLayout.tsx b/BillNote_frontend/src/layouts/HomeLayout.tsx index 8aa300c..7bb55f5 100644 --- a/BillNote_frontend/src/layouts/HomeLayout.tsx +++ b/BillNote_frontend/src/layouts/HomeLayout.tsx @@ -9,6 +9,7 @@ import { import { useState } from 'react' import { Link } from 'react-router-dom' +import { ResizablePanel, ResizablePanelGroup, ResizableHandle } from '@/components/ui/resizable' interface IProps { NoteForm: React.ReactNode @@ -19,59 +20,53 @@ const HomeLayout: FC = ({ NoteForm, Preview, History }) => { const [, setShowSettings] = useState(false) return ( -
-
- {/* 左侧部分:Header + 表单 */} - + - {/* 表单内容 */} -
- {/**/} - {NoteForm} -
- - + {/* 中间历史 */} + + + - {/* 右侧预览区域 */} -
- {/**/} - {Preview} -
-
+ - {/* 页脚 */} - {/*
*/} - {/* © 2025 BiliNote. All rights reserved.*/} - {/*
*/} + {/* 右边预览 */} + +
{Preview}
+
+
) } diff --git a/BillNote_frontend/src/pages/HomePage/components/History.tsx b/BillNote_frontend/src/pages/HomePage/components/History.tsx index 6f33d35..3f34ae8 100644 --- a/BillNote_frontend/src/pages/HomePage/components/History.tsx +++ b/BillNote_frontend/src/pages/HomePage/components/History.tsx @@ -13,7 +13,7 @@ const History = () => {

生成历史

- + {/*
*/} {/*
*/} diff --git a/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx b/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx index 04934cb..1aef1bb 100644 --- a/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx +++ b/BillNote_frontend/src/pages/HomePage/components/NoteForm.tsx @@ -34,6 +34,7 @@ import NoteHistory from '@/pages/HomePage/components/NoteHistory.tsx' import { useModelStore } from '@/store/modelStore' import { Alert } from 'antd' import { Textarea } from '@/components/ui/textarea.tsx' +import { ScrollArea } from '@/components/ui/scroll-area.tsx' // ✅ 定义表单 schema const formSchema = z.object({ video_url: z.string().url('请输入正确的视频链接'), @@ -150,263 +151,269 @@ const NoteForm = () => { }, []) return ( -
-
- -
-
-

视频链接

- - - - - - -

输入视频链接,支持哔哩哔哩、YouTube等平台

-
-
-
-
+
+
+ +
+ + + +
+
+

视频链接

+ + + + + + +

输入视频链接,支持哔哩哔哩、YouTube等平台

+
+
+
+
-
- {/* 平台选择 */} - ( - - - - - )} - /> - - {/* 视频地址 */} - ( - - - - - - - )} - /> -
- {/*

*/} - {/* 支持哔哩哔哩视频链接,例如:*/} - {/* https://www.bilibili.com/video/BV1vc25YQE9X/*/} - {/*

*/} - ( - -
-

音频质量

- - - - - - -

质量越高,下载体积越大,速度越慢

-
-
-
-
- - {/**/} - {/* 质量越高,下载体积越大,速度越慢*/} - {/**/} - -
- )} - /> - - ( - -
-

模型选择

- - - - - - -

不同模型返回质量不同,可自行测试

-
-
-
-
- - {/**/} - {/* 质量越高,下载体积越大,速度越慢*/} - {/**/} - -
- )} - /> -
- - ( - -
-

笔记风格

- - - - - - -

选择你希望生成的笔记风格

-
-
-
-
- - - - -
- )} - /> - - ( - -
-

笔记格式

- - - - - - -

选择要包含的笔记元素,比如时间戳、截图提示或总结

-
-
-
-
- - -
- {noteFormats.map(item => ( - - ))} -
-
+
+ {/* 平台选择 */} ( -
-

备注

- - - - - - -

会把这段加入到Prompt最后 可自行测试

-
-
-
-
-