fix(接口测试): 修复idea导入接口点击编辑模块信息缺失问题

https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001018293
--user=郭雨琦
This commit is contained in:
guoyuqi 2022-10-24 17:46:47 +08:00 committed by xiaomeinvG
parent fee74cc65d
commit f347fa3718
1 changed files with 9 additions and 13 deletions

View File

@ -815,20 +815,16 @@ export default {
}
},
editApiModule(row) {
if (this.moduleOptions && this.moduleOptions.length === 0) {
getApiModuleByProjectIdAndProtocol(row.projectId, row.protocol).then(response => {
if (response.data) {
response.data.forEach(node => {
node.name = node.name === '未规划接口' ? this.$t('api_test.definition.unplanned_api') : node.name
buildTree(node, {path: ''});
});
this.moduleOptions = response.data;
}
this.editApi(row);
});
} else {
getApiModuleByProjectIdAndProtocol(row.projectId, row.protocol).then(response => {
if (response.data) {
response.data.forEach(node => {
node.name = node.name === '未规划接口' ? this.$t('api_test.definition.unplanned_api') : node.name
buildTree(node, {path: ''});
});
this.moduleOptions = response.data;
}
this.editApi(row);
}
});
},
editApi(row) {
const index = this.apiTabs.find(p => p.api && p.api.id === row.id);