File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
2834| ` result ` | ` "测试结果" ` |
2935| ` time ` | ` "运行用时" ` |
3036| ` memory ` | ` "内存消耗" ` |
31- | ` score ` | ` "得分" ` |
37+ | ` score ` | ` "得分" ` |
38+ | ` return_to_top ` | ` "返回顶部" ` |
3239
3340---
3441
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%" ` |
You can’t perform that action at this time.
0 commit comments