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: { computed: {
overviewEnable() { 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; return !disable;
}, },
summaryEnable() { 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; return !disable;
}, },
functionalEnable() { functionalEnable() {
let disable = this.report.config && this.report.config.functional.enable === false; 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() { apiEnable() {
let disable = this.report.config && this.report.config.api.enable === false; 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() { loadEnable() {
let disable = this.report.config && this.report.config.load.enable === false; 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: { methods: {

View File

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