Skip to content

Commit d2dede3

Browse files
committed
feat(readme): update
1 parent 56c0f4b commit d2dede3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/component/exportutil/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# README
1+
# ExportUtil 导出模块
2+
3+
本模块负责将比赛成绩导出为 HTML 或 CSV 格式。
4+
5+
HTML 导出采用 **JSON + 模板** 方案:C++ 端通过 `buildExportJson()` 构建包含全部比赛数据的 JSON 对象,然后将其嵌入 `export_template.html` 中的 `%%DATA%%` 占位符,由浏览器端 JavaScript 完成页面渲染。这种方式将数据构造与页面展示解耦,C++ 代码只需关注 JSON 结构,无需拼接 HTML 字符串。
6+
7+
以下是 JSON 数据的结构说明。
28

39
### 顶级字段
410

@@ -28,7 +34,8 @@
2834
| `result` | `"测试结果"` |
2935
| `time` | `"运行用时"` |
3036
| `memory` | `"内存消耗"` |
31-
| `score` | `"得分"` |
37+
| `score` | `"得分"` |
38+
| `return_to_top` | `"返回顶部"` |
3239

3340
---
3441

@@ -37,6 +44,7 @@
3744
| 字段名 | 类型 | 说明 | 举例 |
3845
| -------------- | ---------- | -------------------- | --------------- |
3946
| `name` | `string` | 选手姓名 | `"Alice"` |
47+
| `rank` | `number` | 选手排名 | `1` |
4048
| `total_score` | `number` | 选手总分 | `200` |
4149
| `total_bg` | `string` | 总分单元格背景 (HSL) | `"0, 70%, 90%"` |
4250
| `total_border` | `string` | 总分单元格边框 (HSL) | `"0, 70%, 50%"` |

0 commit comments

Comments
 (0)