From 5aeb80e28dedbaf166dab406cb3ea24aed23c27e Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Thu, 9 Jun 2022 13:22:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A6=96=E9=A1=B5=E8=B7=B3=E8=BD=ACswagger?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E5=90=8C=E6=AD=A5=E4=BB=BB=E5=8A=A1=E6=97=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E9=BB=98=E8=AE=A4=E6=89=93=E5=BC=80=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E5=90=8C=E6=AD=A5=E9=A1=B5=E7=AD=BE=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1005166 --user=宋天阳 【接口定义】首页跳转swagger定时同步显示【+github#14476】 https://www.tapd.cn/55049933/s/1177205 --- .../api/definition/ApiDefinition.vue | 56 +++++++++++++------ .../components/import/ApiSchedule.vue | 3 + 2 files changed, 42 insertions(+), 17 deletions(-) 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 8c7714b632..9e3ce3ab6a 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;