Skip to content

Commit 82cd954

Browse files
wangdan-fit2cloudshaohuzhang1
authored andcommitted
fix: Knowledge base and tool root directory transfer issue
1 parent c3c5f64 commit 82cd954

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

ui/src/views/knowledge/component/KnowledgeListContainer.vue

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,13 @@ function openMoveToDialog(data: any) {
404404
}
405405
406406
function refreshKnowledgeList(row: any) {
407-
const list = cloneDeep(knowledge.knowledgeList)
408-
const index = list.findIndex((v) => v.id === row.id)
409-
list.splice(index, 1)
410-
knowledge.setKnowledgeList(list)
407+
// 不是根目录才会移除
408+
if (folder.currentFolder?.parent_id) {
409+
const list = cloneDeep(knowledge.knowledgeList)
410+
const index = list.findIndex((v) => v.id === row.id)
411+
list.splice(index, 1)
412+
knowledge.setKnowledgeList(list)
413+
}
411414
}
412415
413416
const CreateKnowledgeDialogRef = ref()
@@ -477,6 +480,7 @@ function deleteKnowledge(row: any) {
477480
const index = list.findIndex((v) => v.id === row.id)
478481
list.splice(index, 1)
479482
knowledge.setKnowledgeList(list)
483+
480484
MsgSuccess(t('common.deleteSuccess'))
481485
})
482486
})

ui/src/views/tool/component/ToolListContainer.vue

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,7 @@
171171
:disabled="permissionPrecise.edit(item.id)"
172172
>
173173
<template #icon>
174-
<el-avatar
175-
v-if="item?.icon"
176-
shape="square"
177-
:size="32"
178-
style="background: none"
179-
>
174+
<el-avatar v-if="item?.icon" shape="square" :size="32" style="background: none">
180175
<img :src="resetUrl(item?.icon)" alt="" />
181176
</el-avatar>
182177
<ToolIcon v-else :size="32" :type="item?.tool_type" />
@@ -473,10 +468,13 @@ function openMoveToDialog(data: any) {
473468
}
474469
475470
function refreshToolList(row: any) {
476-
const list = cloneDeep(tool.toolList)
477-
const index = list.findIndex((v) => v.id === row.id)
478-
list.splice(index, 1)
479-
tool.setToolList(list)
471+
// 不是根目录才会移除
472+
if (folder.currentFolder?.parent_id) {
473+
const list = cloneDeep(tool.toolList)
474+
const index = list.findIndex((v) => v.id === row.id)
475+
list.splice(index, 1)
476+
tool.setToolList(list)
477+
}
480478
}
481479
482480
const AuthorizedWorkspaceDialogRef = ref()

0 commit comments

Comments
 (0)