CN-240 feat: entity列表(行式)
This commit is contained in:
@@ -20,6 +20,15 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
overflow: hidden auto;
|
overflow: hidden auto;
|
||||||
|
|
||||||
|
.cn-entity__shadow {
|
||||||
|
position: fixed;
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
background-color: rgba(0, 0, 0, .2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,21 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
background-color: #F3F7FA;
|
background-color: #F3F7FA;
|
||||||
|
|
||||||
i {
|
span {
|
||||||
|
transform: rotate(0);
|
||||||
|
transition: all linear .2s;
|
||||||
|
padding-top: 0;
|
||||||
|
|
||||||
|
&.reg-down {
|
||||||
|
padding-top: 2px;
|
||||||
|
transform: rotate(90deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
span:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cn-icon-arrow-right {
|
||||||
color: #ADBCCA;
|
color: #ADBCCA;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
@@ -47,6 +61,7 @@
|
|||||||
|
|
||||||
.cn-entity__header {
|
.cn-entity__header {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
padding-bottom: 3px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
.cn-entity__body {
|
.cn-entity__body {
|
||||||
@@ -85,6 +100,10 @@
|
|||||||
padding: 0 30px;
|
padding: 0 30px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #3976CB;
|
color: #3976CB;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,12 @@
|
|||||||
<!-- 列表式 -->
|
<!-- 列表式 -->
|
||||||
<template v-if="listMode === 'list'">
|
<template v-if="listMode === 'list'">
|
||||||
<div class="entity-list--list">
|
<div class="entity-list--list">
|
||||||
|
<div v-if="isCollapse" class="cn-entity__shadow"></div>
|
||||||
<entity-row
|
<entity-row
|
||||||
v-for="(data, index) in listData"
|
v-for="(data, index) in listData"
|
||||||
:entity="data"
|
:entity="data"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
@showCollapse="showCollapse"
|
||||||
></entity-row>
|
></entity-row>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -68,7 +70,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
showDetail: false,
|
showDetail: false,
|
||||||
typeName: '',
|
typeName: '',
|
||||||
entityList: []
|
entityList: [],
|
||||||
|
isCollapse: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -96,6 +99,9 @@ export default {
|
|||||||
},
|
},
|
||||||
entityDetail (params) {
|
entityDetail (params) {
|
||||||
this.$emit('showDetail', { ...params, icon: this.iconClass })
|
this.$emit('showDetail', { ...params, icon: this.iconClass })
|
||||||
|
},
|
||||||
|
showCollapse (isCollapse) {
|
||||||
|
this.isCollapse = isCollapse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="cn-entity--list">
|
<div class="cn-entity--list" :style="{zIndex: isCollapse ? 1 : 'unset'}">
|
||||||
<!-- 左侧下拉按钮 -->
|
<!-- 左侧下拉按钮 -->
|
||||||
<div class="cn-entity__collapse">
|
<div class="cn-entity__collapse">
|
||||||
<span><i class="cn-icon cn-icon-arrow-right"></i></span>
|
<span @click="showCollapse" :class="{'reg-down': isCollapse}"><i class="cn-icon cn-icon-arrow-right"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="cn-entity__case">
|
<div class="cn-entity__case">
|
||||||
<div class="cn-entity__icon"><i :class="iconClass"></i></div>
|
<div class="cn-entity__icon"><i :class="iconClass"></i></div>
|
||||||
@@ -65,26 +65,26 @@
|
|||||||
<!-- 通用字段 -->
|
<!-- 通用字段 -->
|
||||||
<div class="basic-info__item">
|
<div class="basic-info__item">
|
||||||
<i class="cn-icon cn-icon-rise"></i>
|
<i class="cn-icon cn-icon-rise"></i>
|
||||||
<span>{{$t('entities.risk')}} : </span>
|
<span>{{$t('entities.sentThroughput')}} : </span>
|
||||||
<span>{{entityData.bytesSentRate || '-'}}</span>
|
<span>{{entityData.bytesSentRate || '-'}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="basic-info__item">
|
<div class="basic-info__item">
|
||||||
<i class="cn-icon cn-icon-fall"></i>
|
<i class="cn-icon cn-icon-fall"></i>
|
||||||
<span>{{$t('entities.risk')}} : </span>
|
<span>{{$t('entities.receivedThroughput')}} : </span>
|
||||||
<span>{{entityData.bytesReceivedRate || '-'}}</span>
|
<span>{{entityData.bytesReceivedRate || '-'}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="basic-info__item">
|
<div class="basic-info__item">
|
||||||
<i class="cn-icon cn-icon-entity-alert"></i>
|
<i class="cn-icon cn-icon-entity-alert"></i>
|
||||||
<span>{{$t('entities.risk')}} : </span>
|
<span>{{$t('entities.recentAlert')}} : </span>
|
||||||
<span>{{entityData.alertCount || '-'}}</span>
|
<span>{{entityData.alertCount || '-'}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="basic-info__item">
|
<div class="basic-info__item">
|
||||||
<i class="cn-icon cn-icon-safe"></i>
|
<i class="cn-icon cn-icon-safe"></i>
|
||||||
<span>{{$t('entities.risk')}} : </span>
|
<span>{{$t('entities.recentSecurity')}} : </span>
|
||||||
<span>{{entityData.securityCount || '-'}}</span>
|
<span>{{entityData.securityCount || '-'}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="show-detail">{{$t('overall.detail')}}>></div>
|
<div class="show-detail" :style="{visibility: isCollapse ? 'visible' : 'hidden'}">{{$t('overall.detail')}}>></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="body__detail"></div>
|
<div class="body__detail"></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -97,6 +97,17 @@
|
|||||||
import entityListMixin from './entityListMixin'
|
import entityListMixin from './entityListMixin'
|
||||||
export default {
|
export default {
|
||||||
name: 'Row',
|
name: 'Row',
|
||||||
mixins: [entityListMixin]
|
mixins: [entityListMixin],
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
isCollapse: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showCollapse () {
|
||||||
|
this.isCollapse = !this.isCollapse
|
||||||
|
this.$emit('showCollapse', this.isCollapse)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user