diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index d4832cf3d3..05f5d1d526 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -1144,6 +1144,9 @@ export default { shrinkTreeNode() { //改变每个节点的状态 for (let i in this.scenarioDefinition) { + if (i > 30 && this.expandedStatus) { + continue; + } if (this.scenarioDefinition[i]) { if (this.expandedStatus && this.expandedNode.indexOf(this.scenarioDefinition[i].resourceId) === -1) { this.expandedNode.push(this.scenarioDefinition[i].resourceId); @@ -1169,9 +1172,18 @@ export default { } }, openExpansion() { - this.expandedNode = []; - this.expandedStatus = true; - this.shrinkTreeNode(); + if (this.scenarioDefinition && this.scenarioDefinition.length > 30) { + this.$alert(this.$t('api_test.definition.request.step_message'), '', { + confirmButtonText: this.$t('commons.confirm'), + callback: (action) => { + if (action === 'confirm') { + this.expandedNode = []; + this.expandedStatus = true; + this.shrinkTreeNode(); + } + } + }); + } }, closeExpansion() { this.expandedStatus = false; diff --git a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue index 0f535209c5..5b89ab2aca 100644 --- a/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue +++ b/frontend/src/business/components/api/automation/scenario/component/ApiComponent.vue @@ -241,7 +241,7 @@ export default { }); } } - if (databaseConfigsOptions.length > 0) { + if (databaseConfigsOptions.length > 0 && this.request.environmentId !== this.environment.id) { this.request.dataSourceId = databaseConfigsOptions[0].id; this.request.environmentId = this.environment.id; } 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 15eddbb5b3..360f71e9df 100644 --- a/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/maximize/MaximizeScenario.vue @@ -923,6 +923,9 @@ export default { shrinkTreeNode() { //改变每个节点的状态 for (let i in this.scenarioDefinition) { + if (i > 30 && this.expandedStatus) { + continue; + } if (this.scenarioDefinition[i]) { if (this.expandedStatus) { this.expandedNode.push(this.scenarioDefinition[i].resourceId); @@ -948,9 +951,18 @@ export default { } }, openExpansion() { - this.expandedNode = []; - this.expandedStatus = true; - this.shrinkTreeNode(); + if (this.scenarioDefinition && this.scenarioDefinition.length > 30) { + this.$alert(this.$t('api_test.definition.request.step_message'), '', { + confirmButtonText: this.$t('commons.confirm'), + callback: (action) => { + if (action === 'confirm') { + this.expandedNode = []; + this.expandedStatus = true; + this.shrinkTreeNode(); + } + } + }); + } }, closeExpansion() { this.expandedStatus = false; diff --git a/frontend/src/i18n/en-US.js b/frontend/src/i18n/en-US.js index 907de7aaef..efc480a01d 100644 --- a/frontend/src/i18n/en-US.js +++ b/frontend/src/i18n/en-US.js @@ -785,6 +785,7 @@ export default { cert_alias: "Certificate Alias", message_template: "Message Template", tcp_parameter_tip: "The request parameters can be referenced in the request template ${XXX}", + step_message: "Too many steps, whether to expand the first 30 steps?", esb_table: { name: "name", type: "type", diff --git a/frontend/src/i18n/zh-CN.js b/frontend/src/i18n/zh-CN.js index c6ee1ef6ec..b01e0da2dc 100644 --- a/frontend/src/i18n/zh-CN.js +++ b/frontend/src/i18n/zh-CN.js @@ -784,6 +784,7 @@ export default { other_config: "其他设置", message_template: "报文模版", tcp_parameter_tip: "请求参数可以在请求模版通过${xxx}引用", + step_message: "步骤过多,是否展开前 30 个步骤?", esb_table: { name: "参数名", type: "类型", diff --git a/frontend/src/i18n/zh-TW.js b/frontend/src/i18n/zh-TW.js index 736d54dd70..e233ab83ef 100644 --- a/frontend/src/i18n/zh-TW.js +++ b/frontend/src/i18n/zh-TW.js @@ -785,6 +785,7 @@ export default { cert_alias: "證書別名", message_template: "報文模版", tcp_parameter_tip: "請求參數可以在請求模版通過${xxx}引用", + step_message: "步驟過多,是否展開前 30 個步驟?", esb_table: { name: "參數名", type: "類型",