fix(接口测试): 接口定义-修复切换TCP协议后新建页面初始化有问题的缺陷

--bug=1042371 --user=吕梦园
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001042371
This commit is contained in:
teukkk 2024-06-18 11:30:15 +08:00 committed by Craftsman
parent b4619c882b
commit 4cf9878306
1 changed files with 5 additions and 24 deletions

View File

@ -629,19 +629,6 @@
label: t('apiTestDebug.setting'),
},
];
const restNumApi = computed(
() =>
filterKeyValParams(props.apiDetail?.rest ?? props.apiDetail?.request.rest, defaultRequestParamsItem).validParams
.length
);
const queryNumApi = computed(
() =>
filterKeyValParams(props.apiDetail?.query ?? props.apiDetail?.request.query, defaultRequestParamsItem).validParams
.length
);
const bodyTabBadgeApi = computed(() =>
props.apiDetail?.request?.body?.bodyType !== RequestBodyFormat.NONE ? '1' : ''
);
// tab
const contentTabList = computed(() => {
// HTTP tabs
@ -1192,18 +1179,12 @@
await initProtocolList();
}
await initPluginScript();
} else if (protocolOptions.value.length === 0) {
await initProtocolList();
} else {
setDefaultActiveTab();
if (protocolOptions.value.length === 0) {
await initProtocolList();
}
}
if (
props.isCase &&
requestVModel.value.protocol === 'HTTP' &&
(restNumApi.value || queryNumApi.value || bodyTabBadgeApi.value?.length)
) {
// BODY/QUERY/RESTtabtab
requestVModel.value.activeTab = contentTabList.value[1].value;
}
setDefaultActiveTab();
if (!props.isCase) {
responseRef.value?.setActiveResponse(requestVModel.value.mode === 'debug' ? 'result' : 'content');
}