修复星标邮件列表不同步和图表空数据不为0

This commit is contained in:
eoao
2025-06-30 15:27:59 +08:00
parent 52e5915d93
commit 22b56781d5
10 changed files with 37 additions and 22 deletions

View File

@@ -272,6 +272,15 @@ watch(() => emailStore.cancelStarEmailId, () => {
emailList.forEach(email => { emailList.forEach(email => {
if (email.emailId === emailStore.cancelStarEmailId) { if (email.emailId === emailStore.cancelStarEmailId) {
email.isStar = 0 email.isStar = 0
console.log('取消')
}
})
})
watch(() => emailStore.addStarEmailId, () => {
emailList.forEach(email => {
if (email.emailId === emailStore.addStarEmailId) {
email.isStar = 1
} }
}) })
}) })

View File

@@ -104,7 +104,7 @@
data-callback="onTurnstileSuccess" data-callback="onTurnstileSuccess"
></div> ></div>
</el-dialog> </el-dialog>
<el-dialog v-model="setNameShow" title="修改名" > <el-dialog v-model="setNameShow" title="修改用户名" >
<div class="container"> <div class="container">
<el-input v-model="accountName" type="text" placeholder="名字" autocomplete="off"> <el-input v-model="accountName" type="text" placeholder="名字" autocomplete="off">
</el-input> </el-input>

View File

@@ -6,6 +6,7 @@ export const useEmailStore = defineStore('email', {
starScroll: null, starScroll: null,
emailScroll: null, emailScroll: null,
cancelStarEmailId: 0, cancelStarEmailId: 0,
addStarEmailId: 0,
contentData: { contentData: {
email: null, email: null,
delType: null, delType: null,

View File

@@ -140,6 +140,8 @@ function changeStar() {
email.isStar = 0; email.isStar = 0;
starCancel(email.emailId).then(() => { starCancel(email.emailId).then(() => {
email.isStar = 0; email.isStar = 0;
emailStore.cancelStarEmailId = email.emailId
setTimeout(() => emailStore.cancelStarEmailId = 0)
emailStore.starScroll?.deleteEmail([email.emailId]) emailStore.starScroll?.deleteEmail([email.emailId])
}).catch((e) => { }).catch((e) => {
console.error(e) console.error(e)
@@ -149,6 +151,8 @@ function changeStar() {
email.isStar = 1; email.isStar = 1;
starAdd(email.emailId).then(() => { starAdd(email.emailId).then(() => {
email.isStar = 1; email.isStar = 1;
emailStore.addStarEmailId = email.emailId
setTimeout(() => emailStore.addStarEmailId = 0)
emailStore.starScroll?.addItem(email) emailStore.starScroll?.addItem(email)
}).catch((e) => { }).catch((e) => {
console.error(e) console.error(e)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,8 @@
<title></title> <title></title>
<link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml"> <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 src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<script type="module" crossorigin src="/assets/index-rQqpL7nd.js"></script> <script type="module" crossorigin src="/assets/index-B6UdP6by.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CiK_6qYX.css"> <link rel="stylesheet" crossorigin href="/assets/index-cz2gG5da.css">
</head> </head>
<body> <body>
<div id="loading-first"> <div id="loading-first">

View File

@@ -2,18 +2,18 @@ const analysisDao = {
async numberCount(c) { async numberCount(c) {
const { results } = await c.env.db.prepare(` const { results } = await c.env.db.prepare(`
SELECT SELECT
e.receiveTotal, COALESCE(e.receiveTotal, 0) AS receiveTotal,
e.sendTotal, COALESCE(e.sendTotal, 0) AS sendTotal,
e.delReceiveTotal, COALESCE(e.delReceiveTotal, 0) AS delReceiveTotal,
e.delSendTotal, COALESCE(e.delSendTotal, 0) AS delSendTotal,
e.normalReceiveTotal, COALESCE(e.normalReceiveTotal, 0) AS normalReceiveTotal,
e.normalSendTotal, COALESCE(e.normalSendTotal, 0) AS normalSendTotal,
u.userTotal, COALESCE(u.userTotal, 0) AS userTotal,
u.normalUserTotal, COALESCE(u.normalUserTotal, 0) AS normalUserTotal,
u.delUserTotal, COALESCE(u.delUserTotal, 0) AS delUserTotal,
a.accountTotal, COALESCE(a.accountTotal, 0) AS accountTotal,
a.normalAccountTotal, COALESCE(a.normalAccountTotal, 0) AS normalAccountTotal,
a.delAccountTotal COALESCE(a.delAccountTotal, 0) AS delAccountTotal
FROM FROM
( (
SELECT SELECT

View File

@@ -89,7 +89,7 @@ export async function email(message, env, ctx) {
attachment.type = attachment.contentId ? attConst.type.EMBED : attConst.type.ATT; attachment.type = attachment.contentId ? attConst.type.EMBED : attConst.type.ATT;
}); });
if (attachments.length > 0) { if (attachments.length > 0 && env.r2) {
await attService.addAtt({ env }, attachments); await attService.addAtt({ env }, attachments);
} }

View File

@@ -34,6 +34,7 @@ const requirePerms = [
'/setting/physicsDeleteAll', '/setting/physicsDeleteAll',
'/setting/setBackground', '/setting/setBackground',
'/setting/set', '/setting/set',
'/setting/query',
'/user/delete', '/user/delete',
'/user/setPwd', '/user/setPwd',
'/user/setStatus', '/user/setStatus',
@@ -63,7 +64,7 @@ const premKey = {
'user:delete': ['/user/delete'], 'user:delete': ['/user/delete'],
'sys-email:query': ['/sys-email/list'], 'sys-email:query': ['/sys-email/list'],
'sys-email:delete': ['/sys-email/delete'], 'sys-email:delete': ['/sys-email/delete'],
'setting:query': [], 'setting:query': ['/setting/query'],
'setting:set': ['/setting/set', '/setting/setBackground'], 'setting:set': ['/setting/set', '/setting/setBackground'],
'setting:clean': ['/setting/physicsDeleteAll'], 'setting:clean': ['/setting/physicsDeleteAll'],
'analysis:query': ['/analysis/echarts'] 'analysis:query': ['/analysis/echarts']