fix(接口定义): 修复选中模块后用更多操作创建接口没显示选中模块的缺陷

--bug=1018300 --user=王孝刚 【接口测试】接口定义,选中模块后用更多操作创建接口,没有显示选中的模块
https://www.tapd.cn/55049933/s/1265461
This commit is contained in:
wxg0103 2022-10-18 10:46:15 +08:00 committed by wxg0103
parent 7b5abfe4b3
commit aeac71a617
2 changed files with 8 additions and 4 deletions

View File

@ -153,8 +153,10 @@ export default {
open(currentModule) {
this.scenarioForm = {principal: getCurrentUser().id};
this.currentModule = currentModule;
if (this.scenarioForm.apiScenarioModuleId === undefined) {
if (this.scenarioForm.apiScenarioModuleId === undefined && !currentModule.id) {
this.scenarioForm.apiScenarioModuleId = this.moduleOptions[0].id;
} else if (currentModule.id) {
this.scenarioForm.apiScenarioModuleId = currentModule.id;
}
this.getMaintainerOptions();
this.visible = true;

View File

@ -217,10 +217,12 @@ export default {
},
open(currentModule) {
this.httpForm = {method: REQ_METHOD[0].id, userId: getCurrentUser().id};
if (this.httpForm.moduleId === undefined) {
this.httpForm.moduleId = this.moduleOptions[0].id;
}
this.currentModule = currentModule;
if (this.httpForm.moduleId === undefined && !currentModule.id) {
this.httpForm.moduleId = this.moduleOptions[0].id;
} else if (currentModule.id) {
this.httpForm.moduleId = currentModule.id;
}
this.getMaintainerOptions();
this.httpVisible = true;
},