perf(前端): 邮件正文

dev/RoosterEditor
Lei OT 5 months ago
parent 4a9ea4311b
commit 056d075a7c

@ -541,6 +541,7 @@ export const receivedMsgTypeMapped = {
getMsg: (result) => result, getMsg: (result) => result,
contentToRender: () => null, contentToRender: () => null,
contentToUpdate: (msgcontent) => { contentToUpdate: (msgcontent) => {
if (isEmpty(msgcontent)) return null;
let apiErrorCode, let apiErrorCode,
apiErrorMsg = ''; apiErrorMsg = '';
const waCode = msgcontent.error.message.match(/\(#(\d+)\)/); const waCode = msgcontent.error.message.match(/\(#(\d+)\)/);

@ -115,7 +115,6 @@ const EmailContent = ({ id, content: MailContent, ...props }) => {
border: 'none', border: 'none',
display: 'block', display: 'block',
}} }}
title='Dynamic Height Iframe'
sandbox='allow-scripts allow-same-origin' sandbox='allow-scripts allow-same-origin'
/> />
</div> </div>

@ -1,6 +1,6 @@
import { useState, useEffect } from 'react' import { useState, useEffect } from 'react'
import { App, Button, Divider, Avatar } from 'antd' import { App, Button, Divider, Avatar } from 'antd'
import { LoadingOutlined, ApiOutlined } from '@ant-design/icons'; import { LoadingOutlined, ApiOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons';
import { EditIcon, ReplyIcon, ResendIcon, ShareForwardIcon } from '@/components/Icons' import { EditIcon, ReplyIcon, ResendIcon, ShareForwardIcon } from '@/components/Icons'
import { isEmpty, TagColorStyle } from '@/utils/commons' import { isEmpty, TagColorStyle } from '@/utils/commons'
import EmailEditorPopup from '../Input/EmailEditorPopup' import EmailEditorPopup from '../Input/EmailEditorPopup'
@ -14,7 +14,7 @@ import EmailContent from './EmailContent';
/** /**
* @property {*} emailMsg - 邮件数据. { conversationid, actionId, order_opi, coli_sn, msgOrigin: { from, to, id, email: { subject, mai_sn, } } } * @property {*} emailMsg - 邮件数据. { conversationid, actionId, order_opi, coli_sn, msgOrigin: { from, to, id, email: { subject, mai_sn, } } }
*/ */
const EmailDetailInline = ({ mailID, open, setOpen = () => {}, emailMsg={}, disabled=false, ...props }) => { const EmailDetailInline = ({ mailID, emailMsg={}, disabled=false, ...props }) => {
// console.log('emailDetail', emailMsg); // console.log('emailDetail', emailMsg);
@ -117,7 +117,7 @@ const EmailDetailInline = ({ mailID, open, setOpen = () => {}, emailMsg={}, disa
} }
return ( return (
<div className={`flex justify-end items-center w-full ${className || ''}`}> <div className={`flex justify-end items-center gap-1 w-full ${className || ''}`}>
{btns} {btns}
</div> </div>
) )
@ -130,7 +130,7 @@ const EmailDetailInline = ({ mailID, open, setOpen = () => {}, emailMsg={}, disa
<div> <div>
<div className={['flex flex-wrap justify-end', window.innerWidth < 600 ? 'flex-col' : 'flex-row '].join(' ')}> <div className={['flex flex-wrap justify-end', window.innerWidth < 600 ? 'flex-col' : 'flex-row '].join(' ')}>
<div className=' grow shrink basis-0 flex flex-wrap gap-2 mb-2 items-center'> <div className=' flex-auto basis-0 flex flex-wrap gap-2 mb-2 items-center'>
<Avatar className='' style={TagColorStyle(mailData.info?.MAI_From, true)}> <Avatar className='' style={TagColorStyle(mailData.info?.MAI_From, true)}>
{(mailData.info?.MAI_From || '').substring(0, 1)} {(mailData.info?.MAI_From || '').substring(0, 1)}
</Avatar> </Avatar>
@ -139,7 +139,7 @@ const EmailDetailInline = ({ mailID, open, setOpen = () => {}, emailMsg={}, disa
<span className='text-neutral-500 text-wrap break-words break-all '>{mailData.info?.MAI_From}</span> <span className='text-neutral-500 text-wrap break-words break-all '>{mailData.info?.MAI_From}</span>
</div> </div>
</div> </div>
<div className=' shrink-0 flex flex-col justify-start gap-1 items-end'> <div className=' ml-auto flex flex-col justify-start gap-1 items-end'>
<ActionBtns /> <ActionBtns />
<div className='text-xs '>{mailData.info?.MAI_SendDate || emailMsg.localDate}</div> <div className='text-xs '>{mailData.info?.MAI_SendDate || emailMsg.localDate}</div>
</div> </div>

@ -1,5 +1,5 @@
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { App, Button, Popover, Tabs, List, Image, Avatar, Card, Flex, Space } from 'antd'; import { App, Button, Popover, Tabs, List, Image, Avatar, Card, Flex, Space,Typography } from 'antd';
import { FileSearchOutlined, LoadingOutlined } from '@ant-design/icons'; import { FileSearchOutlined, LoadingOutlined } from '@ant-design/icons';
import { RotateLeftOutlined, RotateRightOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons' import { RotateLeftOutlined, RotateRightOutlined, ZoomInOutlined, ZoomOutOutlined } from '@ant-design/icons'
import { InboxIcon, SendPlaneFillIcon } from '@/components/Icons'; import { InboxIcon, SendPlaneFillIcon } from '@/components/Icons';
@ -13,6 +13,7 @@ import useStyleStore from '@/stores/StyleStore';
import useAuthStore from '@/stores/AuthStore'; import useAuthStore from '@/stores/AuthStore';
import { sentMsgTypeMapped } from '@/channel/bubbleMsgUtils'; import { sentMsgTypeMapped } from '@/channel/bubbleMsgUtils';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import dayjs from 'dayjs'
const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 10; const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 10;
@ -337,28 +338,25 @@ const MessageListFilter = ({ ...props }) => {
renderItem={({ msgtext, ...item }) => ( renderItem={({ msgtext, ...item }) => (
<List.Item <List.Item
// actions={[item.localDate]} // actions={[item.localDate]}
className='cursor-pointer' className='cursor-pointer !py-1'
onClick={() => { onClick={() => {
onOpenEmail({ msgtext, ...item }); onOpenEmail({ msgtext, ...item });
setOpenPopup(false); // setOpenPopup(false);
}}> }}>
<List.Item.Meta <Flex vertical={false} wrap={false} className='w-full'>
avatar={ <div className='flex-auto ml-auto min-w-40 line-clamp-2'>
item.sender === 'me' ? <SendPlaneFillIcon className='text-primary' /> : <InboxIcon className='text-indigo-500' /> {item.sender !== 'me' ? <InboxIcon className='text-indigo-500' /> : <SendPlaneFillIcon className='text-primary' />}
// <Avatar size='small' style={CalColorStyle(item.senderName)}> {/* <Tooltip title={emailItem.MAI_Subject}> */}
// {item.senderName.substring(0, 3)} <Typography.Text>{msgtext?.email?.subject}</Typography.Text>
// </Avatar> {/* </Tooltip> */}
} </div>
title={msgtext?.email?.subject} <div className='ml-1 max-w-40'>
// description={`To: ${msgtext.to}`} <Typography.Text ellipsis={{ tooltip: msgtext.to }}>{msgtext.to.replaceAll('"', '')}</Typography.Text>
description={ </div>
<Flex justify={'space-between'} className='max-w-full overflow-hidden'> <div className='ml-1 max-w-20'>
<div className='flex-auto line-clamp-1 break-all pr-2'>{`To: ${msgtext.to}`}</div> <Typography.Text ellipsis={{ tooltip: item.localDate }}>{dayjs(item.localDate).format('MM-DD HH:mm')}</Typography.Text>
<div className=' basis-32 flex-grow-0 flex-shrink-0'>{item.localDate}</div> </div>
</Flex> </Flex>
}
/>
{msgtext?.email?.abstract}
</List.Item> </List.Item>
)} )}
/> />
@ -369,7 +367,7 @@ const MessageListFilter = ({ ...props }) => {
return ( return (
<> <>
<Popover <Popover zIndex={3}
// destroyTooltipOnHide // destroyTooltipOnHide
placement='bottom' placement='bottom'
overlayClassName={[mobile === false ? 'w-2/5' : 'w-full max-h-full', 'max-h-[70%]'].join(' ')} overlayClassName={[mobile === false ? 'w-2/5' : 'w-full max-h-full', 'max-h-[70%]'].join(' ')}

@ -16,8 +16,6 @@ import { useConversationNewItem } from "@/hooks/useConversation";
import EmailDetail from './../Components/EmailDetail'; import EmailDetail from './../Components/EmailDetail';
import { postEditConversationItemColiAction } from "@/actions/ConversationActions"; import { postEditConversationItemColiAction } from "@/actions/ConversationActions";
import useStyleStore from '@/stores/StyleStore'; import useStyleStore from '@/stores/StyleStore';
import { ExpandIcon } from "@/components/Icons";
import EmailDetailInline from "../Components/EmailDetailInline";
import SupplierEmailDrawer from "../Components/SupplierEmailDrawer"; import SupplierEmailDrawer from "../Components/SupplierEmailDrawer";
const CustomerProfile = () => { const CustomerProfile = () => {

Loading…
Cancel
Save