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

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

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