fix(接口测试): 部分问题修复
This commit is contained in:
parent
de0cd9e376
commit
b4a3a3d6d7
|
@ -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]" />}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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>; // 创建接口
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue