Merge branch 'dev-3.9' of git.mesalab.cn:nezha/nezha-fronted into dev-3.10

This commit is contained in:
zyh
2023-11-29 15:15:58 +08:00
2 changed files with 27 additions and 5 deletions

View File

@@ -552,8 +552,11 @@ textarea {
.newAlert-notification{
width: auto;
padding: 15px 55px 15px 18px;
border-radius: 4px;
align-items: center;
background: $--background-color-2;
border: 1px solid $--border-color-base;
border-radius: 4px;
z-index: 9999999999 !important;
.el-notification__icon{
font-size: 20px;
color: #EC7F66;

View File

@@ -402,6 +402,7 @@ export default new Vue({
response.data.list.forEach((item, index) => {
setTimeout(() => {
this.$notify({
offset: 90,
duration: 5000,
iconClass: 'nz-icon nz-icon-Notification',
dangerouslyUseHTMLString: true,
@@ -409,6 +410,9 @@ export default new Vue({
h('p',
{
class: 'notification-summary',
attrs: {
title: item.summary
},
on: {
click: self.toAlertPage
}
@@ -417,7 +421,10 @@ export default new Vue({
),
h('p',
{
class: 'notification-description'
class: 'notification-description',
attrs: {
title: item.description
}
},
item.description || '-'
)
@@ -426,15 +433,27 @@ export default new Vue({
})
}, 10 * index)
})
this.audio.play()
let playCount = 0
const audioLoop = store.state.nzDefaultConfig.audioLoop || 3
const maxPlayCount = parseInt(audioLoop) // 设置希望播放的次数
if (maxPlayCount) {
this.audio.play()
}
this.audio.addEventListener('ended', () => {
playCount++
if (playCount < maxPlayCount) {
this.audio.play()
}
})
}
}
}, ms)
},
toAlertPage () {
if (router.currentRoute.path !== '/alertMessage') {
router.push({ path: '/alertMessage' })
if (router.currentRoute.path === '/alertMessage') {
store.commit('setIsRouteLive')
}
router.push({ path: '/alertMessage' })
this.$notify.closeAll()
},
closeNotification () {