fix:asset 列表添加pingStatus列,及pingStatus过滤条件

This commit is contained in:
wangwenrui
2020-02-07 11:22:08 +08:00
parent c2208e99d0
commit 707e545089
3 changed files with 23 additions and 9 deletions

View File

@@ -158,6 +158,8 @@ const en = {
asset:{
asset: 'Asset',//'资产'
EditAsset:'Edit asset',//'编辑资产'
pingActive: 'active',//可ping通
pingInactive:'inactive',
createAssetTab:{
title:'New asset',//'新增资产'
sn:'SN',//SN
@@ -301,6 +303,7 @@ const en = {
device: 'SN',//SN
host: 'Host',//'Host'
assetState: 'State',//'状态'
assetPing: 'PingStatus',
modules: 'Module',//'组件'
alerts: 'Alert information',//'告警信息'
dataCenter: 'DC',//DC

View File

@@ -47,6 +47,16 @@
value: 2,
label: i18n.t('asset.createAssetTab.notInStock')
}
],
pingStatus:[
{
value: '0',
label:i18n.t('asset.pingInactive')
},
{
value: '1',
label:i18n.t('asset.pingActive')
}
]
};
export default searchSelectInfo;

View File

@@ -86,15 +86,15 @@
<div v-if="item.prop=='state'">
<span>{{scope.row.state==1 ? $t('asset.createAssetTab.inStock') : $t('asset.createAssetTab.notInStock')}}</span>
</div>
<div v-if="item.prop == 'ping'">
<div v-if="item.prop == 'pingStatus'">
<el-popover
placement="right"
width="200"
trigger="hover"
:content="scope.row.pingLastUpdate+'['+scope.row.pingRtt+']'">
<span slot="reference">
<i :class="{'active-icon green':scope.row.pingState==1,'active-icon red':scope.row.pingState != 1}"></i>
</span>
<div slot="reference" style="width: 20px">
<div :class="{'active-icon green':scope.row.pingState == 1,'active-icon red':scope.row.pingState == 0}"></div>
</div>
</el-popover>
</div>
<template v-if="item.prop=='Module'">
@@ -244,7 +244,7 @@
show: true,
}, {
label:this.$t('asset.tableTitle.assetPing'),
prop:'ping',
prop:'pingStatus',
show:true,
},{
label: this.$t("asset.tableTitle.modules"),
@@ -726,14 +726,15 @@
</style>
<style lang="scss">
.active-icon{
width:20px;
height:20px;
margin-top:20px;
width:10px;
height:10px;
border-radius:50%;
}
.active-icon .red{
.red {
background-color:red;
}
.active-icon .green{
.green {
background-color:lightGreen;
}