fix(接口测试): 修复接口定义页面tab页签混乱的问题
--bug=1014063 --user=宋天阳 【接口测试】执行接口定义的时候,接口名称标签显示错位 https://www.tapd.cn/55049933/s/1181853
This commit is contained in:
parent
a2182b3ca2
commit
318af6d00f
|
@ -693,43 +693,22 @@ export default {
|
|||
this.$warning(this.$t('commons.check_project_tip'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (targetName === undefined || targetName === null) {
|
||||
targetName = this.$t('api_test.definition.request.title');
|
||||
}
|
||||
let newTabName = getUUID();
|
||||
let addNewTab = true;
|
||||
if (action === 'SCHEDULE') {
|
||||
//定时同步页面不需要重复新建
|
||||
this.apiTabs.forEach(tab => {
|
||||
if (tab.title === targetName) {
|
||||
addNewTab = false;
|
||||
newTabName = tab.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (addNewTab) {
|
||||
if (targetName === undefined || targetName === null) {
|
||||
targetName = this.$t('api_test.definition.request.title');
|
||||
}
|
||||
this.apiTabs.push({
|
||||
title: targetName,
|
||||
name: newTabName,
|
||||
closable: true,
|
||||
type: action,
|
||||
api: api,
|
||||
isCopy: api ? api.isCopy : false
|
||||
});
|
||||
}
|
||||
this.apiTabs.push({
|
||||
title: targetName,
|
||||
name: newTabName,
|
||||
closable: true,
|
||||
type: action,
|
||||
api: api,
|
||||
isCopy: api ? api.isCopy : false
|
||||
});
|
||||
if (action === "ADD") {
|
||||
this.activeTab = "api";
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.apiDefaultTab = newTabName;
|
||||
if (!addNewTab && action === "SCHEDULE") {
|
||||
//定时任务tab不用重新开启,但是需要更新数据
|
||||
if (this.$refs.apiSchedules) {
|
||||
this.$refs.apiSchedules.searchTaskList();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.apiDefaultTab = newTabName;
|
||||
},
|
||||
debug(id) {
|
||||
this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id);
|
||||
|
|
Loading…
Reference in New Issue