fix:修改提示弹窗大小
This commit is contained in:
@@ -833,12 +833,26 @@ input::placeholder{
|
|||||||
}
|
}
|
||||||
|
|
||||||
.operationTutorial-dialog{
|
.operationTutorial-dialog{
|
||||||
.el-dialog__title{
|
.el-dialog{
|
||||||
font-size: 14px;
|
width: 85%;
|
||||||
font-weight: 600;
|
height: 90%;
|
||||||
|
}
|
||||||
|
.el-dialog__header{
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 20px;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
line-height: 25px;
|
||||||
|
height: 55px;
|
||||||
|
.el-dialog__title{
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.dialog-header {
|
.dialog-header {
|
||||||
margin-bottom: 15px;
|
box-sizing: border-box;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
line-height: 25px;
|
||||||
|
height: 40px;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
color: $--color-text-primary;
|
color: $--color-text-primary;
|
||||||
span{
|
span{
|
||||||
@@ -849,11 +863,13 @@ input::placeholder{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.el-dialog__body {
|
.el-dialog__body {
|
||||||
|
box-sizing: border-box;
|
||||||
padding: 30px;
|
padding: 30px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
|
height: calc(100% - 55px);
|
||||||
.operationTutorial-img{
|
.operationTutorial-img{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 390px;
|
height: calc(100% - 70px);
|
||||||
display: block;
|
display: block;
|
||||||
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
|
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
@@ -863,7 +879,10 @@ input::placeholder{
|
|||||||
color: $--color-text-regular;
|
color: $--color-text-regular;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 12px;
|
box-sizing: border-box;
|
||||||
|
padding-top: 12px;
|
||||||
|
line-height: 18px;
|
||||||
|
height: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,6 @@
|
|||||||
:title="$t('overall.tip')"
|
:title="$t('overall.tip')"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
@close='handleClose'
|
@close='handleClose'
|
||||||
width="772px"
|
|
||||||
:append-to-body="true"
|
:append-to-body="true"
|
||||||
>
|
>
|
||||||
<div class="dialog-header">
|
<div class="dialog-header">
|
||||||
|
|||||||
@@ -31,7 +31,9 @@ export default new Vue({
|
|||||||
// 创建图表信息
|
// 创建图表信息
|
||||||
chartAddInfo: {
|
chartAddInfo: {
|
||||||
metricTarget: []
|
metricTarget: []
|
||||||
}
|
},
|
||||||
|
newAlertTimer: undefined,
|
||||||
|
lastId: -1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -350,24 +352,33 @@ export default new Vue({
|
|||||||
pageSize: 1,
|
pageSize: 1,
|
||||||
orderBy: '-id'
|
orderBy: '-id'
|
||||||
}
|
}
|
||||||
|
this.newAlertTimer = true
|
||||||
const response = await get('/alert/message/query', queryParams, { headers: { notCancel: true } })
|
const response = await get('/alert/message/query', queryParams, { headers: { notCancel: true } })
|
||||||
const lastId = this.$lodash.get(response, 'data.list[0].id', -1)
|
this.lastId = this.$lodash.get(response, 'data.list[0].id', -1)
|
||||||
const interval = store.state.nzDefaultConfig.interval
|
const interval = store.state.nzDefaultConfig.interval
|
||||||
this.getNewAlert(lastId, interval || 10)
|
// 防止正在请求时关闭 此时不再执行
|
||||||
|
if (this.newAlertTimer === null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.getNewAlert(interval || 10)
|
||||||
},
|
},
|
||||||
// 查询告警消息
|
// 查询告警消息
|
||||||
getNewAlert (lastId, interval = 10) {
|
getNewAlert (interval = 10) {
|
||||||
|
if (this.newAlertTimer && this.newAlertTimer !== true) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const ms = parseInt(interval) * 1000
|
const ms = parseInt(interval) * 1000
|
||||||
this.newAlertTimer = setTimeout(async () => {
|
this.newAlertTimer = setInterval(async () => {
|
||||||
const queryParams = {
|
const queryParams = {
|
||||||
body: encodeURIComponent(JSON.stringify({
|
body: encodeURIComponent(JSON.stringify({
|
||||||
id: ['>' + lastId],
|
id: ['>' + this.lastId],
|
||||||
state: 1
|
state: 1
|
||||||
})),
|
})),
|
||||||
orderBy: '-id'
|
orderBy: '-id'
|
||||||
}
|
}
|
||||||
const response = await get('/alert/message/query', queryParams, { headers: { notCancel: true } })
|
const response = await get('/alert/message/query', queryParams, { headers: { notCancel: true } })
|
||||||
if (!this.newAlertTimer) {
|
// 防止正在请求时关闭 此时不再执行
|
||||||
|
if (this.newAlertTimer === null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
@@ -375,7 +386,7 @@ export default new Vue({
|
|||||||
this.audio = new Audio(audioUrl)
|
this.audio = new Audio(audioUrl)
|
||||||
}
|
}
|
||||||
if (response.data.list && response.data.list.length) {
|
if (response.data.list && response.data.list.length) {
|
||||||
lastId = response.data.list.reduce(function (max, obj) {
|
this.lastId = response.data.list.reduce(function (max, obj) {
|
||||||
return obj.id > max ? obj.id : max
|
return obj.id > max ? obj.id : max
|
||||||
}, -1)
|
}, -1)
|
||||||
const h = this.$createElement
|
const h = this.$createElement
|
||||||
@@ -410,7 +421,6 @@ export default new Vue({
|
|||||||
this.audio.play()
|
this.audio.play()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.getNewAlert(lastId, interval)
|
|
||||||
}, ms)
|
}, ms)
|
||||||
},
|
},
|
||||||
toAlertPage () {
|
toAlertPage () {
|
||||||
@@ -420,7 +430,7 @@ export default new Vue({
|
|||||||
this.$notify.closeAll()
|
this.$notify.closeAll()
|
||||||
},
|
},
|
||||||
closeNotification () {
|
closeNotification () {
|
||||||
clearTimeout(this.newAlertTimer)
|
clearInterval(this.newAlertTimer)
|
||||||
this.newAlertTimer = null
|
this.newAlertTimer = null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user