diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
index e2075432d1..b96dbcec64 100644
--- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
+++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
@@ -164,7 +164,7 @@
-
+
-
+
@@ -288,7 +288,7 @@
loading: false,
apiListVisible: false,
customizeVisible: false,
- scenarioVisible: false,
+ isBtnHide: false,
debugVisible: false,
customizeRequest: {protocol: "HTTP", type: "API", hashTree: [], referenced: 'Created', active: false},
operatingElements: [],
@@ -441,6 +441,9 @@
}
},
methods: {
+ setHideBtn() {
+ this.isBtnHide = false;
+ },
// 打开引用的场景
openScenario(data) {
this.$emit('openScenario', data);
@@ -532,6 +535,7 @@
this.scenarioDefinition.push(new LoopController());
break;
case ELEMENT_TYPE.scenario:
+ this.isBtnHide = true;
this.$refs.scenarioRelevance.open();
break;
default:
@@ -559,12 +563,14 @@
}
},
showAll() {
- if (!this.customizeVisible) {
+ // 控制当有弹出页面操作时禁止刷新按钮列表
+ if (!this.customizeVisible && !this.isBtnHide) {
this.operatingElements = ELEMENTS.get("ALL");
this.selectedTreeNode = undefined;
}
},
apiListImport() {
+ this.isBtnHide = true;
this.$refs.scenarioApiRelevance.open();
},
recursiveSorting(arr) {
@@ -631,13 +637,17 @@
item.hashTree = [];
}
item.enable === undefined ? item.enable = true : item.enable;
- this.scenarioDefinition.push(item);
+ if (this.selectedTreeNode != undefined) {
+ this.selectedTreeNode.hashTree.push(item);
+ } else {
+ this.scenarioDefinition.push(item);
+ }
})
}
+ this.isBtnHide = false;
this.sort();
this.reload();
this.initProjectIds();
- this.scenarioVisible = false;
},
setApiParameter(item, refType, referenced) {
let request = {};
@@ -676,6 +686,7 @@
data.forEach(item => {
this.setApiParameter(item, refType, referenced);
});
+ this.isBtnHide = false;
this.sort();
this.reload();
this.initProjectIds();
diff --git a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue
index c27bce8408..1a453d7153 100644
--- a/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue
+++ b/frontend/src/business/components/api/automation/scenario/api/ApiRelevance.vue
@@ -128,6 +128,7 @@ export default {
}
},
close() {
+ this.$emit('close');
this.refresh();
this.$refs.relevanceDialog.close();
},
diff --git a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue
index e73d8b202a..f69e67365f 100644
--- a/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue
+++ b/frontend/src/business/components/api/automation/scenario/api/ScenarioRelevance.vue
@@ -90,8 +90,10 @@
response.data.forEach(item => {
let scenarioDefinition = JSON.parse(item.scenarioDefinition);
if (scenarioDefinition && scenarioDefinition.hashTree) {
- let obj = {id: item.id, name: item.name, type: "scenario", headers: scenarioDefinition.headers, variables: scenarioDefinition.variables, environmentMap: scenarioDefinition.environmentMap,
- referenced: 'Copy', resourceId: getUUID(), hashTree: scenarioDefinition.hashTree, projectId: item.projectId};
+ let obj = {
+ id: item.id, name: item.name, type: "scenario", headers: scenarioDefinition.headers, variables: scenarioDefinition.variables, environmentMap: scenarioDefinition.environmentMap,
+ referenced: 'Copy', resourceId: getUUID(), hashTree: scenarioDefinition.hashTree, projectId: item.projectId
+ };
scenarios.push(obj);
}
});
@@ -101,6 +103,7 @@
})
},
close() {
+ this.$emit('close');
this.refresh();
this.$refs.relevanceDialog.close();
},