fix(接口测试): 修复首页跳转swagger定时同步任务时没有默认打开定时同步页签的问题

--bug=1005166 --user=宋天阳 【接口定义】首页跳转swagger定时同步显示【+github#14476】
https://www.tapd.cn/55049933/s/1177205
This commit is contained in:
song-tianyang 2022-06-09 13:22:40 +08:00 committed by f2c-ci-robot[bot]
parent f120e85230
commit 35cdf32cef
2 changed files with 42 additions and 17 deletions

View File

@ -44,7 +44,8 @@
right-content="CASE" right-content="CASE"
> >
<template v-slot:version> <template v-slot:version>
<version-select v-xpack :project-id="projectId" :version-id="trashVersion" @changeVersion="changeVersion"/> <version-select v-xpack :project-id="projectId" :version-id="trashVersion"
@changeVersion="changeVersion"/>
</template> </template>
<!-- 列表集合 --> <!-- 列表集合 -->
<ms-api-list <ms-api-list
@ -692,10 +693,22 @@ export default {
this.$warning(this.$t('commons.check_project_tip')); this.$warning(this.$t('commons.check_project_tip'));
return; return;
} }
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) { if (targetName === undefined || targetName === null) {
targetName = this.$t('api_test.definition.request.title'); targetName = this.$t('api_test.definition.request.title');
} }
let newTabName = getUUID();
this.apiTabs.push({ this.apiTabs.push({
title: targetName, title: targetName,
name: newTabName, name: newTabName,
@ -704,10 +717,19 @@ export default {
api: api, api: api,
isCopy: api ? api.isCopy : false 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);

View File

@ -335,6 +335,9 @@ export default {
this.clear(); this.clear();
}); });
}, },
searchTaskList(){
this.$refs.taskList.search();
},
intervalValidate() { intervalValidate() {
if (this.getIntervalTime() < 1 * 60 * 1000) { if (this.getIntervalTime() < 1 * 60 * 1000) {
return false; return false;