Files
easygoadmin-wiki/EasyGoAdmin_Gin_AntdVue/zh/modules/file-template.md
T
2026-10-25 17:24:27 +08:00

34 lines
1022 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 6.21 文件模板管理
:::tip 概述
文件模板(gin_file_template)管理可复用的文件模板(导入模板、导出表头模板等):登记模板元信息、提供按编码获取的入口,配套文件字段的上传转正。
:::
## 功能清单
| 接口 | 说明 |
|---|---|
| Page / List / Detail | 标准查询 |
| Add / Update | 维护(文件字段经 FileFields 转正) |
| Delete / BatchDelete | 软删除 |
| ByCode | 按模板编码获取(业务侧下载导入模板的标准入口) |
## 典型用法
```text
导入功能配套模板:
管理页上传标准导入模板(xlsx)→ 登记编码(如 user_import)
业务页"下载模板" → ByCode(user_import) → 返回文件 URL → 前端下载
```
用户下载的模板与导入解析的列头保持同源,避免文档漂移。
## 管理界面
`file/fileTemplate`:列表 + 上传 + 编码管理。
## 相关
- [7.1 文件上传全流程](/zh/tools/upload.html)
- [7.4 数据导入导出](/zh/tools/excel.html)