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 ( -