From e6794a19521cff4aaac5dfe42923e0020e4ca61a Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Wed, 11 Feb 2026 10:26:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.jsx | 4 + frontend/src/pages/Desktop.css | 49 +++++-- frontend/src/pages/Desktop.jsx | 29 +++-- .../src/pages/Document/DocumentEditor.jsx | 7 +- .../src/pages/ProjectList/ProjectList.css | 43 ++++++ .../src/pages/ProjectList/ProjectList.jsx | 123 +++++++++++------- 6 files changed, 188 insertions(+), 67 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index eabb62f..2718ca2 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -2,6 +2,8 @@ import { useEffect } from 'react' import { BrowserRouter, Routes, Route, Navigate, useParams, Outlet } from 'react-router-dom' import { ConfigProvider, theme } from 'antd' import zhCN from 'antd/locale/zh_CN' +import dayjs from 'dayjs' +import 'dayjs/locale/zh-cn' import useThemeStore from '@/stores/themeStore' import Login from '@/pages/Login/Login' import ProjectList from '@/pages/ProjectList/ProjectList' @@ -21,6 +23,8 @@ import ProtectedRoute from '@/components/ProtectedRoute' import MainLayout from '@/components/MainLayout/MainLayout' import '@/App.css' +dayjs.locale('zh-cn') + // 重定向到文档页面的组件 function RedirectToDocs() { const { projectId } = useParams() diff --git a/frontend/src/pages/Desktop.css b/frontend/src/pages/Desktop.css index f9e562a..205eac2 100644 --- a/frontend/src/pages/Desktop.css +++ b/frontend/src/pages/Desktop.css @@ -4,20 +4,51 @@ .page-title { margin-bottom: 24px; - color: #333; font-size: 24px; font-weight: 600; } +/* 日历卡片 */ .calendar-card { height: 100%; min-height: 400px; } .calendar-card .ant-picker-calendar { - padding: 12px; + padding: 0; } +/* 日历头部选择器 */ +.calendar-card .ant-picker-calendar-header { + padding: 8px 12px; +} + +/* 日历单元格 - 迷你模式 */ +.calendar-card .ant-picker-cell { + position: relative; +} + +.calendar-card .ant-picker-cell .ant-picker-cell-inner { + min-width: 28px; + height: 28px; + line-height: 28px; + border-radius: 6px; +} + +/* Badge 相对于日期本身定位 */ +.calendar-card .ant-badge { + display: inline-block; + position: relative; +} + +.calendar-card .ant-badge-count { + position: absolute; + top: -2px; + right: -2px; + z-index: 10; +} + +/* 活动卡片 */ .activity-card { height: 100%; min-height: 400px; @@ -58,17 +89,17 @@ border-radius: 4px; } -/* 日历单元格样式 */ -.ant-picker-calendar-date { - position: relative; +/* 暗色模式适配 */ +body.dark .activity-item-clickable:hover { + background-color: rgba(24, 144, 255, 0.15); } -.ant-picker-calendar-date-today { - border-color: #1890ff; +body.dark .activity-item-clickable:active { + background-color: rgba(24, 144, 255, 0.25); } -.ant-picker-calendar-date-selected { - background-color: #e6f7ff; +body.dark .activity-item-disabled:hover { + background-color: rgba(255, 255, 255, 0.04); } /* 响应式调整 */ diff --git a/frontend/src/pages/Desktop.jsx b/frontend/src/pages/Desktop.jsx index 0afd05b..315ae96 100644 --- a/frontend/src/pages/Desktop.jsx +++ b/frontend/src/pages/Desktop.jsx @@ -53,22 +53,31 @@ function Desktop() { } // 日历单元格渲染 - const dateCellRender = (value) => { + const dateCellRender = (value, info) => { + if (info.type !== 'date') return info.originNode + const dateStr = value.format('YYYY-MM-DD') const activity = activityDates.find(item => item.date === dateStr) if (activity && activity.count > 0) { return ( -
- -
+ + {info.originNode} + ) } - return null + + return info.originNode } // 日期选择事件 @@ -114,7 +123,7 @@ function Desktop() { value={selectedDate} onSelect={onSelect} onPanelChange={onPanelChange} - cellRender={dateCellRender} + fullCellRender={dateCellRender} /> diff --git a/frontend/src/pages/Document/DocumentEditor.jsx b/frontend/src/pages/Document/DocumentEditor.jsx index a17465b..a508bb4 100644 --- a/frontend/src/pages/Document/DocumentEditor.jsx +++ b/frontend/src/pages/Document/DocumentEditor.jsx @@ -18,6 +18,7 @@ import { FilePdfOutlined, FileTextOutlined, UndoOutlined, + CloseOutlined, } from '@ant-design/icons' import { Editor } from '@bytemd/react' import gfm from '@bytemd/plugin-gfm' @@ -889,7 +890,11 @@ function DocumentEditor() { className="document-sider" >
-

{projectName}

+
+

+ {projectName} +

+