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 -2
View File
@@ -823,9 +823,11 @@ const handleDocFileChange = async (event: Event) => {
}))
try {
// 获取当前选中的分类ID
const tagIdToUpload = uiStore.selectedTagId !== '__untagged__' ? uiStore.selectedTagId : undefined
await uploadKnowledgeFile(
kbId,
{ file },
{ file, tag_id: tagIdToUpload },
(progressEvent: any) => {
if (progressEvent.total) {
progress = Math.round((progressEvent.loaded * 100) / progressEvent.total)
@@ -1067,9 +1069,11 @@ const handleDocFolderChange = async (event: Event) => {
}))
try {
// 获取当前选中的分类ID
const tagIdToUpload = uiStore.selectedTagId !== '__untagged__' ? uiStore.selectedTagId : undefined
await uploadKnowledgeFile(
kbId,
{ file, fileName },
{ file, fileName, tag_id: tagIdToUpload },
(progressEvent: any) => {
if (progressEvent?.total) {
progress = Math.round((progressEvent.loaded * 100) / progressEvent.total)