fix(接口测试): 部分问题修复

This commit is contained in:
baiqi 2024-07-18 13:33:54 +08:00 committed by 刘瑞斌
parent de0cd9e376
commit b4a3a3d6d7
5 changed files with 22 additions and 5 deletions

View File

@ -391,7 +391,9 @@
]}
>
<MsAvatar is-user size={20} class="!mr-0 w-[20px] hover:!bg-transparent" />
<div class="one-line-text flex-1">{collapsed.value ? null : userStore.name}</div>
<div class="one-line-text flex-1 hover:!bg-transparent">
{collapsed.value ? null : userStore.name}
</div>
</div>
}
{collapsed.value ? null : <icon-caret-down class="!m-0 w-[16px]" />}

View File

@ -86,7 +86,10 @@
</div> -->
</div>
<a-spin v-else :loading="bodyLoading" class="block h-[calc(100%-34px)]">
<div v-if="innerParams.bodyType === RequestBodyFormat.JSON" class="mb-[8px] flex items-center justify-between">
<div
v-if="innerParams.bodyType === RequestBodyFormat.JSON && !props.hideJsonSchema"
class="mb-[8px] flex items-center justify-between"
>
<div class="flex items-center gap-[8px]">
<MsButton
type="text"
@ -145,7 +148,7 @@
:language="currentCodeLanguage"
is-adaptive
>
<template #leftTitle>
<template v-if="!props.hideJsonSchema" #leftTitle>
<a-popconfirm
v-if="
innerParams.bodyType === RequestBodyFormat.JSON && !props.disabledExceptParam && !props.disabledParamValue
@ -157,6 +160,7 @@
size: 'small',
}"
position="bl"
:disabled="getIsVisited()"
@ok="addVisited"
>
<a-button type="text" class="arco-btn-text--primary gap-[4px] p-[2px_6px]" size="small" @click="autoMakeJson">
@ -221,6 +225,8 @@
disabledParamValue?: boolean; //
disabledExceptParam?: boolean; //
isDebug?: boolean; //
hideJsonSchema?: boolean; // json schema
isCase?: boolean; // case
uploadTempFileApi?: (file: File) => Promise<any>; //
fileSaveAsSourceId?: string | number; // id
fileSaveAsApi?: (params: TransferFileParams) => Promise<string>; //
@ -267,6 +273,10 @@
);
watchEffect(() => {
if (props.hideJsonSchema || props.isCase) {
innerParams.value.jsonBody.enableJsonSchema = false;
return;
}
if (
innerParams.value.jsonBody.jsonSchema &&
(!innerParams.value.jsonBody.jsonSchemaTableData || innerParams.value.jsonBody.jsonSchemaTableData.length === 0)

View File

@ -247,6 +247,8 @@
:file-save-as-api="props.fileSaveAsApi"
:file-module-options-api="props.fileModuleOptionsApi"
:is-debug="requestVModel.mode === 'debug'"
:hide-json-schema="props.hideJsonSchema"
:is-case="props.isCase"
@change="handleActiveDebugChange"
/>
<httpQuery
@ -546,6 +548,7 @@
isDefinition?: boolean; //
hideResponseLayoutSwitch?: boolean; //
otherParams?: Record<string, any>; //
hideJsonSchema?: boolean; // json schema
executeApi?: (params: ExecuteRequestParams) => Promise<any>; //
localExecuteApi?: (url: string, params: ExecuteRequestParams) => Promise<any>; //
createApi?: (...args: any) => Promise<any>; //

View File

@ -36,7 +36,7 @@
</MsEditableTab>
</div>
<div class="flex-1 overflow-hidden">
<debug
<requestComposition
v-model:detail-loading="loading"
v-model:request="activeDebug"
:module-tree="folderTree"
@ -49,6 +49,7 @@
:file-save-as-source-id="activeDebug.id"
:file-save-as-api="transferFile"
:file-module-options-api="getTransferOptions"
hide-json-schema
:permission-map="{
execute: 'PROJECT_API_DEBUG:READ+EXECUTE',
update: 'PROJECT_API_DEBUG:READ+UPDATE',
@ -112,7 +113,7 @@
import MsSplitBox from '@/components/pure/ms-split-box/index.vue';
import moduleTree from './components/moduleTree.vue';
import apiMethodName from '@/views/api-test/components/apiMethodName.vue';
import debug, { RequestParam } from '@/views/api-test/components/requestComposition/index.vue';
import requestComposition, { RequestParam } from '@/views/api-test/components/requestComposition/index.vue';
import { localExecuteApiDebug } from '@/api/modules/api-test/common';
import {

View File

@ -161,6 +161,7 @@
:file-save-as-source-id="activeStep?.id"
:file-save-as-api="stepTransferFile"
:file-module-options-api="getTransferOptions"
is-case
@change="handleActiveDebugChange"
/>
<httpQuery