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

View File

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