fix(接口测试): 修复接口调试展示断言和提取tab问题

This commit is contained in:
fit2-zhao 2024-03-15 17:21:33 +08:00 committed by Craftsman
parent 60df9b676a
commit 08d7f02df7
3 changed files with 18 additions and 14 deletions

View File

@ -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 {

View File

@ -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')"
/>
</a-spin>
@ -162,6 +163,7 @@
loading?: boolean;
isEdit?: boolean; //
uploadTempFileApi?: (...args) => Promise<any>; //
isDefinition?: boolean;
}>(),
{
activeLayout: 'vertical',

View File

@ -104,6 +104,7 @@
isPriorityLocalExec: boolean;
requestUrl?: string;
isHttpProtocol: boolean;
isDefinition?: boolean;
}>();
const emit = defineEmits(['execute']);
@ -123,10 +124,8 @@
label: t('apiTestDebug.realRequest'),
value: ResponseComposition.REAL_REQUEST,
},
{
label: t('apiTestDebug.console'),
value: ResponseComposition.CONSOLE,
},
...(props.isDefinition
? [
{
label: t('apiTestDebug.extract'),
value: ResponseComposition.EXTRACT,
@ -135,7 +134,10 @@
label: t('apiTestDebug.assertion'),
value: ResponseComposition.ASSERTION,
},
]
: []),
];
const activeTab = defineModel<ResponseComposition>('activeTab', {
required: true,
default: ResponseComposition.BODY,