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

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

View File

@ -234,13 +234,7 @@ export default {
},
methods: {
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) {
@ -248,11 +242,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) {