编辑模块,过滤失效 --bug=1005962 --user=陈建星 【github#5477】接口定义的模块内搜索目标模块,点击编辑目标模块时模块页面会跳出,又要重新往下拉寻找目标模块才能编辑 https://www.tapd.cn/55049933/s/1041081

This commit is contained in:
chenjianxing 2021-08-27 11:46:29 +08:00 committed by jianxing
parent aea566f8f8
commit d34bef161c
4 changed files with 24 additions and 7 deletions

View File

@ -17,6 +17,7 @@
@drag="drag" @drag="drag"
@remove="remove" @remove="remove"
@refresh="list" @refresh="list"
@filter="filter"
@nodeSelectEvent="nodeChange" @nodeSelectEvent="nodeChange"
ref="nodeTree"> ref="nodeTree">
@ -138,8 +139,8 @@
this.list(); this.list();
}, },
watch: { watch: {
'condition.filterText'(val) { 'condition.filterText'() {
this.$refs.nodeTree.filter(val); this.filter();
}, },
'condition.trashEnable'() { 'condition.trashEnable'() {
this.$emit('enableTrash', this.condition.trashEnable); this.$emit('enableTrash', this.condition.trashEnable);
@ -165,6 +166,9 @@
this.$refs.apiImport.open(this.currentModule); this.$refs.apiImport.open(this.currentModule);
} }
}, },
filter() {
this.$refs.nodeTree.filter(this.condition.filterText);
},
list(projectId) { list(projectId) {
let url = undefined; let url = undefined;
if (this.isPlanModel) { if (this.isPlanModel) {

View File

@ -14,6 +14,7 @@
@drag="drag" @drag="drag"
@remove="remove" @remove="remove"
@refresh="list" @refresh="list"
@filter="filter"
:delete-permission="['PROJECT_API_DEFINITION:READ+DELETE_API']" :delete-permission="['PROJECT_API_DEFINITION:READ+DELETE_API']"
:add-permission="['PROJECT_API_DEFINITION:READ+CREATE_API']" :add-permission="['PROJECT_API_DEFINITION:READ+CREATE_API']"
:update-permission="['PROJECT_API_DEFINITION:READ+EDIT_API']" :update-permission="['PROJECT_API_DEFINITION:READ+EDIT_API']"
@ -112,8 +113,8 @@
}, },
watch: { watch: {
'condition.filterText'(val) { 'condition.filterText'() {
this.$refs.nodeTree.filter(val); this.filter();
}, },
'condition.protocol'() { 'condition.protocol'() {
this.$emit('protocolChange', this.condition.protocol); this.$emit('protocolChange', this.condition.protocol);
@ -140,6 +141,9 @@
this.list(); this.list();
}); });
}, },
filter() {
this.$refs.nodeTree.filter(this.condition.filterText);
},
list(projectId) { list(projectId) {
let url = undefined; let url = undefined;
if (this.isPlanModel) { if (this.isPlanModel) {

View File

@ -198,10 +198,15 @@ export default {
this.$set(data, 'isEdit', true); this.$set(data, 'isEdit', true);
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.nameInput.focus(); this.$refs.nameInput.focus();
// this.$set(data, 'isEdit', true);
if (!isAppend) { if (!isAppend) {
this.$nextTick(() => { this.$nextTick(() => {
this.filter(this.filterText); this.filter(this.filterText);
}); });
this.$nextTick(() => {
this.$emit('filter');
});
} }
}); });
}, },

View File

@ -15,6 +15,7 @@
@remove="remove" @remove="remove"
@nodeSelectEvent="nodeChange" @nodeSelectEvent="nodeChange"
@refresh="list" @refresh="list"
@filter="filter"
ref="nodeTree"> ref="nodeTree">
<template v-slot:header> <template v-slot:header>
<ms-search-bar <ms-search-bar
@ -94,8 +95,8 @@ export default {
treeNodes() { treeNodes() {
this.$emit('setTreeNodes', this.treeNodes); this.$emit('setTreeNodes', this.treeNodes);
}, },
'condition.filterText'(val) { 'condition.filterText'() {
this.$refs.nodeTree.filter(val); this.filter();
}, },
}, },
mounted() { mounted() {
@ -114,6 +115,9 @@ export default {
} }
this.$refs.testCaseCreate.open(this.currentModule) this.$refs.testCaseCreate.open(this.currentModule)
}, },
filter() {
this.$refs.nodeTree.filter(this.condition.filterText);
},
saveAsEdit(data) { saveAsEdit(data) {
this.$emit('saveAsEdit', data); this.$emit('saveAsEdit', data);
}, },
@ -139,7 +143,7 @@ export default {
}); });
this.setModuleOptions(); this.setModuleOptions();
if (this.$refs.nodeTree) { if (this.$refs.nodeTree) {
this.$refs.nodeTree.filter(); this.$refs.nodeTree.filter(this.condition.filterText);
} }
}); });
} }