From ca3a26a17155ff6e04ab43cd9ea725b3a5b501ca Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 21 Jan 2021 12:13:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A0=91=E4=BF=AE=E6=94=B9=E5=90=8E?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/ApiScenarioModule.vue | 4 ++ .../environment/EnvironmentTcpConfig.vue | 45 +++++++++++++++++++ .../components/module/ApiModule.vue | 3 ++ .../components/track/common/NodeTree.vue | 19 ++++++-- .../track/common/TestCaseNodeTree.vue | 3 ++ 5 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index 551e1e8532..855d04e0fa 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -119,6 +119,9 @@ buildNodePath(node, {path: ''}, moduleOptions); }); this.$emit('setModuleOptions', moduleOptions); + if (this.$refs.nodeTree) { + this.$refs.nodeTree.filter(this.condition.filterText); + } } }); }, @@ -142,6 +145,7 @@ }, (error) => { this.list(); }); + }, remove(nodeIds) { this.$post("/api/automation/module/delete", nodeIds, () => { diff --git a/frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue b/frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue new file mode 100644 index 0000000000..879c4b8b6f --- /dev/null +++ b/frontend/src/business/components/api/definition/components/environment/EnvironmentTcpConfig.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/frontend/src/business/components/api/definition/components/module/ApiModule.vue b/frontend/src/business/components/api/definition/components/module/ApiModule.vue index 73e221ba19..f9ef4094e3 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue @@ -126,6 +126,9 @@ buildNodePath(node, {path: ''}, moduleOptions); }); this.$emit('setModuleOptions', moduleOptions); + if (this.$refs.nodeTree) { + this.$refs.nodeTree.filter(this.condition.filterText); + } } }); }, diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 324572a30c..4100d799e8 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -137,7 +137,15 @@ export default { return false; }, filter(val) { - this.$refs.tree.filter(val); + if (!val) { + val = this.filterText; + } else { + // 记录condition 的 filterText + this.filterText = val; + } + this.$nextTick(() => { + this.$refs.tree.filter(val); + }); }, nodeExpand(data) { if (data.id) { @@ -149,10 +157,15 @@ export default { this.expandedNode.splice(this.expandedNode.indexOf(data.id), 1); } }, - edit(node, data) { + edit(node, data, isAppend) { this.$set(data, 'isEdit', true); this.$nextTick(() => { this.$refs.nameInput.focus(); + if (!isAppend) { + this.$nextTick(() => { + this.filter(this.filterText); + }); + } }); }, append(node, data) { @@ -166,7 +179,7 @@ export default { this.$set(data, 'children', []) } data.children.push(newChild); - this.edit(node, newChild); + this.edit(node, newChild, true); node.expanded = true; this.$nextTick(() => { this.$refs.nameInput.focus(); diff --git a/frontend/src/business/components/track/common/TestCaseNodeTree.vue b/frontend/src/business/components/track/common/TestCaseNodeTree.vue index e18238be7a..c0ec0c222d 100644 --- a/frontend/src/business/components/track/common/TestCaseNodeTree.vue +++ b/frontend/src/business/components/track/common/TestCaseNodeTree.vue @@ -51,6 +51,9 @@ if (this.projectId) { this.result = this.$get("/case/node/list/" + this.projectId, response => { this.treeNodes = response.data; + if (this.$refs.nodeTree) { + this.$refs.nodeTree.filter(); + } }); } },