fix: Detection模块右侧tab的图标自适应居中
This commit is contained in:
@@ -7,9 +7,18 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
padding-top: 18px;
|
//padding-top: 18px;
|
||||||
background-color: #EFF2F5;
|
background-color: #EFF2F5;
|
||||||
|
|
||||||
|
.cn-detection__collapse-block {
|
||||||
|
min-height: 66px;
|
||||||
|
height: 100%;
|
||||||
|
max-height: 88px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
transform: rotate(0);
|
transform: rotate(0);
|
||||||
transition: all linear .2s;
|
transition: all linear .2s;
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="cn-detection--list" :style="{zIndex: !isCollapse ? 5 : 'unset'}">
|
<div class="cn-detection--list" :style="{zIndex: !isCollapse ? 5 : 'unset'}">
|
||||||
<!-- 左侧下拉按钮 -->
|
<!-- 左侧下拉按钮 -->
|
||||||
<div class="cn-detection__collapse" id="detectionTab" :style="{'padding-top': paddingTop}">
|
<div class="cn-detection__collapse">
|
||||||
<span @click="switchCollapse" :class="{'reg-down': !isCollapse}">
|
<div class="cn-detection__collapse-block" @click="switchCollapse">
|
||||||
|
<span :class="{'reg-down': !isCollapse}">
|
||||||
<i class="cn-icon cn-icon-arrow-right"></i>
|
<i class="cn-icon cn-icon-arrow-right"></i>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="cn-detection__case">
|
<div class="cn-detection__case">
|
||||||
<div class="cn-detection__icon" :style="`background-color: ${eventSeverityColor[detection.eventSecurity]}`"></div>
|
<div class="cn-detection__icon" :style="`background-color: ${eventSeverityColor[detection.eventSecurity]}`"></div>
|
||||||
@@ -127,8 +129,7 @@ export default {
|
|||||||
entityType,
|
entityType,
|
||||||
detectionPageType,
|
detectionPageType,
|
||||||
isCollapse: true, // 是否是折叠状态
|
isCollapse: true, // 是否是折叠状态
|
||||||
eventSeverityColor,
|
eventSeverityColor
|
||||||
paddingTop: '21px'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -164,15 +165,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
|
||||||
// 不放在computed是因为第一个dom为null,造成较小屏幕下第一个tab的位置不居中
|
|
||||||
const dom = document.getElementById('detectionTab')
|
|
||||||
let top = 21
|
|
||||||
if (dom) {
|
|
||||||
top = dom.clientHeight / 2 - 12
|
|
||||||
}
|
|
||||||
this.paddingTop = top + 'px'
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
unitConvert,
|
unitConvert,
|
||||||
getMillisecond,
|
getMillisecond,
|
||||||
|
|||||||
Reference in New Issue
Block a user