feat(knowledge): 添加知识条目导出功能和文件上传支持

- 在 KnowledgeItemApplicationService 中新增 exportKnowledgeItems 方法实现知识条目导出
- 添加 export 相关常量配置包括文件名格式、内容类型等
- 在 KnowledgeItemRepository 中新增 findAllBySetId 查询方法
- 在 KnowledgeItemController 中新增 export 接口端点
- 在 KnowledgeItemEditor 组件中添加文件上传功能支持 txt/md/markdown 格式
- 在 KnowledgeSetDetail 页面中添加导出按钮并集成导出 API
- 更新前端 API 文件添加 exportKnowledgeItemsUsingGet 方法
- 配置文件上传验证和自动填充标题内容逻辑
This commit is contained in:
2026-01-26 11:13:21 +08:00
parent be98a9534c
commit a8c7c9404c
7 changed files with 153 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { get, post, put, del } from "@/utils/request";
import { get, post, put, del, download } from "@/utils/request";
// 知识集列表
export function queryKnowledgeSetsUsingGet(params?: Record<string, unknown>) {
@@ -54,3 +54,8 @@ export function updateKnowledgeItemByIdUsingPut(setId: string, itemId: string, d
export function deleteKnowledgeItemByIdUsingDelete(setId: string, itemId: string) {
return del(`/api/data-management/knowledge-sets/${setId}/items/${itemId}`);
}
// 导出知识条目
export function exportKnowledgeItemsUsingGet(setId: string) {
return download(`/api/data-management/knowledge-sets/${setId}/items/export`);
}