Merge pull request #3892 from dataease/pr@dev@fix_console-error

fix(仪表板): 部分仪表板打开控制台有报错问题
This commit is contained in:
Junjun 2022-11-28 11:57:54 +08:00 committed by GitHub
commit 84f2304aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 11 deletions

View File

@ -653,7 +653,12 @@ export default {
},
clearPanelLinkage(param) {
if (param.viewId === 'all' || param.viewId === this.element.propValue.viewId) {
try {
this.$refs[this.element.propValue.id].reDrawView()
} catch (e) {
console.error('reDrawView-error', this.element.propValue.id)
}
}
},
bindPluginEvent() {

View File

@ -57,6 +57,7 @@ import { reverseColor } from '../chart/common/common'
import MapController from './map/MapController.vue'
import { mapState } from 'vuex'
import bus from '@/utils/bus'
export default {
name: 'ChartComponent',
components: {
@ -180,6 +181,7 @@ export default {
this.currentSeriesId = seriesId
},
reDrawView() {
if (this.linkageActiveParam) {
this.myChart.dispatchAction({
type: 'unselect',
seriesIndex: this.linkageActiveParam.seriesIndex,
@ -190,6 +192,7 @@ export default {
seriesIndex: this.linkageActiveParam.seriesIndex,
name: this.linkageActiveParam.name
})
}
this.linkageActiveParam = null
},
linkageActive() {