chore(统计报表): 修复测试用例统计报表数据展现的问题

--bug=1009196 --user=宋天阳 【报表统计】测试用例统计报表,纵轴要搜索两次才能显示正确
https://www.tapd.cn/55049933/s/1093461
This commit is contained in:
song-tianyang 2022-01-18 16:16:39 +08:00 committed by song-tianyang
parent 7aafc55f7e
commit 5ddd6bbffa
4 changed files with 31 additions and 14 deletions

View File

@ -148,7 +148,7 @@
<dependency>
<groupId>io.metersphere</groupId>
<artifactId>ms-jmeter-core</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</dependency>
<!-- 排除jmeter中的 xstream 解决bug -->

View File

@ -1,5 +1,6 @@
<template>
<chart
v-if="loaded"
:style="{'height': chartHeight, 'width': chartWidth}"
class="ms-chart"
:init-options="defaultInitOptions"
@ -41,6 +42,7 @@ export default {
},
data() {
return {
loaded: true,
defaultInitOptions: this.initOptions
};
},
@ -75,6 +77,12 @@ export default {
onClick(params) {
this.$emit('onClick', params.data);
},
reload() {
this.loaded = false;
this.$nextTick(() => {
this.loaded = true;
})
},
exportCharts(fileName, type) {
if (document.getElementsByClassName('ms-chart')) {
let chartsCanvas = document.getElementsByClassName('ms-chart')[0].querySelectorAll('canvas')[0];

View File

@ -132,6 +132,7 @@ export default {
if (selectTableData) {
this.tableData = selectTableData;
}
this.$refs.analysisChart.setPieOptionAndBarOption(this.loadOption,this.pieOption);
this.loading = false;
this.$refs.analysisChart.generateOption(this.chartType);
},

View File

@ -47,8 +47,6 @@ export default {
name: "TestCaseCountChart",
components: {MsChart},
props: {
loadOption: {},
pieOption: {},
chartWidth: Number,
needFullScreen: Boolean,
readOnly: Boolean,
@ -56,6 +54,8 @@ export default {
data() {
return {
dataOption: {},
loadOption: {},
pieOption: {},
x: 0,
y: 0,
w: document.documentElement.clientWidth - 760,
@ -125,6 +125,14 @@ export default {
});
this.reload();
},
setPieOptionAndBarOption(barOption,pieOption) {
if (barOption) {
this.loadOption = barOption;
}
if (pieOption) {
this.pieOption = pieOption;
}
},
reload() {
this.loading = true
this.$nextTick(() => {