提交 fe824651 authored 作者: junjie's avatar junjie

fix(UI): fix选中状态丢失

上级 d7ccc339
...@@ -276,7 +276,7 @@ export default { ...@@ -276,7 +276,7 @@ export default {
}, },
computed: { computed: {
sceneData: function() { sceneData: function() {
this.chartTree() this.reviewChartList()
return this.$store.state.chart.chartSceneData return this.$store.state.chart.chartSceneData
} }
}, },
...@@ -483,7 +483,8 @@ export default { ...@@ -483,7 +483,8 @@ export default {
if (data.type === 'scene') { if (data.type === 'scene') {
this.sceneMode = true this.sceneMode = true
this.currGroup = data this.currGroup = data
this.$store.dispatch('chart/setSceneId', this.currGroup.id) // this.$store.dispatch('chart/setSceneId', this.currGroup.id)
this.chartTree()
} }
if (node.expanded) { if (node.expanded) {
this.expandedArray.push(data.id) this.expandedArray.push(data.id)
...@@ -522,6 +523,17 @@ export default { ...@@ -522,6 +523,17 @@ export default {
this.$emit('switchComponent', { name: 'ChartEdit', param: { 'id': data.id }}) this.$emit('switchComponent', { name: 'ChartEdit', param: { 'id': data.id }})
}, },
reviewChartList() {
if (this.$store.state.chart.chartSceneData) {
const that = this
this.chartData.forEach(function(ele) {
if (ele.id === that.$store.state.chart.chartSceneData.id) {
ele.type = that.$store.state.chart.chartSceneData.type
}
})
}
},
selectTable() { selectTable() {
this.selectTableFlag = true this.selectTableFlag = true
}, },
......
...@@ -419,7 +419,7 @@ export default { ...@@ -419,7 +419,7 @@ export default {
// this.get(response.data.id); // this.get(response.data.id);
this.getData(response.data.id) this.getData(response.data.id)
this.$store.dispatch('chart/setChartSceneData', null) this.$store.dispatch('chart/setChartSceneData', null)
this.$store.dispatch('chart/setChartSceneData', this.sceneId) this.$store.dispatch('chart/setChartSceneData', response.data)
}) })
}, },
closeEdit() { closeEdit() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论