From 84cd345b9f15b1bed4ff4361022c559f16420a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=80=9D=E8=AF=BA=E7=89=B9?= Date: Sun, 27 Apr 2025 16:57:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20=E9=87=8D=E6=9E=84=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=B8=83=E5=B1=80=E5=B9=B6=E6=B7=BB=E5=8A=A0=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=8E=86=E5=8F=B2=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 History 组件用于展示生成历史记录 - 调整 HomeLayout 布局,增加 History 侧边栏 - 优化 NoteHistory 组件样式和布局- 更新首页样式,调整各个组件的位置和样式 --- BillNote_frontend/src/index.css | 26 +++- BillNote_frontend/src/layouts/HomeLayout.tsx | 14 +- BillNote_frontend/src/pages/HomePage/Home.tsx | 2 + .../src/pages/HomePage/components/History.tsx | 26 ++++ .../pages/HomePage/components/NoteForm.tsx | 42 +----- .../pages/HomePage/components/NoteHistory.tsx | 138 +++++++++++------- .../src/pages/HomePage/components/StepBar.tsx | 5 +- README.md | 28 ++-- backend/app/downloaders/youtube_downloader.py | 4 +- backend/app/gpt/prompt_builder.py | 2 +- backend/app/services/note.py | 28 ++-- backend/main.py | 2 +- doc/image1.png | Bin 361966 -> 134758 bytes doc/image2.png | Bin 903976 -> 499470 bytes doc/image3.png | Bin 900418 -> 145199 bytes 15 files changed, 190 insertions(+), 127 deletions(-) create mode 100644 BillNote_frontend/src/pages/HomePage/components/History.tsx diff --git a/BillNote_frontend/src/index.css b/BillNote_frontend/src/index.css index 1f0280c..2f2aaed 100644 --- a/BillNote_frontend/src/index.css +++ b/BillNote_frontend/src/index.css @@ -2,6 +2,30 @@ @import 'tw-animate-css'; @custom-variant dark (&:is(.dark *)); +html,body{ + height: 100%; + width: 100%; +} +/* 修改滚动条轨道颜色 */ +::-webkit-scrollbar { + width: 8px; /* 控制滚动条的宽度 */ +} + +/* 修改滚动条的轨道颜色 */ +::-webkit-scrollbar-track { + background-color: #f1f1f1; /* 轨道的背景颜色 */ +} + +/* 修改滚动条的滑块颜色 */ +::-webkit-scrollbar-thumb { + background-color: #888; /* 滑块的颜色 */ + border-radius: 4px; /* 圆角 */ +} + +/* 当鼠标悬停时,修改滑块颜色 */ +::-webkit-scrollbar-thumb:hover { + background-color: #555; /* 悬停时的颜色 */ +} :root { --radius: 0.625rem; @@ -21,7 +45,7 @@ --accent: oklch(0.97 0 0); --accent-foreground: oklch(0.205 0 0); --destructive: oklch(0.577 0.245 27.325); - --border: #e6f7ff; + --border: var( --color-neutral-200); --input: oklch(0.922 0 0); --ring: #096dd9; --chart-1: oklch(0.646 0.222 41.116); diff --git a/BillNote_frontend/src/layouts/HomeLayout.tsx b/BillNote_frontend/src/layouts/HomeLayout.tsx index d1a323f..8aa300c 100644 --- a/BillNote_frontend/src/layouts/HomeLayout.tsx +++ b/BillNote_frontend/src/layouts/HomeLayout.tsx @@ -13,15 +13,16 @@ import { Link } from 'react-router-dom' interface IProps { NoteForm: React.ReactNode Preview: React.ReactNode + History: React.ReactNode } -const HomeLayout: FC = ({ NoteForm, Preview }) => { +const HomeLayout: FC = ({ NoteForm, Preview, History }) => { const [, setShowSettings] = useState(false) return ( -
+
{/* 左侧部分:Header + 表单 */} -
-
+
{noteFormats.map(item => (
-