fix(前端): 删除知识库改为使用删除知识库接口
This commit is contained in:
parent
7cbdc6702e
commit
3efd408f5a
|
|
@ -24,6 +24,16 @@ export const getKbsList = () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const deleteKb = (knowledge_base_id: any) => {
|
||||||
|
return api({
|
||||||
|
url: '/local_doc_qa/delete_knowledge_base',
|
||||||
|
method: 'delete',
|
||||||
|
params: {
|
||||||
|
knowledge_base_id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export const getfilelist = (knowledge_base_id: any) => {
|
export const getfilelist = (knowledge_base_id: any) => {
|
||||||
return api({
|
return api({
|
||||||
url: '/local_doc_qa/list_files',
|
url: '/local_doc_qa/list_files',
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { NButton, NForm, NFormItem, NInput, NPopconfirm } from 'naive-ui'
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import filelist from './filelist.vue'
|
import filelist from './filelist.vue'
|
||||||
import { SvgIcon } from '@/components/common'
|
import { SvgIcon } from '@/components/common'
|
||||||
import { deletefile, getKbsList, getfilelist } from '@/api/chat'
|
import { deleteKb, getKbsList } from '@/api/chat'
|
||||||
import { idStore } from '@/store/modules/knowledgebaseid/id'
|
import { idStore } from '@/store/modules/knowledgebaseid/id'
|
||||||
|
|
||||||
const items = ref<any>([])
|
const items = ref<any>([])
|
||||||
|
|
@ -53,8 +53,8 @@ const handleClick = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function handleDelete(item: any) {
|
async function handleDelete(item: any) {
|
||||||
await deletefile(item.value)
|
await deleteKb(item.value)
|
||||||
const res = await getfilelist({})
|
const res = await getKbsList()
|
||||||
items.value = []
|
items.value = []
|
||||||
res.data.data.forEach((item: any) => {
|
res.data.data.forEach((item: any) => {
|
||||||
items.value.push({
|
items.value.push({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue