refactor(接口测试): 优化场景报告异步加载机制

优化测试报告异步加载机制,判断接口报告数据结构来确定是否需要异步查询内容信息
This commit is contained in:
song-tianyang 2022-05-26 18:07:03 +08:00 committed by fit2-zhao
parent db9197ee14
commit 37065f8b4f
1 changed files with 5 additions and 9 deletions

View File

@ -260,13 +260,7 @@ export default {
element.parentNode.removeChild(element);
},
loadRequestInfoExpand() {
if (!this.requestInfo.hasData) {
if (this.request.responseResult && this.request.responseResult.body) {
this.requestInfo = this.request;
this.requestInfo.hasData = true;
}
}
if (!this.requestInfo.hasData) {
if(!this.request.responseResult || !this.request.responseResult.body){
this.$get("/api/scenario/report/selectReportContent/" + this.stepId, response => {
let requestResult = response.data;
if (requestResult) {
@ -274,11 +268,13 @@ export default {
}
this.$nextTick(() => {
this.requestInfo.loading = false;
this.requestInfo.hasData = true;
});
});
}else {
if (this.request.responseResult && this.request.responseResult.body) {
this.requestInfo = this.request;
}
}
},
active() {
if (this.request.unexecute) {