Merge branch 'wyfMain-dev' into dev

This commit is contained in:
wangyifeng 2025-07-07 09:33:37 +08:00
commit 2ede30426a
2 changed files with 31 additions and 12 deletions

View File

@ -668,15 +668,23 @@ const queryAllSearch = () => {
// //
const fileTypeAvatar = (fileType) => { 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 let file_type_avatar = fileType_Files
if (fileType) { if (fileType) {
if (fileType === 'ppt' || fileType === 'pptx') { if (PPT_EXTENSIONS.includes(fileType)) {
file_type_avatar = fileType_PPT file_type_avatar = fileType_PPT
} else if (fileType === 'pdf') { } else if (PDF_EXTENSIONS.includes(fileType)) {
file_type_avatar = fileType_PDF file_type_avatar = fileType_PDF
} else if (fileType === 'doc' || fileType === 'docx') { } else if (WORD_EXTENSIONS.includes(fileType)) {
file_type_avatar = fileType_WORD file_type_avatar = fileType_WORD
} else if (fileType === 'xls' || fileType === 'xlsx') { } else if (EXCEL_EXTENSIONS.includes(fileType)) {
file_type_avatar = fileType_EXCEL file_type_avatar = fileType_EXCEL
} else { } else {
file_type_avatar = fileType_Files file_type_avatar = fileType_Files
@ -694,7 +702,7 @@ const previewPDF = (item) => {
// downloadAndOpenFile(item) // downloadAndOpenFile(item)
// }) // })
// } // }
if(checkFileCanPreview(item?.extra?.path || '')){ if (checkFileCanPreview(item?.extra?.path || '')) {
window.open( window.open(
`${import.meta.env.VITE_PAGE_URL}/office?url=${item.extra.path}`, `${import.meta.env.VITE_PAGE_URL}/office?url=${item.extra.path}`,
'_blank', '_blank',
@ -958,7 +966,7 @@ body:deep(.round-3) {
border-bottom: 1px solid #f8f8f8; border-bottom: 1px solid #f8f8f8;
&:hover { &:hover {
background-color: rgba(70, 41, 157, 0.1) background-color: rgba(70, 41, 157, 0.1);
} }
.attachment-avatar { .attachment-avatar {

View File

@ -69,9 +69,17 @@
class="text-[12px] font-regular" class="text-[12px] font-regular"
:text="resultDetail" :text="resultDetail"
:searchText="props.searchText" :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
"
/> />
<div class="message-component-wrapper" v-if="props.searchItem?.msg_type === 3 || props.searchItem?.msg_type === 5" @click.stop> <div
class="message-component-wrapper"
v-if="props.searchItem?.msg_type === 3 || props.searchItem?.msg_type === 5"
@click.stop
>
<component <component
:is="MessageComponents[props.searchItem?.msg_type] || 'unknown-message'" :is="MessageComponents[props.searchItem?.msg_type] || 'unknown-message'"
:extra="resultDetail" :extra="resultDetail"
@ -292,7 +300,9 @@ const resultDetail = computed(() => {
result_detail = result_detail =
props.searchItem?.msg_type === 1 props.searchItem?.msg_type === 1
? props.searchItem?.extra?.content ? 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 ? props.searchItem?.extra
: ChatMsgTypeMapping[props.searchItem?.msg_type] : ChatMsgTypeMapping[props.searchItem?.msg_type]
break break
@ -311,7 +321,7 @@ const previewPDF = (item) => {
// downloadAndOpenFile(item) // downloadAndOpenFile(item)
// }) // })
// } // }
if(checkFileCanPreview(item || '')){ if (checkFileCanPreview(item || '')) {
window.open( window.open(
`${import.meta.env.VITE_PAGE_URL}/office?url=${item}`, `${import.meta.env.VITE_PAGE_URL}/office?url=${item}`,
'_blank', '_blank',
@ -319,6 +329,7 @@ const previewPDF = (item) => {
) )
} else { } else {
// //
window['$message'].warning('暂不支持在线预览该类型文件')
} }
} }
</script> </script>