You've already forked DataMate
feat(knowledge): 添加知识库文件目录结构支持功能
- 在 KnowledgeItem 模型中增加 relativePath 字段存储相对路径 - 实现文件上传时的目录前缀处理和相对路径构建逻辑 - 添加批量删除知识条目的接口和实现方法 - 重构前端 KnowledgeSetDetail 组件以支持目录浏览和管理 - 实现文件夹创建、删除、导航等目录操作功能 - 更新数据查询逻辑以支持按相对路径进行搜索和过滤 - 添加前端文件夹图标显示和目录层级展示功能
This commit is contained in:
@@ -16,6 +16,7 @@ export default function KnowledgeItemEditor({
|
||||
open,
|
||||
setId,
|
||||
data,
|
||||
parentPrefix,
|
||||
onCancel,
|
||||
onSuccess,
|
||||
readOnly,
|
||||
@@ -23,6 +24,7 @@ export default function KnowledgeItemEditor({
|
||||
open: boolean;
|
||||
setId: string;
|
||||
data?: Partial<KnowledgeItem> | null;
|
||||
parentPrefix?: string;
|
||||
readOnly?: boolean;
|
||||
onCancel: () => void;
|
||||
onSuccess: () => void;
|
||||
@@ -102,6 +104,9 @@ export default function KnowledgeItemEditor({
|
||||
formData.append("files", origin);
|
||||
}
|
||||
});
|
||||
if (parentPrefix) {
|
||||
formData.append("parentPrefix", parentPrefix);
|
||||
}
|
||||
await uploadKnowledgeItemsUsingPost(setId, formData);
|
||||
message.success(`已创建 ${fileList.length} 个知识条目`);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user