fix(接口测试): 场景请求步骤另存为新接口弹窗关闭清理激活步骤数据

This commit is contained in:
baiqi 2024-08-19 13:48:14 +08:00 committed by 刘瑞斌
parent 903b5fa378
commit 21ca4c8b3e
2 changed files with 8 additions and 5 deletions

View File

@ -5,6 +5,7 @@
class="ms-modal-form" class="ms-modal-form"
title-align="start" title-align="start"
body-class="!p-0" body-class="!p-0"
@close="emit('close')"
> >
<a-form ref="saveModalFormRef" :model="saveModalForm" layout="vertical"> <a-form ref="saveModalFormRef" :model="saveModalForm" layout="vertical">
<a-form-item <a-form-item
@ -86,6 +87,7 @@
const props = defineProps<{ const props = defineProps<{
detail: RequestParam | ApiDefinitionRequestParam; detail: RequestParam | ApiDefinitionRequestParam;
}>(); }>();
const emit = defineEmits(['close']);
const appStore = useAppStore(); const appStore = useAppStore();
const { t } = useI18n(); const { t } = useI18n();

View File

@ -398,6 +398,7 @@
v-if="tempApiDetail" v-if="tempApiDetail"
v-model:visible="saveNewApiModalVisible" v-model:visible="saveNewApiModalVisible"
:detail="tempApiDetail" :detail="tempApiDetail"
@close="() => (tempApiDetail = undefined)"
></saveAsApiModal> ></saveAsApiModal>
<a-modal <a-modal
v-model:visible="saveCaseModalVisible" v-model:visible="saveCaseModalVisible"
@ -808,6 +809,7 @@
tags: [], tags: [],
}; };
saveCaseModalVisible.value = false; saveCaseModalVisible.value = false;
activeStep.value = undefined;
} }
function saveAsCase(done: (closed: boolean) => void) { function saveAsCase(done: (closed: boolean) => void) {
@ -1012,13 +1014,12 @@
}); });
break; break;
case 'saveAsApi': case 'saveAsApi':
activeStep.value = node as ScenarioStepItem; if (!stepDetails.value[node.id]) {
if (!stepDetails.value[activeStep.value.id]) {
// //
await getStepDetail(activeStep.value); await getStepDetail(node as ScenarioStepItem);
} }
const detail = stepDetails.value[activeStep.value.id] as RequestParam; const detail = stepDetails.value[node.id] as RequestParam;
const fileParams = scenario.value.stepFileParam[activeStep.value.id]; const fileParams = scenario.value.stepFileParam[node.id];
tempApiDetail.value = { tempApiDetail.value = {
...detail, ...detail,
uploadFileIds: fileParams?.uploadFileIds || [], uploadFileIds: fileParams?.uploadFileIds || [],