From 08d7f02df706b53a703924617851d01c398368dd Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 15 Mar 2024 17:21:33 +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=E8=B0=83=E8=AF=95=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=96=AD=E8=A8=80=E5=92=8C=E6=8F=90=E5=8F=96tab?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/requestComposition/index.vue | 4 +-- .../requestComposition/response/index.vue | 2 ++ .../requestComposition/response/result.vue | 26 ++++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/frontend/src/views/api-test/components/requestComposition/index.vue b/frontend/src/views/api-test/components/requestComposition/index.vue index 2a23299ee5..89bed44dab 100644 --- a/frontend/src/views/api-test/components/requestComposition/index.vue +++ b/frontend/src/views/api-test/components/requestComposition/index.vue @@ -277,6 +277,7 @@ :is-edit="props.isDefinition && isHttpProtocol" :upload-temp-file-api="props.uploadTempFileApi" :loading="requestVModel.executeLoading || loading" + :is-definition="props.isDefinition" @change-expand="changeVerticalExpand" @change-layout="handleActiveLayoutChange" @change="handleActiveDebugChange" @@ -534,7 +535,6 @@ RequestConditionProcessor, RequestDefinitionStatus, RequestMethods, - RequestParamsType, } from '@/enums/apiEnum'; import type { ResponseItem } from './response/edit.vue'; @@ -1295,7 +1295,7 @@ * 保存快捷键处理 */ async function handleSaveShortcut() { - if (isHttpProtocol && !requestVModel.value.url) { + if (isHttpProtocol.value && !requestVModel.value.url) { return; } try { diff --git a/frontend/src/views/api-test/components/requestComposition/response/index.vue b/frontend/src/views/api-test/components/requestComposition/response/index.vue index db6c1fb128..dfe26dfabc 100644 --- a/frontend/src/views/api-test/components/requestComposition/response/index.vue +++ b/frontend/src/views/api-test/components/requestComposition/response/index.vue @@ -130,6 +130,7 @@ :is-http-protocol="props.isHttpProtocol" :is-priority-local-exec="props.isPriorityLocalExec" :request-url="props.requestUrl" + :is-definition="props.isDefinition" @execute="emit('execute', props.isPriorityLocalExec ? 'localExec' : 'serverExec')" /> @@ -162,6 +163,7 @@ loading?: boolean; isEdit?: boolean; // 是否可编辑 uploadTempFileApi?: (...args) => Promise; // 上传临时文件接口 + isDefinition?: boolean; }>(), { activeLayout: 'vertical', diff --git a/frontend/src/views/api-test/components/requestComposition/response/result.vue b/frontend/src/views/api-test/components/requestComposition/response/result.vue index 4184801ecd..0386209007 100644 --- a/frontend/src/views/api-test/components/requestComposition/response/result.vue +++ b/frontend/src/views/api-test/components/requestComposition/response/result.vue @@ -104,6 +104,7 @@ isPriorityLocalExec: boolean; requestUrl?: string; isHttpProtocol: boolean; + isDefinition?: boolean; }>(); const emit = defineEmits(['execute']); @@ -123,19 +124,20 @@ label: t('apiTestDebug.realRequest'), value: ResponseComposition.REAL_REQUEST, }, - { - label: t('apiTestDebug.console'), - value: ResponseComposition.CONSOLE, - }, - { - label: t('apiTestDebug.extract'), - value: ResponseComposition.EXTRACT, - }, - { - label: t('apiTestDebug.assertion'), - value: ResponseComposition.ASSERTION, - }, + ...(props.isDefinition + ? [ + { + label: t('apiTestDebug.extract'), + value: ResponseComposition.EXTRACT, + }, + { + label: t('apiTestDebug.assertion'), + value: ResponseComposition.ASSERTION, + }, + ] + : []), ]; + const activeTab = defineModel('activeTab', { required: true, default: ResponseComposition.BODY,