From 8f5827038895f2478ab7274d2ed71453ac3dc9cf Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Tue, 5 Jul 2022 12:14:08 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=AA=E8=A1=A8=E6=9D=BF?= =?UTF-8?q?=E3=80=81=E6=95=B0=E6=8D=AE=E9=9B=86=E5=88=97=E8=A1=A8=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=93=8D=E4=BD=9C=E5=90=8E=E5=A6=82=E6=9E=9C=E6=9C=89?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E5=8F=AF=E4=BB=A5=E5=86=8D?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=87=AA=E5=8A=A8=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/group/Group.vue | 10 +++------- frontend/src/views/panel/list/PanelList.vue | 12 +++++++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 2a6d625490..e9ef18a481 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -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) + } }) }, diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index f1ab5dad5c..965a98994d 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -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) + }) + } }) },