fix(接口自动化): 选中模块创建数据,默认放到当前选择的模块下

This commit is contained in:
fit2-zhao 2021-03-30 15:35:11 +08:00
parent 2a70396bf8
commit 81645d4387
2 changed files with 7 additions and 0 deletions

View File

@ -197,6 +197,10 @@
currentScenario.apiScenarioModuleId = this.nodeTree[0].id; currentScenario.apiScenarioModuleId = this.nodeTree[0].id;
currentScenario.modulePath = this.nodeTree[0].path; currentScenario.modulePath = this.nodeTree[0].path;
} }
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
currentScenario.apiScenarioModuleId = this.selectNodeIds[0];
}
this.tabs.push({label: label, name: name, currentScenario: currentScenario}); this.tabs.push({label: label, name: name, currentScenario: currentScenario});
} }
if (tab.name === 'edit') { if (tab.name === 'edit') {

View File

@ -302,6 +302,9 @@
api.moduleId = this.nodeTree[0].id; api.moduleId = this.nodeTree[0].id;
api.modulePath = this.nodeTree[0].path; api.modulePath = this.nodeTree[0].path;
} }
if (this.selectNodeIds && this.selectNodeIds.length > 0) {
api.moduleId = this.selectNodeIds[0];
}
this.handleTabsEdit(this.$t('api_test.definition.request.title'), e, api); this.handleTabsEdit(this.$t('api_test.definition.request.title'), e, api);
}, },
handleTabClose() { handleTabClose() {