fix(接口测试): 场景请求步骤另存为新接口修复

This commit is contained in:
baiqi 2024-08-19 11:40:18 +08:00 committed by 刘瑞斌
parent b6d56982c4
commit 12a9508283
2 changed files with 79 additions and 68 deletions

View File

@ -148,7 +148,6 @@
/** /**
* 保存请求 * 保存请求
* @param isSaveCase 是否需要保存用例
*/ */
async function realSaveAsApi() { async function realSaveAsApi() {
try { try {

View File

@ -903,9 +903,11 @@
} }
} }
function handleStepMoreActionSelect(item: ActionsItem, node: MsTreeNodeData) { /**
switch (item.eventTag) { * 复制步骤
case 'copy': * @param node 复制的节点
*/
function copyStep(node: MsTreeNodeData) {
const id = getGenerateId(); const id = getGenerateId();
const stepDetail = stepDetails.value[node.id]; const stepDetail = stepDetails.value[node.id];
const stepFileParam = scenario.value.stepFileParam[node.id]; const stepFileParam = scenario.value.stepFileParam[node.id];
@ -972,6 +974,12 @@
'uniqueId' 'uniqueId'
); );
scenario.value.unSaved = true; scenario.value.unSaved = true;
}
async function handleStepMoreActionSelect(item: ActionsItem, node: MsTreeNodeData) {
switch (item.eventTag) {
case 'copy':
copyStep(node);
break; break;
case 'config': case 'config':
activeStep.value = node as ScenarioStepItem; activeStep.value = node as ScenarioStepItem;
@ -1005,6 +1013,10 @@
break; break;
case 'saveAsApi': case 'saveAsApi':
activeStep.value = node as ScenarioStepItem; activeStep.value = node as ScenarioStepItem;
if (!stepDetails.value[activeStep.value.id]) {
//
await getStepDetail(activeStep.value);
}
const detail = stepDetails.value[activeStep.value.id] as RequestParam; const detail = stepDetails.value[activeStep.value.id] as RequestParam;
const fileParams = scenario.value.stepFileParam[activeStep.value.id]; const fileParams = scenario.value.stepFileParam[activeStep.value.id];
tempApiDetail.value = { tempApiDetail.value = {