Merge pull request #5573 from dataease/pr@dev_st_fix

Pr@dev st fix
This commit is contained in:
dataeaseShu 2023-07-03 10:37:15 +08:00 committed by GitHub
commit b5c9e9e417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 20 deletions

View File

@ -305,6 +305,9 @@ export default {
this[event](events[event])
})
}
},
setChartData() {
},
elementMouseDown(e) {
// // private

View File

@ -238,6 +238,8 @@ export default {
return {
imageDownloading: false,
chartDetailsVisible: false,
canvasMain: null,
tempCanvas: null,
showChartInfo: {},
showChartTableInfo: {},
showChartInfoType: 'details',
@ -439,8 +441,14 @@ export default {
this.initPdfTemplate()
},
beforeDestroy() {
erd.uninstall(this.$refs[this.previewTempRefId])
erd.uninstall(this.$refs[this.previewRefId])
if (this.$refs[this.previewTempRefId]) {
erd.uninstall(this.$refs[this.previewTempRefId])
}
if (this.$refs[this.previewRefId]) {
erd.uninstall(this.$refs[this.previewRefId])
}
erd.uninstall(this.canvasMain)
erd.uninstall(this.tempCanvas)
clearInterval(this.timer)
this.canvasId === 'canvas-main' && bus.$off('pcChartDetailsDialog', this.openChartDetailsDialog)
bus.$off('trigger-search-button', this.triggerSearchButton)
@ -719,26 +727,27 @@ export default {
bus.$emit('onScroll')
},
initListen() {
const _this = this
const canvasMain = document.getElementById(this.previewDomId)
this.canvasMain = document.getElementById(this.previewDomId)
// div
if (canvasMain) {
erd.listenTo(canvasMain, element => {
_this.$nextTick(() => {
_this.restore()
if (this.canvasMain) {
erd.uninstall(this.canvasMain)
erd.listenTo(this.canvasMain, () => {
this.$nextTick(() => {
this.restore()
})
})
}
setTimeout(() => {
// div
const tempCanvas = document.getElementById(this.previewTempDomId)
if (tempCanvas) {
erd.listenTo(document.getElementById(this.previewTempDomId), element => {
_this.$nextTick(() => {
this.tempCanvas = document.getElementById(this.previewTempDomId)
if (this.tempCanvas) {
erd.uninstall(this.tempCanvas)
erd.listenTo(document.getElementById(this.previewTempDomId), () => {
this.$nextTick(() => {
// mainHeight px html2canvas
_this.mainHeight = tempCanvas.scrollHeight + 'px!important'
_this.mainHeightCount = tempCanvas.scrollHeight
this.$emit('mainHeightChange', _this.mainHeight)
this.mainHeight = this.tempCanvas.scrollHeight + 'px!important'
this.mainHeightCount = this.tempCanvas.scrollHeight
this.$emit('mainHeightChange', this.mainHeight)
})
})
}

View File

@ -560,6 +560,12 @@ export default {
},
beforeDestroy() {
for (const key in this.chart) {
this.$delete(this.chart, key)
}
for (const key in this.view) {
this.$delete(this.view, key)
}
this.innerRefreshTimer && clearInterval(this.innerRefreshTimer)
bus.$off('plugin-chart-click', this.pluginChartClick)
bus.$off('plugin-jump-click', this.pluginJumpClick)
@ -570,6 +576,7 @@ export default {
bus.$off('onThemeColorChange', this.optFromBatchThemeChange)
bus.$off('onThemeAttrChange', this.optFromBatchSingleProp)
bus.$off('clear_panel_linkage', this.clearPanelLinkage)
bus.$off('tab-canvas-change', this.tabSwitch)
},
created() {
this.refId = uuid.v1
@ -865,8 +872,8 @@ export default {
},
initCurFields(chartDetails) {
this.curFields = []
this.dataRowSelect = []
this.dataRowNameSelect = []
this.dataRowSelect = {}
this.dataRowNameSelect = {}
if (chartDetails.data && chartDetails.data.sourceFields) {
const checkAllAxisStr = chartDetails.xaxis + chartDetails.xaxisExt + chartDetails.yaxis + chartDetails.yaxisExt
chartDetails.data.sourceFields.forEach(field => {

View File

@ -61,7 +61,7 @@ import ChartTitleUpdate from './ChartTitleUpdate.vue'
import { equalsAny } from '@/utils/StringUtils'
import { mapState } from 'vuex'
import { baseFlowMapOption } from '@/views/chart/chart/map/map_antv'
import { clear } from 'size-sensor'
export default {
name: 'ChartComponentG2',
components: { TitleRemark, ViewTrackBar, ChartTitleUpdate },
@ -166,7 +166,26 @@ export default {
}
},
beforeDestroy() {
this.myChart.destroy()
if (this.myChart.container) {
clear(this.myChart.container)
}
this.myChart?.clear?.()
this.myChart?.unbindSizeSensor?.()
this.myChart?.unbind?.()
this.myChart?.destroy?.()
if (this.myChart) {
for (const key in this.myChart.chart) {
this.myChart.chart[key] = null
this.$delete(this.myChart.chart, key)
}
for (const key in this.myChart) {
this.myChart[key] = null
this.$delete(this.myChart, key)
}
}
for (const key in this.pointParam) {
this.$delete(this.pointParam, key)
}
window.removeEventListener('resize', this.calcHeightDelay)
this.myChart = null
},
@ -222,7 +241,7 @@ export default {
window.addEventListener('resize', this.calcHeightDelay)
},
drawView() {
const chart = this.chart
const chart = JSON.parse(JSON.stringify(this.chart))
// type
// if (chart.data) {
this.antVRenderStatus = true