feat(knowledge): Add tag_id support for knowledge creation and file uploads

- Introduced tag_id parameter in various knowledge-related API functions to allow categorization of knowledge entries.
- Updated frontend components to handle tag_id during knowledge creation and file uploads.
- Enhanced UI store to manage the selected tag ID for better user experience in categorizing knowledge.
This commit is contained in:
Xia Dong
2026-01-14 18:51:12 +08:00
committed by begoniezhao
parent 6c90480e82
commit cec722aa43
10 changed files with 178 additions and 124 deletions
+6 -1
View File
@@ -10,6 +10,7 @@ import {
getKnowledgeDetailsCon,
} from "@/api/knowledge-base/index";
import { knowledgeStore } from "@/stores/knowledge";
import { useUIStore } from "@/stores/ui";
import { useRoute } from 'vue-router';
const usemenuStore = knowledgeStore();
@@ -110,7 +111,11 @@ export default function (knowledgeBaseId?: string) {
return;
}
uploadKnowledgeFile(currentKbId, { file })
// 获取当前选中的分类ID
const uiStore = useUIStore();
const tagIdToUpload = uiStore.selectedTagId !== '__untagged__' ? uiStore.selectedTagId : undefined;
uploadKnowledgeFile(currentKbId, { file, tag_id: tagIdToUpload })
.then((result: any) => {
if (result.success) {
MessagePlugin.info("上传成功!");