diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
index 61cb5ea460..b807c61f46 100644
--- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
+++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
@@ -126,7 +126,7 @@
{{$t('api_test.request.debug')}}
-
+
@@ -134,13 +134,19 @@
+
+ {{$t('api_test.automation.open_expansion')}}
+
+
+ {{$t('api_test.automation.close_expansion')}}
+
+ :allow-drop="allowDrop" @node-drag-end="allowDrag" @node-click="nodeClick" v-if="!loading" draggable ref="stepTree">
1) {
arr[i].countController.proceed = true;
}
@@ -623,6 +631,7 @@
for (let i in this.scenarioDefinition) {
// 排序
this.scenarioDefinition[i].index = Number(i) + 1;
+ this.scenarioDefinition[i].active = this.expandedStatus;
// 设置循环控制
if (this.scenarioDefinition[i].type === ELEMENT_TYPE.LoopController && this.scenarioDefinition[i].hashTree
&& this.scenarioDefinition[i].hashTree.length > 1) {
@@ -1149,6 +1158,44 @@
this.getEnv(JSON.stringify(definition)).then(() => {
this.$refs.envPopover.openEnvSelect();
})
+ },
+ shrinkTreeNode() {
+ //改变每个节点的状态
+ for (let i in this.scenarioDefinition) {
+ if (this.scenarioDefinition[i]) {
+ if (this.expandedStatus) {
+ this.expandedNode.push(this.scenarioDefinition[i].resourceId);
+ }
+ this.scenarioDefinition[i].active = this.expandedStatus;
+ if (this.scenarioDefinition[i].hashTree && this.scenarioDefinition[i].hashTree.length > 0) {
+ this.changeNodeStatus(this.scenarioDefinition[i].hashTree);
+ }
+ }
+ }
+ },
+ changeNodeStatus(nodes) {
+ for (let i in nodes) {
+ if (nodes[i]) {
+ if (this.expandedStatus) {
+ this.expandedNode.push(nodes[i].resourceId);
+ }
+ nodes[i].active = this.expandedStatus;
+ if (nodes[i].hashTree != undefined && nodes[i].hashTree.length > 0) {
+ this.changeNodeStatus(nodes[i].hashTree);
+ }
+ }
+ }
+ },
+ openExpansion() {
+ this.expandedNode = [];
+ this.expandedStatus = true;
+ this.shrinkTreeNode();
+ },
+ closeExpansion() {
+ this.expandedStatus = false;
+ this.expandedNode = [];
+ this.shrinkTreeNode();
+ this.reload();
}
}
}
@@ -1309,4 +1356,12 @@
white-space: nowrap;
width: 200px;
}
+
+ .ms-open-btn {
+ margin: 5px 5px 0px;
+ }
+
+ .ms-open-btn-left {
+ margin-left: 30px;
+ }
diff --git a/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue b/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue
index bd670d739f..ecbad6aeb2 100644
--- a/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue
+++ b/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue
@@ -2,9 +2,15 @@
-
+
+
+ {{$t('api_test.automation.open_expansion')}}
+
+
+ {{$t('api_test.automation.close_expansion')}}
+
0) {
+ this.changeNodeStatus(this.scenarioDefinition[i].hashTree);
+ }
+ }
+ }
+ },
+ changeNodeStatus(nodes) {
+ for (let i in nodes) {
+ if (nodes[i]) {
+ if (this.expandedStatus) {
+ this.expandedNode.push(nodes[i].resourceId);
+ }
+ nodes[i].active = this.expandedStatus;
+ if (nodes[i].hashTree != undefined && nodes[i].hashTree.length > 0) {
+ this.changeNodeStatus(nodes[i].hashTree);
+ }
+ }
+ }
+ },
+ openExpansion() {
+ this.expandedNode = [];
+ this.expandedStatus = true;
+ this.shrinkTreeNode();
+ },
+ closeExpansion() {
+ this.expandedStatus = false;
+ this.expandedNode = [];
+ this.shrinkTreeNode();
+ this.reload();
}
}
}
@@ -1111,4 +1156,12 @@
.father:hover .child {
display: block;
}
+
+ .ms-open-btn {
+ margin: 5px 5px 0px;
+ }
+
+ .ms-open-btn-left {
+ margin-left: 30px;
+ }
diff --git a/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue b/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue
index 3c22c4b94f..2df2c071e5 100644
--- a/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue
+++ b/frontend/src/business/components/api/test/components/ApiEnvironmentConfig.vue
@@ -6,7 +6,7 @@
-
+
diff --git a/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue b/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue
index f603d6ed76..5cd4902689 100644
--- a/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue
+++ b/frontend/src/business/components/api/test/components/environment/EnvironmentEdit.vue
@@ -15,7 +15,7 @@
-
+
@@ -52,9 +52,11 @@
MsTcpConfig,
MsEnvironmentCommonConfig,
MsEnvironmentHttpConfig,
- MsDatabaseConfig, MsApiHostTable, MsDialogFooter, MsApiKeyValue, MsApiScenarioVariables},
+ MsDatabaseConfig, MsApiHostTable, MsDialogFooter, MsApiKeyValue, MsApiScenarioVariables
+ },
props: {
environment: new Environment(),
+ projectId: String,
},
data() {
diff --git a/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue b/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue
index 00f39b75e2..0500c7db5e 100644
--- a/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue
+++ b/frontend/src/business/components/api/test/components/environment/EnvironmentHttpConfig.vue
@@ -1,80 +1,238 @@
-
- {{$t('api_test.environment.socket')}}
-
-
+
+
+ {{$t('api_test.environment.socket')}}
+
+
+
+
+
+
+
+
+
+
+ {{$t('api_test.environment.condition_enable')}}
+
+ {{ $t('api_test.definition.document.data_set.none') }}
+ {{$t('test_track.module.module')}}
+ {{$t('api_test.definition.api_path')}}
+
+ {{$t('commons.add')}}
+
+
+
+
+
-
-
-
+
+
+
-
-
- {{$t('api_test.request.headers')}}
-
-
+
+
+
+
+
+
+
+
+ {{getName(row)}}
+
+
+
+
+ {{getDetails(row)}}
+
+
+
+
+
+
+
+
+
+
+ {{$t('api_test.request.headers')}}
+
+
diff --git a/frontend/src/business/components/api/test/model/EnvironmentModel.js b/frontend/src/business/components/api/test/model/EnvironmentModel.js
index 1b0c414805..4cc6d40eec 100644
--- a/frontend/src/business/components/api/test/model/EnvironmentModel.js
+++ b/frontend/src/business/components/api/test/model/EnvironmentModel.js
@@ -69,7 +69,7 @@ export class HttpConfig extends BaseConfig {
this.headers = [];
this.protocol = 'https';
this.port = undefined;
-
+ this.conditions = [];
this.set(options);
this.sets({headers: KeyValue}, options);
}
diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js
index 5da889c3f0..3d864f6e3a 100644
--- a/frontend/src/i18n/en-US.js
+++ b/frontend/src/i18n/en-US.js
@@ -711,6 +711,8 @@ export default {
}
},
automation: {
+ open_expansion: "One-click expansion",
+ close_expansion: "One-click storage",
constant: "constant",
counter: "counter",
random: "random",
@@ -774,6 +776,7 @@ export default {
environment: {
name: "Environment Name",
socket: "Socket",
+ condition_enable: "Activation conditions",
globalVariable: "Global Variable",
environment_list: "Environment List",
environment_config: "Environment Config",
diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js
index c23c7ad2cb..514581e8e1 100644
--- a/frontend/src/i18n/zh-CN.js
+++ b/frontend/src/i18n/zh-CN.js
@@ -712,6 +712,8 @@ export default {
}
},
automation: {
+ open_expansion: "一键展开",
+ close_expansion: "一键收起",
constant: "常量",
counter: "计数器",
random: "随机数",
@@ -775,6 +777,7 @@ export default {
environment: {
name: "环境名称",
socket: "环境域名",
+ condition_enable: "启用条件",
globalVariable: "全局变量",
environment_list: "环境列表",
environment_config: "环境配置",
diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js
index 554e2e83f8..f41cea3eff 100644
--- a/frontend/src/i18n/zh-TW.js
+++ b/frontend/src/i18n/zh-TW.js
@@ -711,6 +711,8 @@ export default {
}
},
automation: {
+ open_expansion: "一鍵展開",
+ close_expansion: "一鍵收起",
constant: "常量",
counter: "計數器",
random: "随机器",
@@ -774,6 +776,7 @@ export default {
environment: {
name: "環境名稱",
socket: "環境域名",
+ condition_enable: "啟用條件",
globalVariable: "全局變量",
environment_list: "環境列表",
environment_config: "環境配置",