fix: 修复overview-alertmessage数量显示不对等

1.修复overview-alertmessage数量显示不对的问题
2.operationlog state颜色、顶部菜单状态
This commit is contained in:
陈劲松
2020-04-26 11:26:22 +08:00
parent d672ba9cb1
commit cc92b77472
3 changed files with 13 additions and 22 deletions

View File

@@ -70,13 +70,6 @@
<!-- <div @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToAsset(item.id)" :class="{'menu-item-active' : (activeIndex == 'asset' && indOf(activeItemIndexes, item.id) > -1) }">--> <!-- <div @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToAsset(item.id)" :class="{'menu-item-active' : (activeIndex == 'asset' && indOf(activeItemIndexes, item.id) > -1) }">-->
<div @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToAsset(item.id)" > <div @mouseenter="hoverItemIndex = '3-' + index" @mouseleave="hoverItemIndex = ''" @click="jumpToAsset(item.id)" >
<span class="too-long-split" style="width: 130px;">{{item.name}}</span> <span class="too-long-split" style="width: 130px;">{{item.name}}</span>
<!-- <idc-config-box :post-idc="item" ref="idcConfigBox" placement="left" @after="getIDCOptionData" :user-data="userDatas">-->
<!-- <template v-slot:optionZone>-->
<!-- <div v-show="hoverItemIndex == '3-' + index" @click="closeAllPop" class="menu-edit">-->
<!-- <i class="nz-icon nz-icon-edit" @click="getIDCOptionData(item.id)" style="color: inherit"></i>-->
<!-- </div>-->
<!-- </template>-->
<!-- </idc-config-box>-->
</div> </div>
</el-menu-item> </el-menu-item>
</template> </template>
@@ -94,7 +87,7 @@
</el-submenu> </el-submenu>
<el-submenu index="5" popper-class="nz-submenu"> <el-submenu index="5" popper-class="nz-submenu">
<template slot="title"> <template slot="title">
<div @click="jumpTo('account')" :class ="activeIndex == 'account' || activeIndex == 'promServer' || activeIndex == 'dc' || activeIndex == 'model' || activeIndex == 'mib' || activeIndex == 'system' || activeIndex == 'terminallog' ? 'menu-active' :''">{{$t('overall.config')}}</div> <div @click="jumpTo('account')" :class ="activeIndex == 'account' || activeIndex == 'promServer' || activeIndex == 'dc' || activeIndex == 'model' || activeIndex == 'mib' || activeIndex == 'system' || activeIndex == 'terminallog' || activeIndex == 'operationlog' ? 'menu-active' :''">{{$t('overall.config')}}</div>
</template> </template>
<el-menu-item index="5-0"> <el-menu-item index="5-0">
<div @click="jumpTo('account')" :class="{'menu-item-active' :(activeIndex == 'account' )}">{{$t('config.account.account')}}</div> <div @click="jumpTo('account')" :class="{'menu-item-active' :(activeIndex == 'account' )}">{{$t('config.account.account')}}</div>
@@ -277,7 +270,7 @@
t: +new Date() t: +new Date()
} }
}); });
this.activeIndex = data this.activeIndex = data;
}, },
createBox(item) { createBox(item) {

View File

@@ -52,6 +52,7 @@
:height="$tableHeight.normal" :height="$tableHeight.normal"
v-loading="loading" v-loading="loading"
v-scrollBar:el-table="'large'" v-scrollBar:el-table="'large'"
:cell-class-name="messageStyle"
style="width: 100%;"> style="width: 100%;">
<el-table-column <el-table-column
:resizable="false" :resizable="false"
@@ -62,11 +63,6 @@
:label="item.label" :label="item.label"
> >
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
<span v-if="item.prop == 'lang'">
{{scope.row[item.prop] == 'en' ? 'English' : ''}}
{{scope.row[item.prop] == 'zh' ? '中文' : ''}}
{{scope.row[item.prop] == 'ru' ? 'русский' : ''}}
</span>
<span v-if="item.prop == 'time'"> <span v-if="item.prop == 'time'">
{{scope.row[item.prop]}} ms {{scope.row[item.prop]}} ms
</span> </span>
@@ -256,6 +252,16 @@
this.$store.commit('setHeaderTable', data); this.$store.commit('setHeaderTable', data);
this.tablelable = data; this.tablelable = data;
}, },
messageStyle(e) {
if (e.column.label == this.$t('config.operationlog.state')) {
if (e.row.state == 'success') {
return 'success';
} else {
return 'danger';
}
}
return '';
},
getTableData: function () { getTableData: function () {
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo); this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize); this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);

View File

@@ -191,7 +191,6 @@
this.queryEndpointData(); this.queryEndpointData();
this.queryAlertMessageData(); this.queryAlertMessageData();
this.queryAlertRuleData(); this.queryAlertRuleData();
this.queryDatacenterData();
this.queryAlertTrendData(); this.queryAlertTrendData();
this.queryMapChartGeoJson(); this.queryMapChartGeoJson();
this.queryAlertStatByRule(); this.queryAlertStatByRule();
@@ -309,13 +308,6 @@
} }
}) })
}, },
queryDatacenterData() {
this.$get('overview/datacenterStat').then(response => {
if (response.code === 200) {
this.alertMessageData = response.data;
}
})
},
queryAlertTrendData() { queryAlertTrendData() {
this.$refs.chartbox.startLoading(); this.$refs.chartbox.startLoading();
let cur=this.dateFormat('yyyy-mm-dd HH:MM:SS',new Date()); let cur=this.dateFormat('yyyy-mm-dd HH:MM:SS',new Date());