fix: 修复性能测试自定义监控显示图缓存bug

This commit is contained in:
CaptainB 2021-10-27 14:33:51 +08:00 committed by 刘瑞斌
parent 1fcdf2cd95
commit 646d0d23ea
1 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,8 @@
<el-col :span="20"> <el-col :span="20">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<ms-chart ref="chart2" class="chart-config" @datazoom="changeDataZoom" :options="totalOption" <ms-chart v-if="showChart" ref="chart2" class="chart-config" @datazoom="changeDataZoom"
:options="totalOption"
:autoresize="true"></ms-chart> :autoresize="true"></ms-chart>
</el-col> </el-col>
</el-row> </el-row>
@ -123,6 +124,7 @@ export default {
tableData: [], tableData: [],
checkList: checkList, checkList: checkList,
checkOptions: checkOptions, checkOptions: checkOptions,
showChart: true,
baseOption: { baseOption: {
color: color, color: color,
grid: { grid: {
@ -236,14 +238,18 @@ export default {
this.checkList = checkList; this.checkList = checkList;
} }
this.totalOption = {}; this.totalOption = {};
this.showChart = false;
this.$nextTick(() => { this.$nextTick(() => {
this.showChart = true;
this.totalOption = this.getOption(id); this.totalOption = this.getOption(id);
this.changeDataZoom({start: 0, end: 100}); this.changeDataZoom({start: 0, end: 100});
}); });
}, },
handleCheckListChange(id) { handleCheckListChange(id) {
this.totalOption = {}; this.totalOption = {};
this.showChart = false;
this.$nextTick(() => { this.$nextTick(() => {
this.showChart = true;
this.totalOption = this.getOption(id); this.totalOption = this.getOption(id);
this.changeDataZoom({start: 0, end: 100}); this.changeDataZoom({start: 0, end: 100});
}); });