feat: 导出设置增强 —— 分辨率预设/自定义/历史记忆/日期命名
- 导出设置面板:分辨率预设(原始/1920×1080/1280×720/1024×768/800×600/自定义) - 自定义宽高手动输入,页面实时居中预览导出效果(原图 contain 居中,自动适配深色背景) - 分辨率历史记忆:localStorage 存最近5个,下拉一键复用 - 文件名:默认按日期时间自动命名(每次不同),支持手动命名(自动补扩展名) - 三个模式(图表/表格/双图合并)统一走带分辨率的导出 - 修复:DOMContentLoaded 提前调用 generateCombine 覆盖 chartArea,导致图表模式 echarts canvas 被破坏
This commit is contained in:
+45
-4
@@ -208,10 +208,46 @@ C, 20, 30, 40</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 导出按钮 -->
|
||||
<!-- 导出设置 + 按钮 -->
|
||||
<div class="panel-section" id="exportSection">
|
||||
<h2>📤 导出设置</h2>
|
||||
|
||||
<div class="config-group">
|
||||
<label>分辨率</label>
|
||||
<select id="exportPreset" onchange="onExportPresetChange()">
|
||||
<option value="original">原始大小</option>
|
||||
<option value="1920x1080">1920 × 1080</option>
|
||||
<option value="1280x720">1280 × 720</option>
|
||||
<option value="1024x768">1024 × 768</option>
|
||||
<option value="800x600">800 × 600</option>
|
||||
<option value="custom">自定义</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="config-group" id="customResGroup" style="display:none;">
|
||||
<label>自定义分辨率(宽 × 高)</label>
|
||||
<div class="res-input-row">
|
||||
<input type="number" id="customWidth" min="1" max="8192" placeholder="宽" oninput="onCustomResInput()">
|
||||
<span class="res-times">×</span>
|
||||
<input type="number" id="customHeight" min="1" max="8192" placeholder="高" oninput="onCustomResInput()">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label>历史分辨率(最近5个)</label>
|
||||
<select id="exportHistory" onchange="onHistorySelect()">
|
||||
<option value="">— 暂无历史 —</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="config-group">
|
||||
<label>文件名</label>
|
||||
<input type="text" id="exportFilename" placeholder="留空则按日期时间自动命名">
|
||||
<p class="hint-text" id="exportResHint"></p>
|
||||
</div>
|
||||
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-success" onclick="exportImage('png')">📥 导出PNG</button>
|
||||
<button class="btn btn-success" onclick="exportImage('png')">📥 下载图片</button>
|
||||
<button class="btn btn-success" id="btnExportSvg" onclick="exportImage('svg')">📥 导出SVG</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -342,12 +378,12 @@ C, 20, 30, 40</pre>
|
||||
|
||||
<div class="btn-group">
|
||||
<button class="btn btn-primary" onclick="generateCombine()">🖼️ 生成合并图</button>
|
||||
<button class="btn btn-success" onclick="exportCombine()">📥 导出PNG</button>
|
||||
<button class="btn btn-success" onclick="exportImage('png')">📥 下载图片</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 右侧面板:图表预览 + 风格切换 -->
|
||||
<!-- 右侧面板:图表预览 + 导出预览 + 风格切换 -->
|
||||
<div class="right-panel">
|
||||
<div class="chart-container">
|
||||
<div id="chartArea" class="chart-area">
|
||||
@@ -357,6 +393,11 @@ C, 20, 30, 40</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 导出效果预览(按分辨率居中展示保存后的图) -->
|
||||
<div class="export-preview-box" id="exportPreviewBox" style="display:none;">
|
||||
<div class="export-preview-title" id="exportPreviewTitle">📐 导出预览</div>
|
||||
<div class="export-preview-inner" id="exportPreviewInner"></div>
|
||||
</div>
|
||||
<!-- 风格快速切换按钮(放在图表右侧) -->
|
||||
<div class="theme-buttons-section">
|
||||
<h3>🎨 风格</h3>
|
||||
|
||||
Reference in New Issue
Block a user