refactor(接口测试): 接口请求参数Tab默认显示优化

--bug=1013867 --user=赵勇 接口定义-请求参数这里没显示出有参数的tab https://www.tapd.cn/55049933/s/1176103
This commit is contained in:
fit2-zhao 2022-06-08 13:33:41 +08:00 committed by f2c-ci-robot[bot]
parent e3bdb0371e
commit 845301f6d1
1 changed files with 17 additions and 13 deletions

View File

@ -280,19 +280,7 @@ export default {
},
watch: {
'request.changeId'() {
if (this.request.headers && this.request.headers.length > 1) {
this.activeName = 'headers';
}
if (this.request.rest && this.request.rest.length > 1) {
this.activeName = 'rest';
}
if (this.request.arguments && this.request.arguments.length > 1) {
this.activeName = 'parameters';
}
if (this.request.body) {
this.request.body.typeChange = this.request.changeId;
}
this.reload();
this.changeActiveName();
},
'request.hashTree': {
handler(v) {
@ -311,6 +299,21 @@ export default {
});
});
},
changeActiveName() {
if (this.request.headers && this.request.headers.length > 1) {
this.activeName = 'headers';
}
if (this.request.rest && this.request.rest.length > 1) {
this.activeName = 'rest';
}
if (this.request.arguments && this.request.arguments.length > 1) {
this.activeName = 'parameters';
}
if (this.request.body) {
this.request.body.typeChange = this.request.changeId;
}
this.reload();
},
filter(activeName) {
if (activeName === 'preOperate' && this.$refs.preStep) {
this.$refs.preStep.filter();
@ -379,6 +382,7 @@ export default {
this.initStepSize(this.request.hashTree);
this.historicalDataProcessing(this.request.hashTree);
}
this.changeActiveName();
},
historicalDataProcessing(array) {
hisDataProcessing(array, this.request);