perf: chart-box内存优化
This commit is contained in:
@@ -188,6 +188,19 @@
|
||||
</el-row>
|
||||
|
||||
<el-row v-if="!isUrl &&!isAlert && editChart.type != 'text'" class="element-item form-row-item" style="" v-for="index of promqlKeys.length" :key="'ele' + index">
|
||||
<promql-input
|
||||
:ref="'promql-'+(index-1)"
|
||||
:id="promqlKeys[index-1]"
|
||||
:key="promqlKeys[index-1]"
|
||||
:expression-list="expressions"
|
||||
:index="index-1"
|
||||
:styleType="2"
|
||||
:plugins="['metric-selector', 'metric-input', 'remove']"
|
||||
@change="expressionChange"
|
||||
@removeExpression="removeExpression"
|
||||
:showRemove="false"
|
||||
></promql-input>
|
||||
<!--
|
||||
<promql-input
|
||||
:ref="'promql-'+(index-1)"
|
||||
:id="promqlKeys[index-1]"
|
||||
@@ -202,6 +215,7 @@
|
||||
@removeExpression="removeExpression"
|
||||
:showRemove="false"
|
||||
></promql-input>
|
||||
-->
|
||||
<el-row>
|
||||
<template v-if="editChart.type != 'singleStat'">
|
||||
<el-col style="width: 120px; padding-right: 20px; text-align: right; color: #666">
|
||||
@@ -447,7 +461,7 @@
|
||||
sortedOptionKeys:[{key:'min',label:'Min'},{key:'max',label:'Max'},{key:'avg',label:'Avg'},{key:'last',label:'Last'},{key:'total',label:'Total'}],
|
||||
textShow:false,
|
||||
metricOptions: [],
|
||||
metricStore: []
|
||||
//metricStore: []
|
||||
}
|
||||
},
|
||||
components:{
|
||||
@@ -1394,13 +1408,13 @@
|
||||
let values=[{label:item,value:item}];
|
||||
metricMap.set(key,values);
|
||||
}
|
||||
this.metricStore.push({label:item,value:item,insertText:item})
|
||||
//this.metricStore.push({label:item,value:item,insertText:item})
|
||||
});
|
||||
for(let key of metricMap.keys()){
|
||||
let option={
|
||||
label:key,
|
||||
value:key,
|
||||
}
|
||||
};
|
||||
if(metricMap.get(key) && metricMap.get(key).length>1){
|
||||
option.children=metricMap.get(key);
|
||||
}
|
||||
@@ -1409,6 +1423,9 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
getMetricOptions() {
|
||||
return this.metricOptions;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSuggestMetric();
|
||||
|
||||
Reference in New Issue
Block a user