From 825ca5ec3c150c262c2fbaa0ac5fb6c133e0f37e Mon Sep 17 00:00:00 2001 From: wangyifeng <812766448@qq.com> Date: Mon, 7 Jul 2025 09:32:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E8=81=8A=E5=A4=A9=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=A7=84=E5=88=99=E3=80=81=E8=B7=B3=E8=BD=AC=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/search/searchByCondition.vue | 24 ++++++++++++++------- src/components/search/searchItem.vue | 19 ++++++++++++---- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/components/search/searchByCondition.vue b/src/components/search/searchByCondition.vue index 8088731..6376bc8 100644 --- a/src/components/search/searchByCondition.vue +++ b/src/components/search/searchByCondition.vue @@ -668,15 +668,23 @@ const queryAllSearch = () => { //文件类型图标 const fileTypeAvatar = (fileType) => { + //PDF文件扩展名映射 + const PDF_EXTENSIONS = ['PDF', 'pdf'] + // Excel文件扩展名映射 + const EXCEL_EXTENSIONS = ['XLS', 'XLSX', 'CSV', 'xls', 'xlsx', 'csv'] + // Word文件扩展名映射 + const WORD_EXTENSIONS = ['DOC', 'DOCX', 'RTF', 'DOT', 'DOTX', 'doc', 'docx', 'rtf', 'dot', 'dotx'] + // PPT文件扩展名映射 + const PPT_EXTENSIONS = ['PPT', 'PPTX', 'PPS', 'PPSX', 'ppt', 'pptx', 'pps', 'ppsx'] let file_type_avatar = fileType_Files if (fileType) { - if (fileType === 'ppt' || fileType === 'pptx') { + if (PPT_EXTENSIONS.includes(fileType)) { file_type_avatar = fileType_PPT - } else if (fileType === 'pdf') { + } else if (PDF_EXTENSIONS.includes(fileType)) { file_type_avatar = fileType_PDF - } else if (fileType === 'doc' || fileType === 'docx') { + } else if (WORD_EXTENSIONS.includes(fileType)) { file_type_avatar = fileType_WORD - } else if (fileType === 'xls' || fileType === 'xlsx') { + } else if (EXCEL_EXTENSIONS.includes(fileType)) { file_type_avatar = fileType_EXCEL } else { file_type_avatar = fileType_Files @@ -694,7 +702,7 @@ const previewPDF = (item) => { // downloadAndOpenFile(item) // }) // } - if(checkFileCanPreview(item?.extra?.path || '')){ + if (checkFileCanPreview(item?.extra?.path || '')) { window.open( `${import.meta.env.VITE_PAGE_URL}/office?url=${item.extra.path}`, '_blank', @@ -956,11 +964,11 @@ body:deep(.round-3) { border-radius: 4px; cursor: pointer; border-bottom: 1px solid #f8f8f8; - + &:hover { - background-color: rgba(70, 41, 157, 0.1) + background-color: rgba(70, 41, 157, 0.1); } - + .attachment-avatar { display: flex; flex-direction: row; diff --git a/src/components/search/searchItem.vue b/src/components/search/searchItem.vue index 846ff05..e44e747 100644 --- a/src/components/search/searchItem.vue +++ b/src/components/search/searchItem.vue @@ -69,9 +69,17 @@ class="text-[12px] font-regular" :text="resultDetail" :searchText="props.searchText" - v-if="props.searchItem?.msg_type !== 3 && props.searchItem?.msg_type !== 5 && props.searchItem?.msg_type !== 6" + v-if=" + props.searchItem?.msg_type !== 3 && + props.searchItem?.msg_type !== 5 && + props.searchItem?.msg_type !== 6 + " /> -
+
{ result_detail = props.searchItem?.msg_type === 1 ? props.searchItem?.extra?.content - : props.searchItem?.msg_type === 3 || props.searchItem?.msg_type === 5 || props.searchItem?.msg_type === 6 + : props.searchItem?.msg_type === 3 || + props.searchItem?.msg_type === 5 || + props.searchItem?.msg_type === 6 ? props.searchItem?.extra : ChatMsgTypeMapping[props.searchItem?.msg_type] break @@ -311,7 +321,7 @@ const previewPDF = (item) => { // downloadAndOpenFile(item) // }) // } - if(checkFileCanPreview(item || '')){ + if (checkFileCanPreview(item || '')) { window.open( `${import.meta.env.VITE_PAGE_URL}/office?url=${item}`, '_blank', @@ -319,6 +329,7 @@ const previewPDF = (item) => { ) } else { //由于聊天记录本身有跳转到指定位置的逻辑,所以这里不需要再做跳转 + window['$message'].warning('暂不支持在线预览该类型文件') } }