From 5f46845bc250b20a4dd502b410d28c7774854195 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 6 Dec 2021 11:54:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AF=B9=E6=A0=91?= =?UTF-8?q?=E5=BD=A2=E7=BB=93=E6=9E=84=E6=93=8D=E4=BD=9C=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=9C=89=E5=85=B6=E4=BB=96=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E7=9A=84=E9=97=AE=E9=A2=98?= 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/dataset/group/Group.vue | 10 ++-------- frontend/src/views/panel/list/PanelList.vue | 17 ++++++++++------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/frontend/src/views/chart/group/Group.vue b/frontend/src/views/chart/group/Group.vue index 998c0eb391..93c056e8db 100644 --- a/frontend/src/views/chart/group/Group.vue +++ b/frontend/src/views/chart/group/Group.vue @@ -44,6 +44,8 @@ :expand-on-click-node="true" :filter-node-method="filterNode" @node-click="nodeClick" + @node-expand="nodeExpand" + @node-collapse="nodeCollapse" > @@ -673,14 +675,6 @@ export default { if (data.modelInnerType !== 'group') { this.$emit('switchComponent', { name: 'ChartEdit', param: data }) } - if (node.expanded) { - this.expandedArray.push(data.id) - } else { - const index = this.expandedArray.indexOf(data.id) - if (index > -1) { - this.expandedArray.splice(index, 1) - } - } }, back() { diff --git a/frontend/src/views/dataset/group/Group.vue b/frontend/src/views/dataset/group/Group.vue index 3e382cc1d7..30538abc30 100644 --- a/frontend/src/views/dataset/group/Group.vue +++ b/frontend/src/views/dataset/group/Group.vue @@ -45,6 +45,8 @@ highlight-current :expand-on-click-node="true" :filter-node-method="filterNode" + @node-expand="nodeExpand" + @node-collapse="nodeCollapse" @node-click="nodeClick" > @@ -524,14 +526,6 @@ export default { if (data.modelInnerType !== 'group') { this.$emit('switchComponent', { name: 'ViewTable', param: data }) } - if (node.expanded) { - this.expandedArray.push(data.id) - } else { - const index = this.expandedArray.indexOf(data.id) - if (index > -1) { - this.expandedArray.splice(index, 1) - } - } }, back() { diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 77ee470ee2..918ea08dd8 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -29,7 +29,6 @@
@@ -677,13 +678,15 @@ export default { bus.$emit('set-panel-show-type', 0) }) } - if (node.expanded) { + }, + nodeExpand(data) { + if (data.id) { this.expandedArray.push(data.id) - } else { - const index = this.expandedArray.indexOf(data.id) - if (index > -1) { - this.expandedArray.splice(index, 1) - } + } + }, + nodeCollapse(data) { + if (data.id) { + this.expandedArray.splice(this.expandedArray.indexOf(data.id), 1) } }, back() {