Merge pull request #2584 from dataease/pr@dev@refactor_tree-list

refactor: 仪表板、数据集列表节点操作后如果有过滤条件可以再进行自动过滤
This commit is contained in:
王嘉豪 2022-07-05 12:15:05 +08:00 committed by GitHub
commit 43782b5fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View File

@ -434,13 +434,6 @@ export default {
panelInfo() {
return this.$store.state.panel.panelInfo
}
/* pluginRenderOptions() {
const plugins = localStorage.getItem('plugin-views') && JSON.parse(localStorage.getItem('plugin-views')) || []
const pluginOptions = plugins.filter(plugin => !this.renderOptions.some(option => option.value === plugin.render)).map(plugin => {
return { name: plugin.render, value: plugin.render }
})
return [...this.renderOptions, ...pluginOptions]
} */
},
watch: {
saveStatus() {
@ -693,6 +686,9 @@ export default {
this.tData = res.data
this.initCurrentNode()
}
if (this.filterText) {
this.$refs.chartTreeRef.filter(this.filterText)
}
})
},

View File

@ -228,7 +228,7 @@ import LinkGenerate from '@/views/link/generate'
import { uuid } from 'vue-uuid'
import bus from '@/utils/bus'
import EditPanel from './EditPanel'
import { addGroup, delGroup, groupTree, defaultTree, panelSave, initPanelData, panelUpdate } from '@/api/panel/panel'
import { addGroup, delGroup, groupTree, defaultTree, initPanelData, panelUpdate } from '@/api/panel/panel'
import { mapState } from 'vuex'
import {
DEFAULT_COMMON_CANVAS_STYLE_STRING
@ -621,6 +621,11 @@ export default {
if (!userCache) {
this.tData = res.data
}
if (this.filterText) {
this.$nextTick(() => {
this.$refs.panel_list_tree.filter(this.filterText)
})
}
})
},
defaultTree(cache = false) {
@ -638,6 +643,11 @@ export default {
if (!userCache) {
this.defaultData = res.data
}
if (this.filterText) {
this.$nextTick(() => {
this.$refs.default_panel_tree.filter(this.filterText)
})
}
})
},