From 3c6023bdb5e7439dc2a46ecd3e0ce090b23e2631 Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Tue, 21 Apr 2026 17:12:58 +0800 Subject: [PATCH] 1.图片也用iframe方式 --- src/components/Common/CommonTable/index.js | 2 +- src/components/Common/OfficePreview/index.js | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/Common/CommonTable/index.js b/src/components/Common/CommonTable/index.js index 70a27a5..e73c7cd 100644 --- a/src/components/Common/CommonTable/index.js +++ b/src/components/Common/CommonTable/index.js @@ -1296,7 +1296,7 @@ class CommonTableRc extends React.Component { let imgBox = ; - if (officeFileTypeList.includes(officeFileType)) { + if (officeFileTypeList.includes(officeFileType) || imgTypeList.includes(officeFileType)) { imgBox = fileIcon; } else if (imgTypeList.includes(officeFileType)) { imgBox = img 0} onClick={e => this.handlePreviewImage(e, picAddr, index)} style={{ width: '30px', height: '20px' }} />; diff --git a/src/components/Common/OfficePreview/index.js b/src/components/Common/OfficePreview/index.js index 42b3e7b..26ebce4 100644 --- a/src/components/Common/OfficePreview/index.js +++ b/src/components/Common/OfficePreview/index.js @@ -10,6 +10,7 @@ import "@js-preview/excel/lib/index.css"; const OfficePreview = props => { const { officePreviewVisible, officeFileUrl, onCancel, app } = props; + const imgTypeList = ['PNG', 'SVG', 'JPG', 'JPEG', 'GIF', 'BMP', 'TIFF', 'ICO']; /* 常见图片格式列表 */ const title = officeFileUrl .split("/") .pop() @@ -45,6 +46,30 @@ const OfficePreview = props => { )} + {imgTypeList.includes(fileType)&& ( +
+ 图片预览 +
+ )} {['MP4', 'WEBM', 'OGG'].includes(fileType) && (