diff --git a/ui/src/components/ai-chat/KnowledgeSource.vue b/ui/src/components/ai-chat/KnowledgeSource.vue
index 4de9ce1c..1c5369a3 100644
--- a/ui/src/components/ai-chat/KnowledgeSource.vue
+++ b/ui/src/components/ai-chat/KnowledgeSource.vue
@@ -8,30 +8,31 @@
>
-
-
-
+
+
+
+
+
+
+
![]()
+
+
{{ item && item?.document_name }}
+
+
+
+
+
+
+
+
@@ -59,7 +60,7 @@ import { computed, ref } from 'vue'
import ParagraphSourceDialog from './ParagraphSourceDialog.vue'
import ExecutionDetailDialog from './ExecutionDetailDialog.vue'
import { isWorkFlow } from '@/utils/application'
-
+import { getImgUrl } from '@/utils/utils'
const props = defineProps({
data: {
type: Object,
@@ -70,15 +71,6 @@ const props = defineProps({
default: ''
}
})
-const iconMap: { [key: string]: string } = {
- doc: '../../assets/doc-icon.svg',
- docx: '../../assets/docx-icon.svg',
- pdf: '../../assets/pdf-icon.svg',
- md: '../../assets/md-icon.svg',
- txt: '../../assets/txt-icon.svg',
- xls: '../../assets/xls-icon.svg',
- xlsx: '../../assets/xlsx-icon.svg'
-}
const ParagraphSourceDialogRef = ref()
const ExecutionDetailDialogRef = ref()
@@ -106,15 +98,16 @@ const uniqueParagraphList = computed(() => {
}) || []
)
})
-
-function getIconPath(documentName: string) {
- const extension = documentName.split('.').pop()?.toLowerCase()
- if (!documentName || !extension) return new URL(`${iconMap['doc']}`, import.meta.url).href
- if (iconMap && extension && iconMap[extension]) {
- return new URL(`${iconMap[extension]}`, import.meta.url).href
- }
- return new URL(`${iconMap['doc']}`, import.meta.url).href
+function fileType(name: string) {
+ const suffix = name.split('.')
+ return suffix[suffix.length - 1]
}
+const typeList: any = {
+ txt: ['txt', 'pdf', 'docx', 'csv', 'md', 'html'],
+ table: ['xlsx', 'xls', 'csv'],
+ QA: ['xlsx', 'csv', 'xls']
+}
+
function openLink(url: string) {
// 如果url不是以/结尾,加上/
if (url && !url.endsWith('/')) {
diff --git a/ui/src/components/ai-chat/component/ParagraphCard.vue b/ui/src/components/ai-chat/component/ParagraphCard.vue
index 1a566c14..4fb785e6 100644
--- a/ui/src/components/ai-chat/component/ParagraphCard.vue
+++ b/ui/src/components/ai-chat/component/ParagraphCard.vue
@@ -18,45 +18,8 @@