diff --git a/frontend/src/views/system/datasource/DsTree.vue b/frontend/src/views/system/datasource/DsTree.vue index 085cacbca5..5739985dcc 100644 --- a/frontend/src/views/system/datasource/DsTree.vue +++ b/frontend/src/views/system/datasource/DsTree.vue @@ -2,19 +2,31 @@ - - {{ $t('commons.datasource') }} - + +
+ {{ $t('commons.datasource') }} + + +
+
+ +
+ + + +
@@ -74,13 +86,31 @@ export default { data() { return { expandedArray: [], - tData: [] + tData: [], + showSearchInput: false, + key: '' + } + }, + watch: { + key(val) { + this.$refs.myDsTree.filter(val) } }, mounted() { this.queryTreeDatas() }, methods: { + filterNode(value, data) { + if (!value) return true + return data.name.indexOf(value) !== -1 + }, + showSearchWidget() { + this.showSearchInput = true + }, + closeSearchWidget() { + this.key = '' + this.showSearchInput = false + }, queryTreeDatas() { listDatasource().then(res => { this.tData = this.buildTree(res.data)