fix(接口测试): 修复用例集成报告导出不全问题

--bug=1010401 --user=赵勇 case集合报告 导出不现显示 case https://www.tapd.cn/55049933/s/1105837
This commit is contained in:
fit2-zhao 2022-02-18 17:05:07 +08:00 committed by fit2-zhao
parent 5f3b2a9c11
commit 5fde8c307a
1 changed files with 16 additions and 10 deletions

View File

@ -462,17 +462,23 @@ export default {
},
handleExport() {
if (this.report.reportVersion && this.report.reportVersion > 1) {
this.fullTreeNodes.forEach(item => {
if (item.type === "scenario") {
let scenario = {name: item.label, requestResults: []};
if (this.content.scenarios && this.content.scenarios.length > 0) {
this.content.scenarios.push(scenario);
} else {
this.content.scenarios = [scenario];
if(this.report.reportType === 'API_INTEGRATED'){
let scenario = {name: "", requestResults: []};
this.content.scenarios = [scenario];
this.formatExportApi(this.fullTreeNodes, scenario);
}else {
this.fullTreeNodes.forEach(item => {
if (item.type === "scenario") {
let scenario = {name: item.label, requestResults: []};
if (this.content.scenarios && this.content.scenarios.length > 0) {
this.content.scenarios.push(scenario);
} else {
this.content.scenarios = [scenario];
}
this.formatExportApi(item.children, scenario);
}
this.formatExportApi(item.children, scenario);
}
})
})
}
}
this.reportExportVisible = true;
let reset = this.exportReportReset;