CN-356 Panel 图表bug

This commit is contained in:
hyx
2022-03-14 18:30:26 +08:00
parent 0378b4806c
commit c53c109b74
3 changed files with 22 additions and 1 deletions

View File

@@ -14,7 +14,8 @@ const panel = {
chartLastPosition: {
x: 0,
y: 0
}
},
chartList:[]
},
mutations: {
setShowRightBox (state, flag) {
@@ -55,6 +56,12 @@ const panel = {
},
setChartListId (state, id) {
state.chartListId = id
},
setChartList (state, chart) {
state.chartList.push(chart)
},
cleanChartList (state) {
state.chartList = []
}
},
getters: {
@@ -93,6 +100,9 @@ const panel = {
},
getChartListId (state, id) {
return state.chartListId
},
getChartList (state) {
return state.chartList
}
},
actions: {

View File

@@ -379,6 +379,7 @@ export default {
mounted () {
this.showLoading(true)
this.getChartData()
this.$store.commit('cleanChartList')
},
setup (props) {
const dateRangeValue = 60

View File

@@ -79,9 +79,19 @@ export default {
this.$emit('showLoading', true)
try {
this.myChart.setOption(this.chartOption)
this.$store.commit('setChartList', this.$_.cloneDeep(this.myChart))
if (chartNum && chartNum == 2) {
this.myChart2.setOption(this.chartOption)
this.$store.commit('setChartList', this.$_.cloneDeep(this.myChart2))
}
let _this = this
window.addEventListener("resize", function(){
_this.$store.getters.getChartList.forEach(chart =>{
if(chart){
chart.resize()
}
})
});
} finally {
setTimeout(() => {
this.$emit('showLoading', false)