This commit is contained in:
2026-05-06 22:45:14 +08:00
parent c7ee091ad1
commit 18af17e9b3
4 changed files with 196 additions and 2 deletions
+29
View File
@@ -84,3 +84,32 @@
**i18n 新增**
- `zh-CN.json`: `calendar.admin_title = "日历管理"`, `calendar.event_count = "日程数量"`
- `en.json`: `calendar.admin_title = "Calendar Admin"`, `calendar.event_count = "Event Count"`
## 修复:CalendarAdminList eventCounts 未定义
**问题**:模板访问 `eventCounts[calendar.ID]``eventCounts` 从未声明,且 `fetchEventCounts` 未被调用。
**修复**:后端已直接返回 `event_count` 字段,改为模板直接用 `calendar.event_count ?? 0`,删除多余的 `eventCounts` ref 和 `fetchEventCounts` 函数。
## 新增:后端 TabCalendarEventUserBind 绑定表
**文件**`routers/binds.go`
- 新增 `TabCalendarEventUserBind` 结构体(EventID/UserID/CreatorID/CreatedAt
-`BindsInit` AutoMigrate 中注册
## 新增:日历右键菜单(复制/粘贴日程)
**文件**`CalendarDetail.vue`
**功能**
- 右键日程事件弹出上下文菜单,显示「复制日程」「粘贴日程」
- 复制:将日程数据存入 `clipboard` ref
- 粘贴:以 clipboard 数据调用 `addEvent` API 创建新日程
- 点击任意位置关闭菜单
**实现**
- `contextMenu` ref 管理菜单显示/位置/事件数据
- `clipboard` ref 存储复制的日程
- `eventDidMount` 中为每个事件绑定 `contextmenu` 事件
- `onMounted` 注册全局 click 关闭菜单,`onBeforeUnmount` 移除
- i18n 新增 `calendar.copy_event/paste_event/copy_success/paste_success/no_event_to_paste`