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 264ed54113
commit dd1b99e774
4 changed files with 31 additions and 14 deletions

View File

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

View File

@ -1,16 +1,17 @@
<template> <template>
<chart <chart
:style="{'height': chartHeight, 'width': chartWidth}" v-if="loaded"
class="ms-chart" :style="{'height': chartHeight, 'width': chartWidth}"
:init-options="defaultInitOptions" class="ms-chart"
:option="options" :init-options="defaultInitOptions"
:theme="theme" :option="options"
:group="group" :theme="theme"
@click="onClick" :group="group"
@datazoom="datazoom" @click="onClick"
:watch-shallow="watchShallow" @datazoom="datazoom"
:manual-update="manualUpdate" :watch-shallow="watchShallow"
:autoresize="autoresize" id="chartsShow"/> :manual-update="manualUpdate"
:autoresize="autoresize" id="chartsShow"/>
</template> </template>
<script> <script>
@ -41,6 +42,7 @@ export default {
}, },
data() { data() {
return { return {
loaded: true,
defaultInitOptions: this.initOptions defaultInitOptions: this.initOptions
}; };
}, },
@ -75,6 +77,12 @@ export default {
onClick(params) { onClick(params) {
this.$emit('onClick', params.data); this.$emit('onClick', params.data);
}, },
reload() {
this.loaded = false;
this.$nextTick(() => {
this.loaded = true;
})
},
exportCharts(fileName, type) { exportCharts(fileName, type) {
if (document.getElementsByClassName('ms-chart')) { if (document.getElementsByClassName('ms-chart')) {
let chartsCanvas = document.getElementsByClassName('ms-chart')[0].querySelectorAll('canvas')[0]; let chartsCanvas = document.getElementsByClassName('ms-chart')[0].querySelectorAll('canvas')[0];

View File

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

View File

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