fix(接口管理): 修复点击用例列表id详情也会执行问题

--bug=1037856 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001037856
This commit is contained in:
guoyuqi 2024-03-27 19:10:58 +08:00 committed by Craftsman
parent 12fd168029
commit 55c51401fd
2 changed files with 11 additions and 1 deletions

View File

@ -912,6 +912,7 @@
}
async function openCaseDetailDrawer(id: string) {
await getCaseDetailInfo(id);
caseExecute.value = false;
caseDetailDrawerVisible.value = true;
}

View File

@ -102,6 +102,7 @@
}
async function openCaseTab(apiInfo: ApiCaseDetail | string) {
caseExecute.value = false;
const isLoadedTabIndex = apiTabs.value.findIndex(
(e) => e.id === (typeof apiInfo === 'string' ? apiInfo : apiInfo.id)
);
@ -115,7 +116,15 @@
async function openCaseTabAndExecute(apiInfo: ApiCaseDetail | string) {
caseExecute.value = true;
await openCaseTab(apiInfo);
const isLoadedTabIndex = apiTabs.value.findIndex(
(e) => e.id === (typeof apiInfo === 'string' ? apiInfo : apiInfo.id)
);
if (isLoadedTabIndex > -1) {
// tabtab
activeApiTab.value = apiTabs.value[isLoadedTabIndex] as RequestParam;
return;
}
await openOrUpdateCaseTab(true, typeof apiInfo === 'string' ? apiInfo : apiInfo.id);
}
const caseTableRef = ref<InstanceType<typeof caseTable>>();