feat: 新增表格图片生成功能

- 新增 POST/GET /api/table 接口
- 支持5种主题风格、自定义字体大小、斑马纹等
- 前端新增图表/表格模式切换
- 完美支持中文内容显示(Noto Sans CJK SC)
- 更新 API 文档和 README
This commit is contained in:
2026-07-17 12:40:47 +08:00
parent 02212e9ef7
commit e2f9892a2a
5 changed files with 657 additions and 14 deletions
+79
View File
@@ -378,3 +378,82 @@ body {
.panel-section {
animation: fadeIn 0.3s ease-out;
}
/* ===== 模式切换 ===== */
.mode-switch {
display: flex;
gap: 8px;
}
.mode-btn {
flex: 1;
padding: 10px 16px;
border: 2px solid var(--border);
border-radius: 8px;
background: white;
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
color: var(--text-light);
}
.mode-btn:hover {
border-color: var(--primary);
color: var(--primary);
}
.mode-btn.active {
background: var(--primary);
border-color: var(--primary);
color: white;
}
/* ===== 表格预览 ===== */
.table-preview {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
}
.table-preview img {
max-width: 100%;
max-height: 100%;
border-radius: 8px;
box-shadow: var(--shadow);
}
/* ===== 滑块样式 ===== */
input[type="range"] {
width: 100%;
height: 6px;
border-radius: 3px;
background: #e2e8f0;
outline: none;
-webkit-appearance: none;
appearance: none;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--primary);
cursor: pointer;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input[type="range"]::-moz-range-thumb {
width: 18px;
height: 18px;
border-radius: 50%;
background: var(--primary);
cursor: pointer;
border: none;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}