fix(接口测试): 修复场景导入未显示选中模块的缺陷

--bug=1028207 --user=王孝刚 【接口测试】接口定义和接口场景-选中模块-点击导入-模块未显示导入模块
https://www.tapd.cn/55049933/s/1399377
This commit is contained in:
wxg0103 2023-07-31 16:51:12 +08:00 committed by 刘瑞斌
parent 45b2ccf813
commit 1ed447e5c1
2 changed files with 10 additions and 10 deletions

View File

@ -173,17 +173,11 @@ export default {
}, },
methods: { methods: {
handleImport() { handleImport() {
if (this.projectId) { if (!this.projectId) {
this.result = getModuleByProjectId(this.projectId).then((response) => { this.$warning(this.$t('commons.check_project_tip'));
if (response.data != undefined && response.data != null) { return;
this.data = response.data;
this.data.forEach((node) => {
buildTree(node, { path: '' });
});
}
});
this.$refs.apiImport.open(this.currentModule);
} }
this.$refs.apiImport.open(this.currentModule);
}, },
filter() { filter() {
this.$refs.nodeTree.filter(this.condition.filterText); this.$refs.nodeTree.filter(this.condition.filterText);

View File

@ -257,6 +257,12 @@ export default {
if (localStorage.getItem('scenarioModule')) { if (localStorage.getItem('scenarioModule')) {
this.formData.moduleId = localStorage.getItem('scenarioModule'); this.formData.moduleId = localStorage.getItem('scenarioModule');
} }
if (module) {
this.formData.moduleId = module.id;
}
if (!module && !localStorage.getItem('scenarioModule')) {
this.formData.moduleId = this.moduleOptions[0].id;
}
this.visible = true; this.visible = true;
listenGoBack(this.close); listenGoBack(this.close);
}, },