perf: 新邮件: 前缀[称呼+订单号]

dev/ckeditor
Lei OT 2 weeks ago
parent ca5dcc0705
commit 701a6a00c0

@ -69,7 +69,7 @@ const generateQuoteContent = (mailData, isRichText = true) => {
return isRichText ? html : parseHTMLText(html) return isRichText ? html : parseHTMLText(html)
} }
const generateMailContent = (mailData) => `<br><p>${mailData.content}</p><br>` const generateMailContent = (mailData) => `<p>${mailData.content}</p><br>`
/** /**
* 独立窗口编辑器 * 独立窗口编辑器
@ -105,7 +105,7 @@ const NewEmail = () => {
// const [emailOrderSN, setEmailOrderSN] = useState('') // const [emailOrderSN, setEmailOrderSN] = useState('')
// const [emailMat, setEmailMat] = useState('') // const [emailMat, setEmailMat] = useState('')
const [contentPrefix, setContentPrefix] = useState('') // const [contentPrefix, setContentPrefix] = useState('')
const [localDraft, setLocalDraft] = useState(); const [localDraft, setLocalDraft] = useState();
// const readMailboxLocalCache = async () => { // const readMailboxLocalCache = async () => {
@ -168,7 +168,8 @@ const NewEmail = () => {
document.title = docTitle document.title = docTitle
const { order_no } = orderDetail const { order_no } = orderDetail
setContentPrefix(order_no ? `<p>Dear Mr./Ms. ${orderDetail.contact?.[0]?.name || ''}</p><p>Reference Number: ${order_no}</p>` : '') // setContentPrefix(order_no ? `<p>Dear Mr./Ms. ${orderDetail.contact?.[0]?.name || ''}</p><p>Reference Number: ${order_no}</p>` : '')
const orderPrefix = order_no ? `<p>Dear Mr./Ms. ${orderDetail.contact?.[0]?.name || ''}</p><p>Reference Number: ${order_no}</p>` : ''
const { info } = mailData const { info } = mailData
const { ...templateFormValues } = templateContent; const { ...templateFormValues } = templateContent;
@ -202,8 +203,8 @@ const NewEmail = () => {
// const _initialContent = isEmpty(mailData.info) ? signatureBody : signatureBody+preQuoteBody // const _initialContent = isEmpty(mailData.info) ? signatureBody : signatureBody+preQuoteBody
if (!isEmpty(mailData.info) && !['edit', 'new'].includes(pageParam.action)) { if (!isEmpty(mailData.info) && !['edit'].includes(pageParam.action)) {
readyToInitialContent = contentPrefix + signatureBody readyToInitialContent = orderPrefix + signatureBody
} }
switch (pageParam.action) { switch (pageParam.action) {
case 'reply': case 'reply':
@ -239,7 +240,7 @@ const NewEmail = () => {
from: quotedMailSenderObj, from: quotedMailSenderObj,
to: info?.MAI_To || '', to: info?.MAI_To || '',
cc: info?.MAI_CS || '', cc: info?.MAI_CS || '',
subject: `Fw: ${info.MAI_Subject || ''}`, subject: `${info.MAI_Subject || ''}`,
id: pageParam.quoteid, id: pageParam.quoteid,
mai_sn: pageParam.quoteid, mai_sn: pageParam.quoteid,
..._form2 ..._form2
@ -255,7 +256,7 @@ const NewEmail = () => {
subject: `${info.MAI_Subject || templateFormValues.subject || ''}`, subject: `${info.MAI_Subject || templateFormValues.subject || ''}`,
..._form2, ..._form2,
} }
readyToInitialContent = generateMailContent({ content: templateContent.bodycontent || '' }) readyToInitialContent = generateMailContent({ content: templateContent.bodycontent || readyToInitialContent || '' })
setFileList(mailData.attachments.map(ele => ({ uid: ele.ATI_SN, name: ele.ATI_Name, url: ele.ATI_ServerFile, fullPath: `${EMAIL_ATTA_HOST}${ele.ATI_ServerFile}` }))) setFileList(mailData.attachments.map(ele => ({ uid: ele.ATI_SN, name: ele.ATI_Name, url: ele.ATI_ServerFile, fullPath: `${EMAIL_ATTA_HOST}${ele.ATI_ServerFile}` })))
break break
@ -267,7 +268,7 @@ const NewEmail = () => {
setInitialContent(readyToInitialContent); setInitialContent(readyToInitialContent);
return () => {} return () => {}
}, [orderDetail.order_no, quoteLoading, loadingTamplate]) }, [orderDetail.order_no, quoteLoading, loadingTamplate, signature])
// const readFromTemplate = () => { // const readFromTemplate = () => {

Loading…
Cancel
Save