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 7587757244..0e59a4d954 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() {