diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 487cec1266..42e1e6da5e 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -44,7 +44,8 @@ right-content="CASE" > { + 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); diff --git a/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue b/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue index ea00500c69..7b18e8c00f 100644 --- a/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue +++ b/frontend/src/business/components/api/definition/components/import/ApiSchedule.vue @@ -335,6 +335,9 @@ export default { this.clear(); }); }, + searchTaskList(){ + this.$refs.taskList.search(); + }, intervalValidate() { if (this.getIntervalTime() < 1 * 60 * 1000) { return false;