feat(wms): 新增钢卷通用维度告警管理功能
1. 新增告警信息路由页面与API接口 2. 在导航栏添加告警入口与未读红点提示 3. 实现告警列表查询、处理、忽略、删除与导出功能 4. 每分钟自动刷新告警状态检查
This commit is contained in:
@@ -11,6 +11,11 @@
|
||||
<div class="right-menu-item hover-effect" @click="gotoTodo" title="代办事项">
|
||||
<el-icon class="el-icon-document-checked" />
|
||||
</div>
|
||||
<div class="right-menu-item hover-effect" @click="gotoWarning" title="告警信息">
|
||||
<el-badge :is-dot="hasWarning" class="nav-badge">
|
||||
<el-icon class="el-icon-bell" />
|
||||
</el-badge>
|
||||
</div>
|
||||
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
|
||||
@@ -51,6 +56,7 @@ import Hamburger from '@/components/Hamburger'
|
||||
import Screenfull from '@/components/Screenfull'
|
||||
// import SizeSelect from '@/components/SizeSelect'
|
||||
import Search from '@/components/HeaderSearch'
|
||||
import { listMaterialWarning } from '@/api/wms/materialWarning'
|
||||
// import RuoYiGit from '@/components/RuoYi/Git'
|
||||
// import RuoYiDoc from '@/components/RuoYi/Doc'
|
||||
|
||||
@@ -65,6 +71,12 @@ export default {
|
||||
// RuoYiGit,
|
||||
// RuoYiDoc
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hasWarning: false,
|
||||
warningTimer: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'sidebar',
|
||||
@@ -99,6 +111,16 @@ export default {
|
||||
gotoTodo() {
|
||||
this.$router.push({ path: '/wms/todo' })
|
||||
},
|
||||
gotoWarning() {
|
||||
this.$router.push({ path: '/wms/materialWarning' })
|
||||
},
|
||||
checkWarning() {
|
||||
listMaterialWarning({ pageNum: 1, pageSize: 1, warningStatus: '0' }).then(response => {
|
||||
this.hasWarning = response.total > 0
|
||||
}).catch(() => {
|
||||
this.hasWarning = false
|
||||
})
|
||||
},
|
||||
async logout() {
|
||||
this.$confirm('确定注销并退出系统吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -110,6 +132,18 @@ export default {
|
||||
})
|
||||
}).catch(() => {});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.checkWarning()
|
||||
this.warningTimer = setInterval(() => {
|
||||
this.checkWarning()
|
||||
}, 60000)
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.warningTimer) {
|
||||
clearInterval(this.warningTimer)
|
||||
this.warningTimer = null
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -216,6 +250,13 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-badge {
|
||||
::v-deep .el-badge__content.is-fixed {
|
||||
top: 14px;
|
||||
right: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user