邮件详情样式优化和查询优化

This commit is contained in:
eoao
2025-06-29 11:57:53 +08:00
parent b92fd05836
commit 7d2ebc657d
8 changed files with 21 additions and 16 deletions
@@ -55,7 +55,7 @@ function updateContent() {
'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
font-size: 14px;
color: #13181D;
overflow-wrap: break-word;
word-break: break-word;
}
.shadow-content {
+6 -1
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 style="white-space: pre-wrap">{{email.text}}</span>
<span v-else class="email-text" >{{email.text}}</span>
</el-scrollbar>
<div class="att" v-if="email.attList.length > 0">
<div class="att-title">
@@ -375,6 +375,11 @@ const handleDelete = () => {
}
}
.email-text {
white-space: pre-wrap;
word-break: break-word;
}
.bottom-distance {
margin-bottom: 30px;
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -6,8 +6,8 @@
<title></title>
<link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml">
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<script type="module" crossorigin src="/assets/index-cUTOO-6m.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CaUbyCK1.css">
<script type="module" crossorigin src="/assets/index-DDsmLAr5.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-p2lTpkGZ.css">
</head>
<body>
<div id="loading-first">
+1 -1
View File
@@ -32,7 +32,7 @@ export async function email(message, env, ctx) {
return;
}
const account = await accountService.selectByEmailIncludeDel({ env: env }, message.to);
const account = await accountService.selectByEmailIncludeDelNoCase({ env: env }, message.to);
const reader = message.raw.getReader();
let content = '';
+5 -6
View File
@@ -1,7 +1,7 @@
import orm from '../entity/orm';
import email from '../entity/email';
import { emailConst, isDel, settingConst } from '../const/entity-const';
import { and, desc, eq, gt, inArray, lt, count, asc, like, ne } from 'drizzle-orm';
import { and, desc, eq, gt, inArray, lt, count, asc, sql, ne } from 'drizzle-orm';
import { star } from '../entity/star';
import settingService from './setting-service';
import accountService from './account-service';
@@ -13,7 +13,6 @@ import { parseHTML } from 'linkedom';
import userService from './user-service';
import roleService from './role-service';
import user from '../entity/user';
import account from '../entity/account';
import starService from './star-service';
import dayjs from 'dayjs';
import kvConst from '../const/kv-const';
@@ -509,19 +508,19 @@ const emailService = {
}
if (userEmail) {
conditions.push(like(user.email, `${userEmail}%`));
conditions.push(sql`${user.email} COLLATE NOCASE LIKE ${userEmail + '%'}`);
}
if (accountEmail) {
conditions.push(like(email.toEmail, `${accountEmail}%`));
conditions.push(sql`${email.toEmail} COLLATE NOCASE LIKE ${accountEmail + '%'}`);
}
if (name) {
conditions.push(like(email.name, `${name}%`));
conditions.push(sql`${email.name} COLLATE NOCASE LIKE ${name + '%'}`);
}
if (subject) {
conditions.push(like(email.subject, `${subject}%`));
conditions.push(sql`${email.subject} COLLATE NOCASE LIKE ${subject + '%'}`);
}
conditions.push(ne(email.status, emailConst.status.SAVING));
+3 -2
View File
@@ -107,7 +107,7 @@ const userService = {
await c.env.kv.delete(kvConst.AUTH_INFO + userId);
},
async list(c, params, userId) {
async list(c, params) {
let { num, size, email, timeSort, status } = params;
@@ -130,9 +130,10 @@ const userService = {
if (email) {
conditions.push(like(user.email, `${email}%`));
conditions.push(sql`${user.email} COLLATE NOCASE LIKE ${email + '%'}`);
}
if (params.isDel) {
conditions.push(eq(user.isDel, params.isDel));
}