|
|
@ -57,7 +57,7 @@ const parseHTMLText = (html) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const generateQuoteContent = (mailData, isRichText = true) => {
|
|
|
|
const generateQuoteContent = (mailData, isRichText = true) => {
|
|
|
|
const html = `<br><br><hr><p class="font-sans"><b><strong >From: </strong></b><span >${(mailData.info?.MAI_From || '')
|
|
|
|
const html = `<br><hr><blockquote><p class="font-sans"><b><strong >From: </strong></b><span >${(mailData.info?.MAI_From || '')
|
|
|
|
.replace(/</g, '<')
|
|
|
|
.replace(/</g, '<')
|
|
|
|
.replace(/>/g, '>')} </span></p><p class="font-sans"><b><strong >Sent: </strong></b><span >${
|
|
|
|
.replace(/>/g, '>')} </span></p><p class="font-sans"><b><strong >Sent: </strong></b><span >${
|
|
|
|
mailData.info?.MAI_SendDate || ''
|
|
|
|
mailData.info?.MAI_SendDate || ''
|
|
|
@ -65,7 +65,7 @@ const generateQuoteContent = (mailData, isRichText = true) => {
|
|
|
|
.replace(/</g, '<')
|
|
|
|
.replace(/</g, '<')
|
|
|
|
.replace(/>/g, '>')}</span></p><p class="font-sans"><b><strong >Subject: </strong></b><span >${mailData.info?.MAI_Subject || ''}</span></p><p>${
|
|
|
|
.replace(/>/g, '>')}</span></p><p class="font-sans"><b><strong >Subject: </strong></b><span >${mailData.info?.MAI_Subject || ''}</span></p><p>${
|
|
|
|
mailData.info?.MAI_ContentType === 'text/html' ? mailData.content : mailData.content.replace(/\r\n/g, '<br>')
|
|
|
|
mailData.info?.MAI_ContentType === 'text/html' ? mailData.content : mailData.content.replace(/\r\n/g, '<br>')
|
|
|
|
}</p>`
|
|
|
|
}</p></blockquote>`
|
|
|
|
return isRichText ? html : parseHTMLText(html)
|
|
|
|
return isRichText ? html : parseHTMLText(html)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -213,7 +213,7 @@ const NewEmail = () => {
|
|
|
|
|
|
|
|
|
|
|
|
// 排除草稿: `编辑`有id 的邮件
|
|
|
|
// 排除草稿: `编辑`有id 的邮件
|
|
|
|
if (!isEmpty(mailData.info) && !['edit'].includes(pageParam.action)) {
|
|
|
|
if (!isEmpty(mailData.info) && !['edit'].includes(pageParam.action)) {
|
|
|
|
readyToInitialContent = orderPrefix + signatureBody
|
|
|
|
readyToInitialContent = orderPrefix + '<br>' + signatureBody
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (pageParam.action) {
|
|
|
|
switch (pageParam.action) {
|
|
|
|
case 'reply':
|
|
|
|
case 'reply':
|
|
|
@ -603,7 +603,7 @@ const NewEmail = () => {
|
|
|
|
// labelCol={{ span: 3 }}
|
|
|
|
// labelCol={{ span: 3 }}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div className='w-full flex flex-wrap gap-2 justify-start items-center text-indigo-600 pb-1 mb-2 border-x-0 border-t-0 border-b border-solid border-neutral-200'>
|
|
|
|
<div className='w-full flex flex-wrap gap-2 justify-start items-center text-indigo-600 pb-1 mb-2 border-x-0 border-t-0 border-b border-solid border-neutral-200'>
|
|
|
|
<Button type='primary' size='middle' onClick={onHandleSaveOrSend} loading={sendLoading} icon={<SendOutlined />}>
|
|
|
|
<Button type='primary' size='middle' onClick={() => onHandleSaveOrSend()} loading={sendLoading} icon={<SendOutlined />}>
|
|
|
|
发送
|
|
|
|
发送
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
<Form.Item name={'from'} rules={[{ required: true, message: '请选择发件地址' }]} >
|
|
|
|
<Form.Item name={'from'} rules={[{ required: true, message: '请选择发件地址' }]} >
|
|
|
@ -705,7 +705,10 @@ const NewEmail = () => {
|
|
|
|
<LexicalEditor {...{ isRichText }} onChange={handleEditorChange} defaultValue={initialContent} />
|
|
|
|
<LexicalEditor {...{ isRichText }} onChange={handleEditorChange} defaultValue={initialContent} />
|
|
|
|
{!isEmpty(Number(pageParam.quoteid)) && pageParam.action!=='edit' && !showQuoteContent && (
|
|
|
|
{!isEmpty(Number(pageParam.quoteid)) && pageParam.action!=='edit' && !showQuoteContent && (
|
|
|
|
<div className='flex justify-start items-center ml-2'>
|
|
|
|
<div className='flex justify-start items-center ml-2'>
|
|
|
|
<Button className='flex gap-2 ' type='link' onClick={() => setShowQuoteContent(!showQuoteContent)}>
|
|
|
|
<Button className='flex gap-2 ' type='link' onClick={() => {
|
|
|
|
|
|
|
|
setShowQuoteContent(!showQuoteContent);
|
|
|
|
|
|
|
|
setInitialContent(pre => pre + generateQuoteContent(mailData))
|
|
|
|
|
|
|
|
}}>
|
|
|
|
显示引用内容 ↓ {/*(不可更改)*/}
|
|
|
|
显示引用内容 ↓ {/*(不可更改)*/}
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
{/* <Button className='flex gap-2 ' type='link' danger onClick={() => {setMergeQuote(false);setShowQuoteContent(false)}}>
|
|
|
|
{/* <Button className='flex gap-2 ' type='link' danger onClick={() => {setMergeQuote(false);setShowQuoteContent(false)}}>
|
|
|
@ -713,13 +716,13 @@ const NewEmail = () => {
|
|
|
|
</Button> */}
|
|
|
|
</Button> */}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
{showQuoteContent && (
|
|
|
|
{/* {showQuoteContent && (
|
|
|
|
<blockquote
|
|
|
|
<blockquote
|
|
|
|
// contentEditable
|
|
|
|
// contentEditable
|
|
|
|
className='border-0 outline-none cursor-text'
|
|
|
|
className='border-0 outline-none cursor-text'
|
|
|
|
onBlur={(e) => setQuoteContent(`<blockquote>${e.target.innerHTML}</blockquote>`)}
|
|
|
|
onBlur={(e) => setQuoteContent(`<blockquote>${e.target.innerHTML}</blockquote>`)}
|
|
|
|
dangerouslySetInnerHTML={{ __html: generateQuoteContent(mailData) }}></blockquote>
|
|
|
|
dangerouslySetInnerHTML={{ __html: generateQuoteContent(mailData) }}></blockquote>
|
|
|
|
)}
|
|
|
|
)} */}
|
|
|
|
</ConfigProvider>
|
|
|
|
</ConfigProvider>
|
|
|
|
</>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
)
|
|
|
|