diff --git a/frontend/src/views/api-test/components/saveAsApiModal.vue b/frontend/src/views/api-test/components/saveAsApiModal.vue index 8dc78d2c59..cbdac9cc81 100644 --- a/frontend/src/views/api-test/components/saveAsApiModal.vue +++ b/frontend/src/views/api-test/components/saveAsApiModal.vue @@ -5,6 +5,7 @@ class="ms-modal-form" title-align="start" body-class="!p-0" + @close="emit('close')" > (); + const emit = defineEmits(['close']); const appStore = useAppStore(); const { t } = useI18n(); diff --git a/frontend/src/views/api-test/scenario/components/step/stepTree.vue b/frontend/src/views/api-test/scenario/components/step/stepTree.vue index 9c43f5799b..04d4f78ae8 100644 --- a/frontend/src/views/api-test/scenario/components/step/stepTree.vue +++ b/frontend/src/views/api-test/scenario/components/step/stepTree.vue @@ -398,6 +398,7 @@ v-if="tempApiDetail" v-model:visible="saveNewApiModalVisible" :detail="tempApiDetail" + @close="() => (tempApiDetail = undefined)" > 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 || [],