Merge branch 'codeCheck' of https://git.mesalab.cn/nezha/nezha-fronted into codeCheck

This commit is contained in:
chenjinsong
2020-07-01 10:44:20 +08:00

View File

@@ -56,7 +56,7 @@
animation: 150,
handle: '.chart-title'
}" >
<div class="chartBox" v-for="(item, index) in dataList" :key="item.id" :id="'chart-' + item.id" :name="item.title" :class="{'drag-disabled': !draggable}">
<div v-for="(item, index) in dataList" :key="item.id" :id="'chart-' + item.id" :name="item.title" :class="{'drag-disabled': !draggable,'chartBox':true}" v-show="!item.isHide">
<line-chart-block v-if="item.type === 'line' || item.type === 'bar' ||item.type == 'stackArea' || item.type === 4" :key="'inner' + item.id"
:ref="'editChart'+item.id"
@on-refresh-data="refreshChart"
@@ -406,20 +406,25 @@
this.getData(this.filter);
},
searchCharts(searchName){
this.dataList = [];
this.dataTotalList = [];
// this.dataList = [];
// this.dataTotalList = [];
let chartListTmp = [];
if(searchName && searchName.trim()!==''){
this.dataTotalListBak.forEach((item)=>{
if(item.title.indexOf(searchName)>-1){
item.isLoaded = false;
item.isHide=false;
chartListTmp.push(item);
}else{
item.isLoaded = false;
item.isHide=true;
chartListTmp.push(item);
}
});
}else{
this.dataTotalListBak.forEach((item)=>{
item.isLoaded = false;
item.isHide=false;
chartListTmp.push(item);
});
}
@@ -1468,8 +1473,10 @@
setChartSize(item, index) {
this.$nextTick(() => {
let chartBox = document.getElementById("chart-" + item.id);
if(chartBox){
chartBox.style.width = `${(item.span / 12) * 100}%`;
chartBox.style.height = `${item.height}px`;
}
});
},
getNewTime(time, num) {