NEZ-1555 fix:悬浮弹窗位置错误的问题

This commit is contained in:
zhangyu
2022-02-14 14:13:49 +08:00
parent e9a11fab2e
commit 7ff1dac646
7 changed files with 17 additions and 19 deletions

View File

@@ -58,6 +58,11 @@
max-width: 210px;
}
}
.alert-rule-detail{
.alert-label, .alert-labelUp{
position: absolute;
}
}
//.alert-label::after, .alert-labelUp::after {
// content: '';
// display: block;

View File

@@ -113,7 +113,6 @@ export default {
})
},
statMouseMove (e) {
console.log(e)
const windowWidth = window.innerWidth// 窗口宽度
const windowHeight = window.innerHeight// 窗口高度
const box = document.getElementById(`chart-canvas-tooltip-${this.chartId}`)

View File

@@ -297,8 +297,6 @@ export default {
},
containerHeight: function () {
if (!this.autoSize) return
// console.log("bottom: " + bottom(this.layout))
// console.log("rowHeight + margins: " + (this.rowHeight + this.margin[1]) + this.margin[1])
const containerHeight = bottom(this.layout) * (this.rowHeight + this.margin[1]) + this.margin[1] + 'px'
return containerHeight
},

View File

@@ -65,6 +65,7 @@ export default {
props: {
id: {},
messageLoad: {},
detailList: Boolean,
that: {},
severityData: Array
},
@@ -91,14 +92,15 @@ export default {
// const windowWidth = window.innerWidth
const boxHeight = this.$refs.alertLabels ? this.$refs.alertLabels.offsetHeight : 231
const windowHeight = window.innerHeight
const leftOffSetView = this.detailList ? -80 : 10
if (position.top > windowHeight / 2) {
return {
left: `${position.left + position.width + 10}px`,
left: `${position.left + position.width + leftOffSetView}px`,
top: `${position.top - boxHeight}px`
}
} else {
return {
left: `${position.left + position.width + 10}px`,
left: `${position.left + position.width + leftOffSetView}px`,
top: `${position.top}px`
}
}

View File

@@ -20,19 +20,15 @@
<li
v-for="(item,index) in tableData"
:key="index"
class="detail-row"
class="detail-row"
:id="'globalSearch' + item.id"
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
@click="detailViewRightShow(item)">
<el-popover
placement="right-start"
popper-class="alert-message-tooltip alert-rule-detail"
style="position: relative"
@show="alertMessageHover(item, true)"
@hide="alertMessageHover(item, false)"
trigger="hover">
<alertRuleInfo v-if="item.loading" :id="item.id" :severity-data="severityData" :that="item" @showText="showText(item)"></alertRuleInfo>
<div class="detail-row-info" slot="reference">
@click="detailViewRightShow(item)"
@mouseenter="alertMessageHover(item, true, $event)"
@mouseleave="alertMessageHover(item, false)"
>
<alertRuleInfo v-if="item.loading" :id="item.id" :severity-data="severityData" :that="item" @showText="showText(item)" :detail-list="true"></alertRuleInfo>
<div class="detail-row-info" slot="reference">
<div class="asset-manageIp">
<i class="nz-icon nz-icon-overview-alert" :class="item.alertNum>0?'colorEF7458':'color23BF9A'"/>
{{item.name}}
@@ -46,7 +42,6 @@
</span>
</div>
</div>
</el-popover>
</li>
</ul>
<el-dialog class="nz-dialog table-chart-dialog" :title="$t('alert.config.trbShot')"

View File

@@ -20,7 +20,7 @@
<li
v-for="(item,index) in tableData"
:key="index"
class="detail-row"
class="detail-row"
:id="'globalSearch' + item.id"
:class="item.id === detailViewRightObj.id ? 'selected' : ''"
@click="detailViewRightShow(item)"

View File

@@ -144,7 +144,6 @@ export default {
deep: true,
handler (n) {
if (this.type === 'datetime') {
// console.log(12312312)
}
}
}