From 1c9e25d27fb3972ae265999392204e7cff0c826a Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 27 Aug 2021 11:46:29 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A8=A1=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=A4=B1=E6=95=88=20--bug=3D1005962=20--user?= =?UTF-8?q?=3D=E9=99=88=E5=BB=BA=E6=98=9F=20=E3=80=90github#5477=E3=80=91?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E7=9A=84=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E5=86=85=E6=90=9C=E7=B4=A2=E7=9B=AE=E6=A0=87=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BB=E7=BC=96=E8=BE=91=E7=9B=AE=E6=A0=87?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E6=97=B6=E6=A8=A1=E5=9D=97=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=BC=9A=E8=B7=B3=E5=87=BA=EF=BC=8C=E5=8F=88=E8=A6=81=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=BE=80=E4=B8=8B=E6=8B=89=E5=AF=BB=E6=89=BE=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=A8=A1=E5=9D=97=E6=89=8D=E8=83=BD=E7=BC=96=E8=BE=91?= =?UTF-8?q?=20https://www.tapd.cn/55049933/s/1041081?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/automation/scenario/ApiScenarioModule.vue | 8 ++++++-- .../api/definition/components/module/ApiModule.vue | 8 ++++++-- .../src/business/components/track/common/NodeTree.vue | 5 +++++ .../components/track/common/TestCaseNodeTree.vue | 10 +++++++--- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue index 9a5bc53011..a468c486e8 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioModule.vue @@ -17,6 +17,7 @@ @drag="drag" @remove="remove" @refresh="list" + @filter="filter" @nodeSelectEvent="nodeChange" ref="nodeTree"> @@ -138,8 +139,8 @@ this.list(); }, watch: { - 'condition.filterText'(val) { - this.$refs.nodeTree.filter(val); + 'condition.filterText'() { + this.filter(); }, 'condition.trashEnable'() { this.$emit('enableTrash', this.condition.trashEnable); @@ -165,6 +166,9 @@ this.$refs.apiImport.open(this.currentModule); } }, + filter() { + this.$refs.nodeTree.filter(this.condition.filterText); + }, list(projectId) { let url = undefined; if (this.isPlanModel) { 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 0eb12e4607..fe1d7023c9 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue @@ -14,6 +14,7 @@ @drag="drag" @remove="remove" @refresh="list" + @filter="filter" :delete-permission="['PROJECT_API_DEFINITION:READ+DELETE_API']" :add-permission="['PROJECT_API_DEFINITION:READ+CREATE_API']" :update-permission="['PROJECT_API_DEFINITION:READ+EDIT_API']" @@ -112,8 +113,8 @@ }, watch: { - 'condition.filterText'(val) { - this.$refs.nodeTree.filter(val); + 'condition.filterText'() { + this.filter(); }, 'condition.protocol'() { this.$emit('protocolChange', this.condition.protocol); @@ -140,6 +141,9 @@ this.list(); }); }, + filter() { + this.$refs.nodeTree.filter(this.condition.filterText); + }, list(projectId) { let url = undefined; if (this.isPlanModel) { diff --git a/frontend/src/business/components/track/common/NodeTree.vue b/frontend/src/business/components/track/common/NodeTree.vue index 840b7a9715..55de67626d 100644 --- a/frontend/src/business/components/track/common/NodeTree.vue +++ b/frontend/src/business/components/track/common/NodeTree.vue @@ -198,10 +198,15 @@ export default { this.$set(data, 'isEdit', true); this.$nextTick(() => { this.$refs.nameInput.focus(); + + // 不知为何,执行this.$set(data, 'isEdit', true);进入编辑状态之后过滤会失效,重新执行下过滤 if (!isAppend) { this.$nextTick(() => { this.filter(this.filterText); }); + this.$nextTick(() => { + this.$emit('filter'); + }); } }); }, diff --git a/frontend/src/business/components/track/common/TestCaseNodeTree.vue b/frontend/src/business/components/track/common/TestCaseNodeTree.vue index 0ea0ca34ce..0aff451f9a 100644 --- a/frontend/src/business/components/track/common/TestCaseNodeTree.vue +++ b/frontend/src/business/components/track/common/TestCaseNodeTree.vue @@ -15,6 +15,7 @@ @remove="remove" @nodeSelectEvent="nodeChange" @refresh="list" + @filter="filter" ref="nodeTree">