fix:修改提示弹窗大小

This commit is contained in:
zyh
2023-11-28 18:04:19 +08:00
parent bee777e94b
commit bbb247f87a
3 changed files with 45 additions and 17 deletions

View File

@@ -833,12 +833,26 @@ input::placeholder{
}
.operationTutorial-dialog{
.el-dialog__title{
font-size: 14px;
font-weight: 600;
.el-dialog{
width: 85%;
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 {
margin-bottom: 15px;
box-sizing: border-box;
padding-bottom: 15px;
line-height: 25px;
height: 40px;
word-wrap: break-word;
color: $--color-text-primary;
span{
@@ -849,11 +863,13 @@ input::placeholder{
}
}
.el-dialog__body {
box-sizing: border-box;
padding: 30px;
padding-top: 0;
height: calc(100% - 55px);
.operationTutorial-img{
width: 100%;
height: 390px;
height: calc(100% - 70px);
display: block;
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
}
@@ -863,7 +879,10 @@ input::placeholder{
color: $--color-text-regular;
font-weight: 400;
text-align: center;
margin-top: 12px;
box-sizing: border-box;
padding-top: 12px;
line-height: 18px;
height: 30px;
}
}
}

View File

@@ -91,7 +91,6 @@
:title="$t('overall.tip')"
:visible.sync="dialogVisible"
@close='handleClose'
width="772px"
:append-to-body="true"
>
<div class="dialog-header">

View File

@@ -31,7 +31,9 @@ export default new Vue({
// 创建图表信息
chartAddInfo: {
metricTarget: []
}
},
newAlertTimer: undefined,
lastId: -1
}
},
methods: {
@@ -350,24 +352,33 @@ export default new Vue({
pageSize: 1,
orderBy: '-id'
}
this.newAlertTimer = 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
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
this.newAlertTimer = setTimeout(async () => {
this.newAlertTimer = setInterval(async () => {
const queryParams = {
body: encodeURIComponent(JSON.stringify({
id: ['>' + lastId],
id: ['>' + this.lastId],
state: 1
})),
orderBy: '-id'
}
const response = await get('/alert/message/query', queryParams, { headers: { notCancel: true } })
if (!this.newAlertTimer) {
// 防止正在请求时关闭 此时不再执行
if (this.newAlertTimer === null) {
return
}
if (response.code == 200) {
@@ -375,7 +386,7 @@ export default new Vue({
this.audio = new Audio(audioUrl)
}
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
}, -1)
const h = this.$createElement
@@ -410,7 +421,6 @@ export default new Vue({
this.audio.play()
}
}
this.getNewAlert(lastId, interval)
}, ms)
},
toAlertPage () {
@@ -420,7 +430,7 @@ export default new Vue({
this.$notify.closeAll()
},
closeNotification () {
clearTimeout(this.newAlertTimer)
clearInterval(this.newAlertTimer)
this.newAlertTimer = null
}
},