Files
ops2/.workbuddy/memory/2026-05-06.md
T
2026-05-06 19:07:54 +08:00

45 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-05-06 日志
## 日历事件日程类型功能
### 修改内容
- **后端** `routers/apiCalendar.go`:
- `TabCalendarEvent` 结构体新增 `ScheduleType string` 字段(默认值 work
- `addevent`/`updateevent` 接口解析并保存 `schedule_type` 参数
- **前端** `CalendarDetail.vue`:
- `eventData` 新增 `scheduleType` 字段
- `openEventModal`/`editEvent` 传递 `scheduleType`
- `selectColor` 函数联动更新 `scheduleType`
- `saveEvent`/`eventDrop` 提交 `schedule_type`
- `getEvents` 返回数据附加 `extendedProps.scheduleType`
- 模态框显示日程类型标签
- **i18n**:
- `zh-CN.json`: 新增 `event_type: "日程类型"`
- `en.json`: 新增 `event_type: "Event Type"`
### 日程类型选项
- work - 工作
- duty - 值班
- exam - 考试
- standby - 备用
- personal_holiday - 个人假期
- public_holiday - 公众假期
### 注意事项
- GORM AutoMigrate 会自动添加新字段
- 前端颜色选择与日程类型联动
## 修复:calendar/events jsonErr
**问题**`fromGetCalendarEvents``start/end``*time.Time` 类型,无法直接解析字符串格式的日期。
**修复**:改为直接用类型断言解析字符串,用 `time.Parse("2006-01-02", ...)` 解析。
## 优化:BgColor 弃用,前端根据 ScheduleType 渲染颜色
**前端**:添加 `getColorByScheduleType()` 函数,`getEvents` 中使用 scheduleType 映射颜色。
**后端**:只存储 ScheduleType,不处理颜色逻辑。颜色完全由前端 `colorOptions` 控制。