fix(接口测试): 修复接口定义页面tab页签混乱的问题

--bug=1014063 --user=宋天阳 【接口测试】执行接口定义的时候,接口名称标签显示错位
https://www.tapd.cn/55049933/s/1181853
This commit is contained in:
song-tianyang 2022-06-14 18:56:47 +08:00 committed by f2c-ci-robot[bot]
parent edb3a82b01
commit 7875aed28e
1 changed files with 12 additions and 33 deletions

View File

@ -693,43 +693,22 @@ export default {
this.$warning(this.$t('commons.check_project_tip')); this.$warning(this.$t('commons.check_project_tip'));
return; return;
} }
if (targetName === undefined || targetName === null) {
targetName = this.$t('api_test.definition.request.title');
}
let newTabName = getUUID(); let newTabName = getUUID();
let addNewTab = true; this.apiTabs.push({
if (action === 'SCHEDULE') { title: targetName,
// name: newTabName,
this.apiTabs.forEach(tab => { closable: true,
if (tab.title === targetName) { type: action,
addNewTab = false; api: api,
newTabName = tab.name; isCopy: api ? api.isCopy : false
} });
});
}
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
});
}
if (action === "ADD") { if (action === "ADD") {
this.activeTab = "api"; this.activeTab = "api";
} }
this.$nextTick(() => { this.apiDefaultTab = newTabName;
this.apiDefaultTab = newTabName;
if (!addNewTab && action === "SCHEDULE") {
//tab
if (this.$refs.apiSchedules) {
this.$refs.apiSchedules.searchTaskList();
}
}
});
}, },
debug(id) { debug(id) {
this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id); this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id);