|
|
@@ -527,7 +527,7 @@
|
|
|
<button class="modal-close" @click="showDetailModal = false"><i class="fas fa-times"></i></button>
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
- <div class="detail-section">
|
|
|
+ <div class="detail-section" v-if="doc_form=='qa_model'">
|
|
|
<div class="detail-label"><i class="fas fa-lightbulb"></i> 答案内容</div>
|
|
|
<div class="detail-content">{{ selectedKnowledge.answer }}</div>
|
|
|
</div>
|
|
|
@@ -851,14 +851,15 @@ const getCategoryList = (id,type) => {
|
|
|
documentsParams.value.keyword = searchQuery.value
|
|
|
documentsParams.value.pageSize = 10
|
|
|
}else{
|
|
|
+ documentsParams.value.dataset_id = id?id:''
|
|
|
documentsParams.value.pageSize = 9999
|
|
|
}
|
|
|
getAllDocumnets(documentsParams.value).then(res => {
|
|
|
- console.log(res)
|
|
|
if(type=='add'){ //添加知识获取分类
|
|
|
documentList.value = res.result.data
|
|
|
}else{
|
|
|
knowledgeList.value = res.result.data
|
|
|
+
|
|
|
tabs.value[1].count = categoryTotal.value = res.result.total
|
|
|
}
|
|
|
})
|
|
|
@@ -899,10 +900,11 @@ const getChunkDatasets = () => {
|
|
|
const apiFn = chunkParams.value.document_id ? getChunks : getAllChunks
|
|
|
apiFn(chunkParams.value).then(res => {
|
|
|
chunkLoading.value = false
|
|
|
- chunkList.value = res.result.data
|
|
|
res.result.data.forEach(el => {
|
|
|
el.timeip = formatTimeAgo(el.updated_at)
|
|
|
+ el.dataset_id = chunkParams.value.dataset_id
|
|
|
});
|
|
|
+ chunkList.value = res.result.data
|
|
|
chunksTotal.value = res.result.total
|
|
|
doc_form.value = res.result.doc_form
|
|
|
})
|
|
|
@@ -1083,7 +1085,6 @@ const detailDocument = (item) => {
|
|
|
document_id:item.id,
|
|
|
}
|
|
|
getDocumentDetail(params).then(res => {
|
|
|
- console.log(555)
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -1099,6 +1100,7 @@ const addKnowledgeDocument = ()=> {
|
|
|
newKnowledge.value.segment_id=''
|
|
|
chunkType.value = 'add'
|
|
|
showAddModal.value = true
|
|
|
+ documentList.value = []
|
|
|
}
|
|
|
const addKnowledge = () => {
|
|
|
if(!newKnowledge.value.answer||!newKnowledge.value.content||!newKnowledge.value.dataset_id||!newKnowledge.value.document_id){
|
|
|
@@ -1108,14 +1110,14 @@ const addKnowledge = () => {
|
|
|
if(chunkType.value =='add'){
|
|
|
createChunk(newKnowledge.value).then(res => {
|
|
|
if(res.success){
|
|
|
- howToastMessage('知识添加成功,AI 已学习', 'success')
|
|
|
+ showToastMessage('知识添加成功,AI 已学习', 'success')
|
|
|
showAddModal.value = false
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
editChunk(newKnowledge.value).then(res => {
|
|
|
if(res.success){
|
|
|
- howToastMessage('知识编辑成功,AI 已学习', 'success')
|
|
|
+ showToastMessage('知识编辑成功,AI 已学习', 'success')
|
|
|
showAddModal.value = false
|
|
|
}
|
|
|
})
|