feat: alert列 调整

This commit is contained in:
zhangyu
2022-02-25 10:53:43 +08:00
parent bdb92e4aa6
commit 1d769d66ff
3 changed files with 58 additions and 33 deletions

View File

@@ -1,7 +1,7 @@
.alert-days-info{
display: block;
height: 100%;
width: 100%;
width: auto;
display: inline-block;
> div{
display: inline-block;
width: 8px;
@@ -12,35 +12,38 @@
cursor: pointer;
position: relative;
}
.alert-days-info-tooltip{
position: fixed;
z-index: 1;
padding: 5px 10px 5px 10px;
line-height: 20px;
min-width: 120px;
width: auto;
.severity-time {
margin-bottom: 5px;
}
.severity-info {
display: flex;
align-items: center
}
.severity-block{
display: inline-block;
width: 18px;
height: 10px;
border: 1px solid $--border-color-base;
margin-right: 5px;
}
.severity-name {
margin-right: 30px;
color: $--color-text-primary;
font-size: 12px;
}
.severity-value {
color: $--color-text-regular;
font-size: 12px;
}
}
.alert-days-info-tooltip{
position: fixed;
z-index: 1;
padding: 5px 10px 5px 10px;
line-height: 20px;
min-width: 120px;
width: auto;
.severity-time {
margin-bottom: 5px;
}
.severity-info {
display: flex;
align-items: center
}
.severity-block{
display: inline-block;
width: 18px;
height: 10px;
border: 1px solid $--border-color-base;
margin-right: 5px;
}
.severity-name {
margin-right: 30px;
color: $--color-text-primary;
font-size: 12px;
}
.severity-value {
color: $--color-text-regular;
font-size: 12px;
}
}
.vertical-align-top{
vertical-align: top;
}

View File

@@ -45,7 +45,14 @@
<template v-else-if="item.prop === 'alertNum'">
<!-- v-my-loading:ldsFacebook="scope.row.trendLoading"-->
<span style="cursor: pointer" @click="$emit('showBottomBox', 'alertMessageTab', scope.row)">
<!-- <i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert"></i> <span>{{scope.row.alertNum ? scope.row.alertNum : 0}}</span>-->
<i :class="scope.row.alertNum ? 'red' : 'green'" class="nz-icon nz-icon-overview-alert vertical-align-top;" @mouseenter="tooltipHover(scope.row,true, $event)" @mouseleave="tooltipHover(scope.row,false, $event)"></i>
<div v-if="scope.row.alertNumtooltipShow" class="alert-days-info-tooltip" :style="{left: scope.row.left + 'px',top:scope.row.top + 'px'}">
<div class="tooltip-title">Alert message (active)</div>
<div class="severity-info" style='justify-content: space-between'>
<div class="severity-name">{{$t('overall.result.total')}}</div>
<div class="severity-value">{{scope.row.alertNum}}</div>
</div>
</div>
<alertDaysInfo
v-show="!scope.row.trendLoading"
:alertDaysData="scope.row.alertDaysData"
@@ -340,6 +347,20 @@ export default {
this.$set(item, 'loading', loading)
// this.$set(this.tableData,index,item);// 调用父组件
},
tooltipHover (item, flag, e) {
if (e) {
const dom = e.currentTarget
const position = dom.getBoundingClientRect()
item.left = position.left
this.$set(item, 'left', position.left)
if (position.top > window.innerHeight / 2) {
this.$set(item, 'top', position.top - 100)
} else {
this.$set(item, 'top', position.top + 30)
}
this.$set(item, 'alertNumtooltipShow', flag)
}
},
returnCabinet (start, end) { // 返回机柜u位信息
if (!start || !end) {
return ''

View File

@@ -228,6 +228,7 @@ export default {
}
this.rightBox.show = true
} else {
this.object = {}
this.rightBox.show = true
this.rightBox.loading = true
this.$get('visual/panel/chart/' + data.id).then(res => {