fix: 执行场景报告查看一直转圈

This commit is contained in:
chenjianxing 2022-01-12 17:46:39 +08:00 committed by song-tianyang
parent af655d5fa5
commit 7fe7624ab0
2 changed files with 27 additions and 15 deletions

View File

@ -90,24 +90,32 @@ export default {
},
computed: {
overviewEnable() {
let disable = this.report.config && this.report.config.overview.enable === false;
let disable = this.report.config
&& this.report.config.overview && this.report.config.overview.enable === false;
return !disable;
},
summaryEnable() {
let disable = this.report.config && this.report.config.summary.enable === false;
let disable = this.report.config && this.report.config.summary
&& this.report.config.summary.enable === false;
return !disable;
},
functionalEnable() {
let disable = this.report.config && this.report.config.functional.enable === false;
return !disable && this.report.functionResult && this.report.functionResult.caseData.length > 0 ;
return !disable && this.report.functionResult
&& this.report.functionResult.caseData && this.report.functionResult.caseData.length > 0 ;
},
apiEnable() {
let disable = this.report.config && this.report.config.api.enable === false;
return !disable && this.report.apiResult && (this.report.apiResult.apiCaseData.length > 0 || this.report.apiResult.apiScenarioData.length) > 0;
return !disable && this.report.apiResult &&
(
(this.report.apiResult.apiCaseData && this.report.apiResult.apiCaseData.length > 0)
|| (this.report.apiResult.apiScenarioData && this.report.apiResult.apiScenarioData.length > 0)
);
},
loadEnable() {
let disable = this.report.config && this.report.config.load.enable === false;
return !disable && this.report.loadResult && this.report.loadResult.caseData.length > 0;
return !disable && this.report.loadResult
&& this.report.loadResult.caseData && this.report.loadResult.caseData.length > 0;
}
},
methods: {

View File

@ -62,19 +62,23 @@ export default {
methods: {
getCaseCharData() {
let caseCharData = [];
this.apiResult.apiCaseData.forEach(item => {
let data = this.getDataByStatus(item.status);
data.value = item.count;
caseCharData.push(data);
});
if (this.apiResult.apiCaseData) {
this.apiResult.apiCaseData.forEach(item => {
let data = this.getDataByStatus(item.status);
data.value = item.count;
caseCharData.push(data);
});
}
this.caseCharData = caseCharData;
let apiScenarioData = [];
this.apiResult.apiScenarioData.forEach(item => {
let data = this.getDataByStatus(item.status);
data.value = item.count;
apiScenarioData.push(data);
});
if (this.apiResult.apiScenarioData) {
this.apiResult.apiScenarioData.forEach(item => {
let data = this.getDataByStatus(item.status);
data.value = item.count;
apiScenarioData.push(data);
});
}
let stepCharData = [];
for (let i = 0; i < this.apiResult.apiScenarioStepData.length; i++) {