feat: 实现虚拟列表、拖拽排序、实时预览防抖,更新文档

- DataPreview: 大数据量(>100条)自动启用虚拟滚动,仅渲染可见区域
- FieldList: 基于 @dnd-kit/sortable 实现拖拽排序
- index.tsx: 配置变更时300ms防抖生成预览数据
- ui-design.md: 去除平板/移动端响应式、快捷键,更新交互说明
- technical-implementation.md: 去除downloadAsZip,更新虚拟列表说明
This commit is contained in:
雨霖铃
2026-06-06 09:42:58 +08:00
parent 1a92e88934
commit 49e7f1ea55
6 changed files with 329 additions and 171 deletions
@@ -1481,28 +1481,15 @@ export class DataExporter {
});
}
// 下载为 ZIP(需要引入 jszip 库)
static async downloadAsZip(
files: ExportFile[],
zipFilename: string = 'export.zip',
): Promise<void> {
// 动态导入 jszip
const JSZip = (await import('jszip')).default;
const zip = new JSZip();
files.forEach((file) => {
zip.file(file.filename, file.content);
});
const content = await zip.generateAsync({ type: 'blob' });
const url = URL.createObjectURL(content);
const a = document.createElement('a');
a.href = url;
a.download = zipFilename;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
// 复制到剪贴板
static async copyToClipboard(content: string): Promise<boolean> {
try {
await navigator.clipboard.writeText(content);
return true;
} catch (error) {
console.error('[DataExporter] 复制失败:', error);
return false;
}
}
}
```
@@ -1860,9 +1847,9 @@ toast.error('生成失败:生成器不存在');
### 4. 虚拟列表
- 大数据预览使用虚拟列表
- 只渲染可见区域
- 减少 DOM 渲染
- 大数据预览>100 条)自动启用虚拟滚动
- 行高固定 20px,仅渲染可见区域 ±5 行缓冲
- 大幅减少 DOM 节点数量,优化滚动性能
---