NEZ-1751 fix: panel 添加window。resize的事件
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div :style="showHeader&&chartInfo.param.showHeader ? '' : 'padding-top: 15px;'" class="nz-chart" :class="showHeader&&chartInfo.param.showHeader ? '' : 'no-header'" >
|
||||
<loading :loading="loading"></loading>
|
||||
<chart-no-data v-if="isNoData || isError || chartChildrenData"></chart-no-data>
|
||||
<chart-no-data v-if="isNoData || isError || chartChildrenData"></chart-no-data>
|
||||
<template v-else>
|
||||
<chart-time-series
|
||||
v-if="isTimeSeries(chartInfo.type)"
|
||||
@@ -297,6 +297,7 @@ export default {
|
||||
this.chartChildrenData = flag
|
||||
},
|
||||
resize () {
|
||||
console.log(this.$refs['chart' + this.chartInfo.id])
|
||||
this.$refs['chart' + this.chartInfo.id] && this.$refs['chart' + this.chartInfo.id].resize()
|
||||
},
|
||||
refreshLogs (params) {
|
||||
|
||||
@@ -16,6 +16,11 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resize () {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,11 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resize () {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,9 +213,11 @@ export default {
|
||||
})
|
||||
},
|
||||
resize () {
|
||||
this.getLayout().then(layout => {
|
||||
this.renderGauge(layout).then(() => {
|
||||
this.gaugeChartResize()
|
||||
setTimeout(() => {
|
||||
this.getLayout().then(layout => {
|
||||
this.renderGauge(layout).then(() => {
|
||||
this.gaugeChartResize()
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -6,6 +6,11 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'chartNoData'
|
||||
name: 'chartNoData',
|
||||
methods: {
|
||||
resize () {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -21,6 +21,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
resize () {
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
chartInfo: {
|
||||
|
||||
@@ -331,7 +331,10 @@ export default {
|
||||
}
|
||||
},
|
||||
resize () {
|
||||
getChart(this.chartId).resize()
|
||||
console.log(213)
|
||||
setTimeout(() => {
|
||||
getChart(this.chartId) && getChart(this.chartId).resize()
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
||||
@@ -334,6 +334,15 @@ export default {
|
||||
})
|
||||
}, 200)
|
||||
},
|
||||
resize () {
|
||||
this.init()
|
||||
this.copyDataList.forEach(item => {
|
||||
if (item.type === 'group') {
|
||||
this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].$refs.chart && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id] && this.$refs['chart' + item.id][0].$refs.chart.$refs['chart' + item.id].$refs.chartList.resize()
|
||||
}
|
||||
this.$refs['chart' + item.id][0] && this.$refs['chart' + item.id][0].resize()
|
||||
})
|
||||
},
|
||||
refreshPanel () {
|
||||
bus.$emit('refreshPanel')
|
||||
}
|
||||
@@ -346,9 +355,11 @@ export default {
|
||||
if (!this.isGroup) {
|
||||
bus.$on('groupMove', this.changeGroupHeight)
|
||||
this.$store.commit('setChartListId', `chartList${this.timestamp}`)
|
||||
window.addEventListener('resize', this.resize)
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
window.removeEventListener('resize', this.resize)
|
||||
},
|
||||
watch: {
|
||||
dataList: {
|
||||
|
||||
@@ -261,7 +261,10 @@ export default {
|
||||
}
|
||||
},
|
||||
resize () {
|
||||
getChart(this.chartId) && getChart(this.chartId).resize()
|
||||
console.log('reszie')
|
||||
setTimeout(() => {
|
||||
getChart(this.chartId) && getChart(this.chartId).resize()
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -386,7 +386,7 @@ export default {
|
||||
})
|
||||
},
|
||||
resize () {
|
||||
this.$refs.chart.resize()
|
||||
this.$refs.chart && this.$refs.chart.resize()
|
||||
},
|
||||
refresh () {
|
||||
this.getChartData(true)
|
||||
|
||||
Reference in New Issue
Block a user