feat:内置告警规则产生的告警信息不查询当前值

This commit is contained in:
wangwenrui
2020-10-15 10:03:08 +08:00
parent 3ba62acd44
commit bf41d48255
3 changed files with 59 additions and 49 deletions

View File

@@ -133,7 +133,7 @@
{{scope.row['state'] == 2 ? "Expired" : ""}}
</span>
<div v-else-if="item.prop == 'current'" class="too-long-split pointer" @click="detail(scope.row)">
<span v-if="!scope.row.current">-</span>
<span v-if="!scope.row.current || scope.row.alertRule.buildIn == 1">-</span>
<el-popover v-else placement="right" trigger="hover">
<div slot="reference">
<span class="content-right-option" :id="'alert-list-detail-'+scope.row.id"><i class="nz-icon nz-icon-chart"></i></span>
@@ -614,12 +614,15 @@
this.deleteBox.show = false;
},
exportCur:function(){
this.exportExcel(this.searchLabel);
let searchLabel=Object.assign({},this.searchLabel)
this.$set(searchLabel,'language',localStorage.getItem("nz-language") ? localStorage.getItem("nz-language") : 'en')
this.exportExcel(searchLabel);
this.closeDialog();
},
exportAll:function(){
let temp = JSON.parse(JSON.stringify(this.searchLabel));
temp.pageSize = -1;
this.$set(temp,'language',localStorage.getItem("nz-language") ? localStorage.getItem("nz-language") : 'en')
this.exportExcel(temp);
this.closeDialog();
},

View File

@@ -307,7 +307,16 @@
})
},
exportCur:function(){
this.exportExcel(this.searchLabel);
let searchLabel=Object.assign({},this.searchLabel)
this.$set(searchLabel,'language',localStorage.getItem("nz-language") ? localStorage.getItem("nz-language") : 'en')
this.exportExcel(searchLabel);
this.importBox.show = false;
},
exportAll:function(){
let temp = JSON.parse(JSON.stringify(this.searchLabel));
temp.pageSize = -1;
this.$set(temp,'language',localStorage.getItem("nz-language") ? localStorage.getItem("nz-language") : 'en')
this.exportExcel(temp);
this.importBox.show = false;
},
getTimeString:function(){
@@ -324,12 +333,6 @@
formatNum:function(num){
return num>9?num:'0'+num;
},
exportAll:function(){
let temp = JSON.parse(JSON.stringify(this.searchLabel));
temp.pageSize = -1;
this.exportExcel(temp);
this.importBox.show = false;
},
exportExcel:function(params){
let temp=this;
if(!params){
@@ -485,6 +488,7 @@
this.tableData = response.data.list;
this.tableData.forEach((item) => {
item.labels = JSON.parse(item.labels);
if(item.alertRule.buildIn != 1) {
let paramStr = JSON.stringify(this.promQueryParamConvert(item));
this.$get('/prom/api/v1/query?query=' + paramStr.substring(1, paramStr.length - 1).replace(/\+/g, "%2B").replace(/ /g, "%20").replace(/\\/g, "")).then(response2 => {
let current = [];
@@ -504,6 +508,7 @@
this.requestIndex = 0;
}
});
}
});
this.pageObj.total = response.data.total;
this.loading = false;

View File

@@ -348,6 +348,7 @@
this.$nextTick(() => {
this.tableData.forEach((item) => {
item.labels = JSON.parse(item.labels);
if(item.alertRule.buildIn != 1){
let paramStr = JSON.stringify(this.promQueryParamConvert(item));
this.$get('/prom/api/v1/query?query=' + paramStr.substring(1, paramStr.length-1).replace(/\+/g, "%2B").replace(/ /g, "%20").replace(/\\/g, "")).then(response2 => {
let current = [];
@@ -369,6 +370,7 @@
this.requestIndex=0;
}
});
}
});
});
this.deleteBox.ids='';