From d276bc928fe93df3024e2633d20ac253270d938b Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 26 Nov 2024 11:41:47 +0800 Subject: [PATCH 1/6] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E7=9F=A5=E8=AF=86=E5=BA=93=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/ai-chat/KnowledgeSource.vue | 77 +++++++++---------- .../ai-chat/component/ParagraphCard.vue | 59 +------------- 2 files changed, 38 insertions(+), 98 deletions(-) diff --git a/ui/src/components/ai-chat/KnowledgeSource.vue b/ui/src/components/ai-chat/KnowledgeSource.vue index 4de9ce1cf..1c5369a3c 100644 --- a/ui/src/components/ai-chat/KnowledgeSource.vue +++ b/ui/src/components/ai-chat/KnowledgeSource.vue @@ -8,30 +8,31 @@ >
- -
- - - - - {{ paragraph?.document_name }} - - - - {{ paragraph?.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 1a566c149..4fb785e67 100644 --- a/ui/src/components/ai-chat/component/ParagraphCard.vue +++ b/ui/src/components/ai-chat/component/ParagraphCard.vue @@ -18,45 +18,8 @@ diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index cd3016008..86042a3fa 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -134,21 +134,7 @@
@@ -249,7 +235,7 @@