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

This commit is contained in:
junjie 2021-04-29 18:00:05 +08:00
parent d7ccc33954
commit fe82465151
2 changed files with 15 additions and 3 deletions

View File

@ -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
},

View File

@ -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() {