错误操作撤销了#653,补充提交
This commit is contained in:
parent
d7d235463e
commit
ef5bab1d92
|
|
@ -45,3 +45,18 @@ export const web_url = () => {
|
||||||
export const setapi = () => {
|
export const setapi = () => {
|
||||||
return window.baseApi
|
return window.baseApi
|
||||||
}
|
}
|
||||||
|
export const getkblist = (knowledge_base_id: any) => {
|
||||||
|
return api({
|
||||||
|
url: '/local_doc_qa/list_knowledge_base',
|
||||||
|
method: 'get',
|
||||||
|
params: {},
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
export const deletekb = (params: any) => {
|
||||||
|
return api({
|
||||||
|
url: '/local_doc_qa/delete_knowledge_base',
|
||||||
|
method: 'post',
|
||||||
|
data: JSON.stringify(params),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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, getfilelist } from '@/api/chat'
|
import { deletekb, getkblist } 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>([])
|
||||||
const choice = ref('')
|
const choice = ref('')
|
||||||
|
|
@ -11,7 +11,7 @@ const store = idStore()
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
choice.value = store.knowledgeid
|
choice.value = store.knowledgeid
|
||||||
const res = await getfilelist({})
|
const res = await getkblist({})
|
||||||
res.data.data.forEach((item: any) => {
|
res.data.data.forEach((item: any) => {
|
||||||
items.value.push({
|
items.value.push({
|
||||||
value: item,
|
value: item,
|
||||||
|
|
@ -52,8 +52,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 getkblist({})
|
||||||
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