fix(接口测试): 修复接口定义页面tab页签混乱的问题
--bug=1014063 --user=宋天阳 【接口测试】执行接口定义的时候,接口名称标签显示错位 https://www.tapd.cn/55049933/s/1181853
This commit is contained in:
parent
edb3a82b01
commit
7875aed28e
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue