fix(接口测试): 场景部分 bug 修复

This commit is contained in:
baiqi 2024-05-28 16:13:57 +08:00 committed by 刘瑞斌
parent 60650c7958
commit 718ec6c03e
2 changed files with 26 additions and 21 deletions

View File

@ -1117,6 +1117,7 @@
return; return;
} }
emit('addStep', cloneDeep(makeRequestParams()) as RequestParam); emit('addStep', cloneDeep(makeRequestParams()) as RequestParam);
requestVModel.value.stepId = getGenerateId(); // id
} }
function handleSave() { function handleSave() {

View File

@ -1234,30 +1234,34 @@
scenario.value.unSaved = true; scenario.value.unSaved = true;
} }
if (activeStep.value) { if (activeStep.value) {
const _stepType = getStepType(activeStep.value); const realStep = findNodeByKey<ScenarioStepItem>(steps.value, activeStep.value.uniqueId, 'uniqueId');
if (_stepType.isQuoteCase && !activeStep.value.isQuoteScenarioStep) { if (realStep) {
activeStep.value.name = request.stepName || request.name; const _stepType = getStepType(realStep as ScenarioStepItem);
stepDetails.value[activeStep.value.id] = request; // polymorphicName if (_stepType.isQuoteCase && !realStep.isQuoteScenarioStep) {
realStep.name = request.stepName || request.name;
stepDetails.value[realStep.id] = request; // polymorphicName
return; return;
} }
} }
if (activeStep.value && !activeStep.value.isQuoteScenarioStep) { if (realStep && !realStep.isQuoteScenarioStep) {
request.isNew = false; request.isNew = false;
stepDetails.value[activeStep.value.id] = request; stepDetails.value[realStep.id] = request;
scenario.value.stepFileParam[activeStep.value?.id] = { scenario.value.stepFileParam[realStep?.id] = {
linkFileIds: request.linkFileIds, linkFileIds: request.linkFileIds,
uploadFileIds: request.uploadFileIds, uploadFileIds: request.uploadFileIds,
deleteFileIds: request.deleteFileIds, deleteFileIds: request.deleteFileIds,
unLinkFileIds: request.unLinkFileIds, unLinkFileIds: request.unLinkFileIds,
}; };
activeStep.value.config = { realStep.config = {
...activeStep.value.config, ...realStep.config,
method: request.method, method: request.method,
}; };
realStep.name = request.stepName || request.name;
emit('updateResource', request.uploadFileIds, request.linkFileIds); emit('updateResource', request.uploadFileIds, request.linkFileIds);
} }
activeStep.value = undefined; activeStep.value = undefined;
} }
}
/** /**
* 添加脚本操作步骤 * 添加脚本操作步骤