CN-356 Panel 图表bug
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -379,6 +379,7 @@ export default {
|
||||
mounted () {
|
||||
this.showLoading(true)
|
||||
this.getChartData()
|
||||
this.$store.commit('cleanChartList')
|
||||
},
|
||||
setup (props) {
|
||||
const dateRangeValue = 60
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user