From 3806dcf20b385444227aae77eb85dacaac99343c Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 14 Jun 2022 13:22:30 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20TC?= =?UTF-8?q?P=E3=80=81SQL=E3=80=81DUBBO=E6=8E=A5=E5=8F=A3=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=AF=BC=E5=87=BAswagger=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --user=郭雨琦 --bug=1014048 TCP、SQL、DUBBO接口导出swagger格式报错 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001014048 --- .../components/module/ApiModuleHeader.vue | 61 ++++++++++++++++++- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue index 0f845d0776..dc650cffe6 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModuleHeader.vue @@ -46,7 +46,7 @@ export default { components: {MsSearchBar, TemplateComponent, ModuleTrashButton, ApiImport, MsAddBasisApi}, data() { return { - operators: [ + httpOperators: [ { label: this.$t('api_test.definition.request.title'), callback: this.addApi, @@ -97,8 +97,51 @@ export default { } } ] - } - ] + }, + ], + operators: [], + otherOperators: [ + { + label: this.$t('api_test.definition.request.title'), + callback: this.addApi, + permissions: ['PROJECT_API_DEFINITION:READ+CREATE_API'] + }, + { + label: this.$t('api_test.definition.request.fast_debug'), + callback: () => { + this.$emit('debug'); + }, + permissions: ['PROJECT_API_DEFINITION:READ+DEBUG'] + }, + { + label: this.$t('api_test.api_import.timing_synchronization'), + callback: () => { + this.$emit('schedule'); + }, + permissions: ['PROJECT_API_DEFINITION:READ+TIMING_SYNC'] + }, + { + label: this.$t('api_test.api_import.label'), + callback: this.handleImport, + permissions: ['PROJECT_API_DEFINITION:READ+IMPORT_API'] + }, + { + label: this.$t('report.export'), + children: [ + { + label: this.$t('report.export_to_ms_format'), + permissions: ['PROJECT_API_DEFINITION:READ+EXPORT_API'], + callback: () => { + if (!this.projectId) { + this.$warning(this.$t('commons.check_project_tip')); + return; + } + this.$emit('exportAPI', 'MS'); + } + } + ] + }, + ], }; }, props: { @@ -135,6 +178,18 @@ export default { return getCurrentProjectID(); }, }, + watch: { + 'condition.protocol'() { + if (this.condition.protocol === 'HTTP') { + this.operators = this.httpOperators; + } else { + this.operators = this.otherOperators; + } + } + }, + created() { + this.operators = this.httpOperators; + }, methods: { handleImport() { if (!this.projectId) {