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() {
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 stepDetail = stepDetails.value[node.id];
const stepFileParam = scenario.value.stepFileParam[node.id];
@ -972,6 +974,12 @@
'uniqueId'
);
scenario.value.unSaved = true;
}
async function handleStepMoreActionSelect(item: ActionsItem, node: MsTreeNodeData) {
switch (item.eventTag) {
case 'copy':
copyStep(node);
break;
case 'config':
activeStep.value = node as ScenarioStepItem;
@ -1005,6 +1013,10 @@
break;
case 'saveAsApi':
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 fileParams = scenario.value.stepFileParam[activeStep.value.id];
tempApiDetail.value = {