修复gmail附件和回复编辑器图片不显示

This commit is contained in:
eoao
2025-07-10 09:00:14 +08:00
parent f2c12216c8
commit 7e5a383bc6
10 changed files with 102 additions and 70 deletions

View File

@@ -55,7 +55,7 @@
effect="dark"
content="已发送"
>
<Icon icon="bi:send-arrow-up" style="color: #67C23A" width="20" height="20"
<Icon icon="bi:send-arrow-up-fill" style="color: #67C23A" width="20" height="20"
/>
</el-tooltip>
@@ -87,7 +87,7 @@
effect="dark"
content="发送延迟"
>
<Icon icon="quill:send-later" style="color:#FBBD08" width="20"
<Icon icon="bi:send-arrow-up-fill" style="color:#FBBD08" width="20"
height="20"/>
</el-tooltip>

View File

@@ -77,7 +77,6 @@ function initEditor() {
toolbar_mode: 'scrolling',
mobile: {
toolbar: 'fullscreen bold emoticons forecolor backcolor italic fontsize | alignleft aligncenter alignright alignjustify | outdent indent | bullist numlist | link image | table code preview ',
},
font_size_formats: '8px 10px 12px 14px 16px 18px 24px 36px',
emoticons_search: false,
@@ -85,8 +84,9 @@ function initEditor() {
language_url: '/tinymce/langs/zh_CN.js',
menubar: false,
license_key: 'gpl',
noneditable_class: 'mceNonEditable',
content_style: ` .tox-dialog__body-content { margin: 0 !important; }
img { max-width: 100%; height: auto; }
img { max-width: 100% !important; height: auto !important; }
body {margin: 10px 8px 0 5px !important; font-family: 'HarmonyOS'; font-size: 14px;}
@media (pointer: fine) and (hover: hover) {
::-webkit-scrollbar {
@@ -110,9 +110,6 @@ function initEditor() {
.mce-item-table:not([border]), .mce-item-table:not([border]) caption, .mce-item-table:not([border]) td, .mce-item-table:not([border]) th, .mce-item-table[border="0"], .mce-item-table[border="0"] caption, .mce-item-table[border="0"] td, .mce-item-table[border="0"] th, table[style*="border-width: 0px"], table[style*="border-width: 0px"] caption, table[style*="border-width: 0px"] td, table[style*="border-width: 0px"] th {
border: none;
}
a {
color: #409EFF !important;
}
`,
setup: (ed) => {
editor.value = ed;

View File

@@ -67,12 +67,14 @@ import {fileToBase64, formatBytes} from "@/utils/file-utils.js";
import {getIconByName} from "@/utils/icon-utils.js";
import sendPercent from "@/components/send-percent/index.vue"
import {formatDetailDate} from "@/utils/day.js";
import {useSettingStore} from "@/store/setting.js";
defineExpose({
open,
openReply
})
const settingStore = useSettingStore()
const emailStore = useEmailStore();
const accountStore = useAccountStore()
const editor = ref({})
@@ -283,11 +285,22 @@ function openReply(email) {
<br>
${ formatDetailDate(email.createTime) }${email.name} &lt${email.sendEmail}&gt 来信:
</div>
<blockquote style="margin: 0 0 0 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;">${email.content}</blockquote>`
<blockquote class="mceNonEditable" style="margin: 0 0 0 0.8ex;border-left: 1px solid rgb(204,204,204);padding-left: 1ex;">
<articl>
${formatImage(email.content) || `<pre style="font-family: inherit;word-break: break-word;white-space: pre-wrap;margin: 0">${email.text}</pre>`}
</article>
</blockquote>`
open()
console.log(defValue.value)
})
}
function formatImage(content) {
content = content || '';
const domain = settingStore.settings.r2Domain;
console.log(content)
return content.replace(/{{domain}}/g, domain + '/');
}
function open() {

View File

@@ -35,7 +35,7 @@
</div>
<el-scrollbar class="htm-scrollbar" :class="email.attList.length === 0 ? 'bottom-distance' : ''">
<ShadowHtml :html="formatImage(email.content)" v-if="email.content" />
<span v-else class="email-text" >{{email.text}}</span>
<pre v-else class="email-text" >{{email.text}}</pre>
</el-scrollbar>
<div class="att" v-if="email.attList.length > 0">
<div class="att-title">
@@ -380,8 +380,10 @@ const handleDelete = () => {
}
.email-text {
font-family: inherit;
white-space: pre-wrap;
word-break: break-word;
margin: 0;
}
.bottom-distance {