新增自动刷新邮件弹窗通知

This commit is contained in:
eoao
2025-11-18 22:44:00 +08:00
parent 0a6dbec531
commit aa5d3647c1
2 changed files with 34 additions and 3 deletions
+12
View File
@@ -682,4 +682,16 @@ addCollection({
}
}
})
addCollection({
"prefix": "fluent",
"lastModified": 1761371481,
"aliases": {},
"width": 20,
"height": 20,
"icons": {
"mail-read-20-regular": {
"body": "<path fill=\"currentColor\" d=\"M9.743 2.071a.5.5 0 0 1 .514 0l6.772 4.063A2 2 0 0 1 18 7.85v6.65a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 2 14.5V7.85a2 2 0 0 1 .971-1.716zM10 3.083L3.486 6.992L3.472 7L10 10.917L16.528 7l-.013-.008zm7 4.8l-6.743 4.046a.5.5 0 0 1-.514 0L3 7.883V14.5A1.5 1.5 0 0 0 4.5 16h11a1.5 1.5 0 0 0 1.5-1.5z\"/>"
}
}
})
+22 -3
View File
@@ -29,7 +29,7 @@ import {useSettingStore} from "@/store/setting.js";
import emailScroll from "@/components/email-scroll/index.vue"
import {emailList, emailDelete, emailLatest, emailRead} from "@/request/email.js";
import {starAdd, starCancel} from "@/request/star.js";
import {defineOptions, onMounted, reactive, ref, watch} from "vue";
import {defineOptions, h, onMounted, reactive, ref, watch} from "vue";
import {sleep} from "@/utils/time-utils.js";
import router from "@/router/index.js";
import {Icon} from "@iconify/vue";
@@ -85,8 +85,27 @@ async function latest() {
if (list.length > 0) {
list.forEach(email => {
existIds.add(email.emailId)
scroll.value.addItem(email)
setTimeout(() => {
if (!existIds.has(email.emailId) && innerWidth > 1367) {
ElNotification({
type: 'primary',
message: `<div style="cursor: pointer;"><div style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-weight: bold;font-size: 16px;margin-bottom: 5px;">${email.name}</div><div style="color: teal;">${email.subject}</div></div>`,
position: 'bottom-right',
dangerouslyUseHTMLString: true,
onClick: () => {
jumpContent(email);
}
})
}
existIds.add(email.emailId)
scroll.value.addItem(email)
},50)
})
}