From 5aa5b5ebc39d3f21f1a352e3fcc517a86a8e7ead Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 13 Jan 2021 09:56:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=9C=BA=E6=99=AF=E5=92=8C?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=A0=91=E9=A1=B5=E9=9D=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/scenario/EditApiScenario.vue | 16 ++++++++++------ .../components/track/common/NodeTree.vue | 3 +++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 505a8ee26d..9d360afdf3 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -132,7 +132,7 @@ - {{$t('api_test.request.debug')}} + {{$t('api_test.request.debug')}} @@ -141,6 +141,7 @@ @@ -307,6 +308,7 @@ operatingElements: [], currentRow: {cases: [], apis: [], referenced: true}, selectedTreeNode: undefined, + selectedNode: undefined, expandedNode: [], scenarioDefinition: [], path: "/api/automation/create", @@ -519,16 +521,18 @@ this.$refs.apiImport.open(); break; } + + this.selectedNode.expanded = true; this.sort(); - this.reload(); }, - nodeClick(e) { - if (e.referenced != 'REF' && e.referenced != 'Deleted') { - this.operatingElements = ELEMENTS.get(e.type); + nodeClick(data, node) { + if (data.referenced != 'REF' && data.referenced != 'Deleted') { + this.operatingElements = ELEMENTS.get(data.type); } else { this.operatingElements = []; } - this.selectedTreeNode = e; + this.selectedTreeNode = data; + this.selectedNode = node; }, suggestClick(node) { this.response = {}; diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 780e71797a..324572a30c 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -151,6 +151,9 @@ export default { }, edit(node, data) { this.$set(data, 'isEdit', true); + this.$nextTick(() => { + this.$refs.nameInput.focus(); + }); }, append(node, data) { const newChild = {