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"
>
<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>
<!-- 列表集合 -->
<ms-api-list
@ -422,8 +423,8 @@ export default {
let workspaceId = this.$route.params.workspaceId;
if (workspaceId) {
sessionStorage.setItem(WORKSPACE_ID, workspaceId);
}else {
if(this.$route.query.workspaceId){
} else {
if (this.$route.query.workspaceId) {
workspaceId = this.$route.query.workspaceId;
sessionStorage.setItem(WORKSPACE_ID, workspaceId);
}
@ -431,7 +432,7 @@ export default {
let projectId = this.$route.params.projectId;
if (projectId) {
sessionStorage.setItem(PROJECT_ID, projectId);
}else {
} else {
if (this.$route.query.projectId) {
projectId = this.$route.query.projectId;
sessionStorage.setItem(PROJECT_ID, this.$route.query.projectId);
@ -496,7 +497,7 @@ export default {
},
addTab(tab) {
if (tab.name === 'add') {
this.result = this.$get('/project_application/get/config/' + this.projectId +"/API_QUICK_MENU", res => {
this.result = this.$get('/project_application/get/config/' + this.projectId + "/API_QUICK_MENU", res => {
let projectData = res.data;
if (projectData && projectData.apiQuickMenu === 'api') {
this.handleTabAdd("ADD");
@ -692,22 +693,43 @@ 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();
this.apiTabs.push({
title: targetName,
name: newTabName,
closable: true,
type: action,
api: api,
isCopy: api ? api.isCopy : false
});
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
});
}
if (action === "ADD") {
this.activeTab = "api";
}
this.apiDefaultTab = newTabName;
this.$nextTick(() => {
this.apiDefaultTab = newTabName;
if(!addNewTab && action === "SCHEDULE") {
//tab
if(this.$refs.apiSchedules){
this.$refs.apiSchedules.searchTaskList();
}
}
});
},
debug(id) {
this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id);

View File

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