修改一些已知BUG

优化站内发件无需第三方

修改一些已知BUG
This commit is contained in:
eoao
2026-02-07 22:41:01 +08:00
parent ccd6cb22bd
commit 6f218b5379
10 changed files with 70 additions and 20 deletions

View File

@@ -152,7 +152,7 @@
>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item v-if="props.type === 'email'" @click="emailRead()" >
<el-dropdown-item v-if="['email'].includes(props.type)" @click="emailRead(rightClickEmail.emailId)" >
<template #default>
<div class="right-dropdown-item">
<Icon icon="fluent:mail-read-20-regular" width="20" height="20" />
@@ -160,7 +160,7 @@
</div>
</template>
</el-dropdown-item>
<el-dropdown-item v-if="props.type === 'email'" @click="openReply(rightClickEmail)">
<el-dropdown-item v-if="['email','star'].includes(props.type)" @click="openReply(rightClickEmail)">
<template #default>
<div class="right-dropdown-item">
<Icon icon="la:reply" width="20" height="20" />
@@ -168,6 +168,14 @@
</div>
</template>
</el-dropdown-item>
<el-dropdown-item v-if="['email','send', 'star'].includes(props.type)" @click="openForward(rightClickEmail)">
<template #default>
<div class="right-dropdown-item">
<Icon icon="iconoir:arrow-up-right" width="19" height="19" />
<span>{{t('forward')}}</span>
</div>
</template>
</el-dropdown-item>
<el-dropdown-item v-if="['email','send', 'star'].includes(props.type)" @click="starChange(rightClickEmail)">
<template #default>
<div class="right-dropdown-item">
@@ -471,6 +479,10 @@ function openReply(email) {
uiStore.writerRef.openReply(email)
}
function openForward(email) {
uiStore.writerRef.openForward(email)
}
function visibleChange(e) {
dropdownShow.value = e;
dropdownCloseLock.value = true;
@@ -593,6 +605,15 @@ function changeAccountShow() {
const handleRead = () => {
const emailIds = getSelectedMailsIds();
props.emailRead(emailIds);
localRead(emailIds);
}
function emailRead(emailId) {
props.emailRead([emailId])
localRead([emailId]);
}
function localRead(emailIds) {
emailIds.forEach(emailId => {
const index = emailList.findIndex(email => email.emailId === emailId);
if (index > -1) {
@@ -602,11 +623,6 @@ const handleRead = () => {
})
}
function emailRead() {
const emailIds = getSelectedMailsIds();
props.emailRead(emailIds)
}
function rightDelete(emailId) {
if (props.type === 'all-email') {

View File

@@ -73,7 +73,7 @@ const en = {
unauthorized: 'Unauthorized',
unlimited: 'Unlimited',
sendCount: 'Send email : ',
accountCount: 'Add Address : ',
accountCount: 'Add address : ',
action: 'Action',
chgPwd: 'Password',
perm: 'Role',
@@ -248,6 +248,7 @@ const en = {
language: 'Language',
totalUserAccount: '{msg}',
sendBanned: 'Banned',
sendInternal: 'Only internal',
wrote: 'wrote',
support: 'Support',
supportDesc: 'Buy me tea',

View File

@@ -248,6 +248,7 @@ const zh = {
language: '网站语言',
totalUserAccount: '{msg} 个',
sendBanned: '已禁用',
sendInternal: '仅站内',
wrote: '来信',
support: '捐助',
supportDesc: '请我喝杯奶茶',

View File

@@ -113,6 +113,10 @@ const sendType = computed(() => {
return t('sendBanned')
}
if (userStore.user.role.sendType === 'internal') {
return t('sendInternal')
}
if (!userStore.user.role.sendCount) {
return t('unlimited')
}
@@ -137,6 +141,10 @@ const sendCount = computed(() => {
return null
}
if (userStore.user.role.sendType === 'internal') {
return null
}
if (!userStore.user.role.sendCount) {
return null
}

View File

@@ -32,6 +32,7 @@
:key="item"
:label="item"
:value="item"
style="color: #999896;"
/>
</el-select>
</template>
@@ -111,6 +112,7 @@ import db from "@/db/db.js";
import dayjs from "dayjs";
import {useI18n} from "vue-i18n";
import router from "@/router/index.js";
import {ElMessageBox} from "element-plus";
defineExpose({
open,
@@ -119,7 +121,7 @@ defineExpose({
openDraft
})
const {t, locale} = useI18n()
const {t} = useI18n()
const writerStore = useWriterStore();
const draftStore = userDraftStore()
const settingStore = useSettingStore()
@@ -305,6 +307,10 @@ async function sendEmail() {
return
}
if (!form.content) {
form.content = editor.value.getContent();
}
if (!form.content) {
ElMessage({
message: t('emptyContentMsg'),
@@ -433,15 +439,12 @@ function openForward(email) {
form.subject = email.subject
form.sendType = 'forward'
form.emailId = email.emailId
defValue.value = ''
setTimeout(() => {
defValue.value = `
<articl class="mceNonEditable" >
${formatImage(email.content) || `<pre style="font-family: inherit;word-break: break-word;white-space: pre-wrap;margin: 0">${email.text}</pre>`}
</article>
`
open()
@@ -466,7 +469,7 @@ function openReply(email) {
email.subject.startsWith('Re:') ||
email.subject.startsWith('Re') ||
email.subject.startsWith('回复:') ||
email.subject.startsWith('回复:')) ? email.subject : 'Re:' + email.subject
email.subject.startsWith('回复:')) ? email.subject : 'Re: ' + email.subject
form.sendType = 'reply'
form.emailId = email.emailId
@@ -542,6 +545,10 @@ function close() {
if (selectStatus) openSelect();
if (!form.content) {
form.content = editor.value.getContent();
}
if (form.draftId) {
draftStore.setDraft = {...toRaw(form)}
show.value = false
@@ -559,6 +566,9 @@ function close() {
let subjectFlag = form.subject === backReply.subject
let contentFlag = editor.value.getContent() === backReply.content
let receiveFlag = form.receiveEmail.length === 1 && form.receiveEmail[0] === backReply.receiveEmail[0]
if (backReply.sendType === 'forward' && form.receiveEmail.length === 0) {
receiveFlag = true;
}
if (subjectFlag && contentFlag && receiveFlag) {
resetForm();
close()
@@ -572,7 +582,7 @@ function close() {
type: 'warning',
distinguishCancelAndClose: true
}).then(async () => {
const formData = {...toRaw(form)}
const formData = {...toRaw(form)};
delete formData.draftId
delete formData.attachments
formData.createTime = dayjs().utc().format('YYYY-MM-DD HH:mm:ss');
@@ -580,7 +590,9 @@ function close() {
db.value.att.add({draftId, attachments: toRaw(form.attachments)})
draftStore.refreshList++
show.value = false
await nextTick(() => {
resetForm()
})
}).catch((action) => {
if (action === 'cancel') {
show.value = false
@@ -591,7 +603,18 @@ function close() {
}
</script>
<style>
.el-select-dropdown__list {
padding: 4px 4px !important;
}
.el-select-dropdown__item {
padding: 0 10px 0 10px;
}
.el-select-dropdown {
min-width: 0 !important;
}
</style>
<style scoped lang="scss">
.send {
position: fixed;

View File

@@ -8,7 +8,7 @@
<Icon class="icon" @click="changeStar" v-else icon="solar:star-line-duotone" width="18" height="18"/>
</span>
<Icon class="icon" v-if="emailStore.contentData.showReply" v-perm="'email:send'" @click="openReply" icon="la:reply" width="21" height="21" />
<Icon class="icon" v-if="emailStore.contentData.showReply" v-perm="'email:send'" @click="openForward" icon="tabler:location-share" width="19" height="19" />
<Icon class="icon" v-if="emailStore.contentData.showReply" v-perm="'email:send'" @click="openForward" icon="iconoir:arrow-up-right" width="20" height="20" />
</div>
<div></div>
<el-scrollbar class="scrollbar">

View File

@@ -116,7 +116,7 @@
<div>
<span>{{ node.label }}</span>
<span class="send-num" v-if="data.permKey === 'email:send'" @click.stop>
<el-input-number v-model="form.sendCount" controls-position="right" :min="0" :max="99999" size="small"
<el-input-number v-if="form.sendType === 'day' || form.sendType === 'count'" v-model="form.sendCount" controls-position="right" :min="0" :max="99999" size="small"
:placeholder="$t('total')">
</el-input-number>
<el-select v-model="form.sendType" placeholder="Select" size="small"

View File

@@ -754,7 +754,7 @@ defineOptions({
name: 'sys-setting'
})
const currentVersion = 'v2.8.0'
const currentVersion = 'v2.9.0'
const hasUpdate = ref(false)
let getUpdateErrorCount = 1;
const {t, locale} = useI18n();

View File

@@ -761,6 +761,7 @@ function formatSendType(user) {
if (user.sendAction.sendType === 'day') return t('daily')
if (user.sendAction.sendType === 'count') return t('total')
if (user.sendAction.sendType === 'ban') return t('sendBanned')
if (user.sendAction.sendType === 'internal') return t('sendInternal')
}
function formatSendCount(user) {

View File

@@ -322,7 +322,7 @@ const emailService = {
}
//如果权限有发送次数增加用户发送次数
if (roleRow.sendCount) {
if (roleRow.sendCount && roleRow.sendType !== 'internal') {
await userService.incrUserSendCount(c, receiveEmail.length, userId);
}
@@ -473,7 +473,7 @@ const emailService = {
status = emailConst.status.BOUNCED;
}
await orm(c).update(email).set({ status: emailConst.status.DELIVERED, message: message }).where(eq(email.emailId, sendEmailData.emailId)).run();
await orm(c).update(email).set({ status, message: message }).where(eq(email.emailId, sendEmailData.emailId)).run();
},