Files
timeTableFix/README.md
zikai d32f8be018 refactor: 清理死代码 + 提前失败 + 错误记录控制台
- 移除 EventDetail.vue 未用的 computed 导入
- 移除 HeaderBar.vue 未用的 .btn-secondary CSS
- store (updateEvent/splitEvent/toggleOccurrence): uid 缺失改抛错 (fail-fast), 不再静默 return
- EventDetail onSplit: 捕获 splitEvent 抛错并提示用户
- DropZone/HeaderBar 解析失败: catch 内补 console.error
- ical-io getZone: 时区未注册回退 UTC 时 console.warn
- WeekPreview 周标签改用 i18n (weekPreview.rangeFmt), 与 MonthPreview 一致
- docs: 新增 error-handling.md; 修正 auto-save-design state 快照补 timezone
- README: 补充部署说明 (经 zMainPage apache2 托管)
2026-07-28 11:08:06 +08:00

89 lines
3.8 KiB
Markdown
Raw Permalink 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.

# timeTableFix - 纯前端 ICS 日历整理器
浏览器内解析、去重、编辑 ICS 日历文件,全程无需后端服务。拖入 `.ics` -> 整理去重 -> 编辑 -> 下载。独立可维护,亦可作为 [mainPage](https://git.zikai.wang/zikai/zMainPage) 的子模块集成展示。
## 项目结构
```
timeTableFix/
├── index.html Vite 入口
├── package.json
├── vite.config.js
├── vitest.config.js
├── .npmrc npmmirror 镜像加速
├── README.md
├── src/
│ ├── main.js 应用挂载i18n + 全局样式)
│ ├── App.vue 便携式根组件(嵌入与独立两用)
│ ├── i18n/ 独立 vue-i18n 实例 + 中英 locale
│ ├── composables/
│ │ ├── useCalendar.js 中心 store自动保存无 undo
│ │ └── useLocale.js 语言辅助(直读自身 i18n 实例)
│ ├── lib/
│ │ ├── weekday.js 星期常量与工具
│ │ ├── date.js 日期工具
│ │ ├── timezone.js 时区检测 / 选择(回退墨尔本)
│ │ ├── colors.js 事件配色
│ │ ├── uuid.js UUID 生成(含非安全上下文回退)
│ │ ├── ical-io.js ICS 文本 <-> plain model
│ │ ├── recur.js RRULE 网格展开
│ │ ├── organize.js 间隔去重 + 链拆分算法
│ │ ├── event-factory.js 事件构造工厂
│ │ └── split.js 事件拆分逻辑
│ └── components/
│ ├── HeaderBar.vue 顶栏:整理/导入/下载
│ ├── DropZone.vue 拖拽/选择文件
│ ├── EventList.vue 侧栏事件列表
│ ├── EventDetail.vue 编辑表单 + 拆分
│ ├── OccurrenceGrid.vue 排除日期网格
│ ├── MonthPreview.vue 月预览
│ └── WeekPreview.vue 周预览
├── test/ Vitest 单元测试
└── docs/ 设计文档
```
## 外部依赖
| 项 | 说明 |
|----|------|
| Node.js | ≥ 18 |
| ical.js | ICS 解析库npm 依赖) |
> 纯前端应用,无运行期后端依赖。生产部署经 [zMainPage](https://git.zikai.wang/zikai/zMainPage) 作为子模块集成,由其 apache2 静态托管(无独立 apache2 配置);详见 zMainPage 的部署文档。
## 如何使用
```bash
# 克隆并安装
git clone https://git.zikai.wang/zikai/timeTableFix.git
cd timeTableFix
npm install # 已配 npmmirror 镜像加速
npm run dev # 开发服务器 http://localhost:5173
npm run build # 构建到 dist/
npm test # 单元测试57 项)
```
顶栏时区选择器在加载时自动检测用户所在时区,检测不到则默认澳大利亚墨尔本;仅作为新建事件与下载 ICS 的默认时区,不做时间换算。详见 [`docs/timezone.md`](./docs/timezone.md)。
## 技术栈
| 项 | 选择 |
|----|------|
| 框架 | Vue 3.5SFC`<script setup>` |
| 构建 | Vite 6 |
| ICS 库 | ical.js 2.x |
| 国际化 | vue-i18n 9中文同步英文懒加载 |
| 状态管理 | composable 单例 store |
| 测试 | Vitest |
| 包源 | npmmirror.com中国镜像加速 |
## 了解更多
- [嵌入 mainPagei18n prop 桥接 / 样式隔离)](./docs/integration.md)
- [时区选择(自动检测 / 回退墨尔本)](./docs/timezone.md)
- [间隔合并与链拆分算法](./docs/organize-algorithm.md)
- [自动保存设计](./docs/auto-save-design.md)
- [错误处理与日志约定](./docs/error-handling.md)
- [初始设计文档](./docs/superpowers/specs/2026-07-13-timetable2-design.md)