From 22674fe4987604248b0dd9c50751876f4febc12a Mon Sep 17 00:00:00 2001 From: Lei OT Date: Fri, 27 Jun 2025 14:30:26 +0800 Subject: [PATCH] . --- .../Online/Components/EmailDetailInline.jsx | 70 +++++++++---------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/src/views/Conversations/Online/Components/EmailDetailInline.jsx b/src/views/Conversations/Online/Components/EmailDetailInline.jsx index 33c2290..dca4ab8 100644 --- a/src/views/Conversations/Online/Components/EmailDetailInline.jsx +++ b/src/views/Conversations/Online/Components/EmailDetailInline.jsx @@ -29,6 +29,13 @@ const extTypeMapped = { default: { icon: FileOutlined }, // rtf bmp } +const FileTypeIcon = ({fileName}) => { + const ext = fileName.split('.').pop() || 'default'; + const Com = extTypeMapped[ext]?.icon || FileOutlined; + const color = extTypeMapped[ext]?.color || 'inherit'; + return ; +}; + /** * @property {*} emailMsg - 邮件数据. { conversationid, actionId, order_opi, coli_sn, msgOrigin: { from, to, id, email: { subject, mai_sn, } } } */ @@ -125,12 +132,6 @@ const EmailDetailInline = ({ mailID, emailMsg = {}, disabled = false, variant, s }) } } - const FileTypeIcon = ({fileName}) => { - const ext = fileName.split('.').pop() || 'default'; - const Com = extTypeMapped[ext]?.icon || FileOutlined; - const color = extTypeMapped[ext]?.color || 'inherit'; - return ; - }; /** * 根据状态, 显示操作 @@ -139,7 +140,7 @@ const EmailDetailInline = ({ mailID, emailMsg = {}, disabled = false, variant, s * * 失败: 重发 * todo: disabled 不显示 */ - const ActionBtns = ({ className, ...props }) => { + const renderActionBtns = ({ className, ...props }) => { const { status } = mailData.info let btns = [] @@ -211,6 +212,26 @@ const EmailDetailInline = ({ mailID, emailMsg = {}, disabled = false, variant, s return
{btns}
} + const renderAttaList = ({ list }) => { + return ( + ( + + + + openPopup(`${EMAIL_ATTA_HOST}${atta.ATI_ServerFile}`, atta.ATI_SN)} size='small' className='text-blue-500 cursor-pointer'> + {atta.ATI_Name} + + + + )} + /> + ) + }; + const variantCls = (variant) => { switch (variant) { case 'outline': @@ -231,7 +252,8 @@ const EmailDetailInline = ({ mailID, emailMsg = {}, disabled = false, variant, s {loading ? : null} {mailData.info?.MAI_Subject || emailMsg?.msgOrigin?.subject} - + {/* */} + {renderActionBtns({ className: 'ml-auto'})}
@@ -284,42 +306,14 @@ const EmailDetailInline = ({ mailID, emailMsg = {}, disabled = false, variant, s {mailData.attachments.length > 0 && ( <>  附件 ({mailData.attachments.length}) - ( - - - - openPopup(`${EMAIL_ATTA_HOST}${atta.ATI_ServerFile}`, atta.ATI_SN)} size='small' className='text-blue-500 cursor-pointer'> - {atta.ATI_Name} - - - - )} - /> + {renderAttaList({ list: mailData.attachments || []})} )} {mailData.insideAttachments.length > 0 &&
 文内附件 ({mailData.insideAttachments.length}) 已在正文显示 点击展开 - ( - - - - openPopup(`${EMAIL_ATTA_HOST}${atta.ATI_ServerFile}`, atta.ATI_SN)} size='small' className='text-blue-500 cursor-pointer'> - {atta.ATI_Name} - - - - )} - /> + {renderAttaList({ list: mailData.insideAttachments || []})}
}
)}