From 318af6d00fac546f4b1522b6a6a104202a57d088 Mon Sep 17 00:00:00 2001 From: song-tianyang Date: Tue, 14 Jun 2022 18:56:47 +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=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2tab=E9=A1=B5=E7=AD=BE=E6=B7=B7=E4=B9=B1=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014063 --user=宋天阳 【接口测试】执行接口定义的时候,接口名称标签显示错位 https://www.tapd.cn/55049933/s/1181853 --- .../api/definition/ApiDefinition.vue | 45 +++++-------------- 1 file changed, 12 insertions(+), 33 deletions(-) diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index b0565acb91..62476e356e 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -693,43 +693,22 @@ 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(); - 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 - }); - } + 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.$nextTick(() => { - this.apiDefaultTab = newTabName; - if (!addNewTab && action === "SCHEDULE") { - //定时任务tab不用重新开启,但是需要更新数据 - if (this.$refs.apiSchedules) { - this.$refs.apiSchedules.searchTaskList(); - } - } - }); + this.apiDefaultTab = newTabName; }, debug(id) { this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id);