feat(knowledge): 添加知识库文件目录结构支持功能

- 在 KnowledgeItem 模型中增加 relativePath 字段存储相对路径
- 实现文件上传时的目录前缀处理和相对路径构建逻辑
- 添加批量删除知识条目的接口和实现方法
- 重构前端 KnowledgeSetDetail 组件以支持目录浏览和管理
- 实现文件夹创建、删除、导航等目录操作功能
- 更新数据查询逻辑以支持按相对路径进行搜索和过滤
- 添加前端文件夹图标显示和目录层级展示功能
This commit is contained in:
2026-01-31 17:45:43 +08:00
parent c1fb02b0f5
commit 310bc356b1
15 changed files with 664 additions and 123 deletions

View File

@@ -106,6 +106,7 @@ export type KnowledgeItemView = {
sensitivity?: string;
sourceDatasetId?: string;
sourceFileId?: string;
relativePath?: string;
metadata?: string;
createdAt?: string;
updatedAt?: string;
@@ -153,6 +154,7 @@ export function mapKnowledgeItem(data: KnowledgeItem): KnowledgeItemView {
sensitivity: data.sensitivity,
sourceDatasetId: data.sourceDatasetId,
sourceFileId: data.sourceFileId,
relativePath: data.relativePath,
metadata: data.metadata,
createdAt: data.createdAt ? formatDateTime(data.createdAt) : "",
updatedAt: data.updatedAt ? formatDateTime(data.updatedAt) : "",