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">