fix: 编辑仪表盘时 卡顿导致视图大小不变的问题

This commit is contained in:
wangjiahao 2021-05-26 16:15:54 +08:00
parent 0aff0ba5e2
commit 22248e521a
3 changed files with 20 additions and 5 deletions

View File

@ -40,6 +40,7 @@
:prop-value="item.propValue"
:element="item"
:filter="filter"
:out-style="item.style"
/>
<!-- <component
:is="item.component"

View File

@ -18,6 +18,7 @@ import { viewData } from '@/api/panel/panel'
import ChartComponent from '@/views/chart/components/ChartComponent.vue'
import TableNormal from '@/views/chart/components/table/TableNormal'
import LabelNormal from '../../../views/chart/components/normal/LabelNormal'
import { uuid } from 'vue-uuid'
import { mapState } from 'vuex'
@ -48,6 +49,13 @@ export default {
filter: []
}
}
},
outStyle: {
type: Object,
required: false,
default: function() {
return {}
}
}
},
watch: {
@ -65,13 +73,24 @@ export default {
this.mergeStyle()
},
deep: true
},
//
outStyle: {
handler(newVal, oldVla) {
this.$refs[this.element.propValue.id].chartResize()
},
deep: true
}
},
created() {
this.refId = uuid.v1
},
computed: mapState([
'canvasStyleData'
]),
data() {
return {
refId: null,
chart: {
stylePriority: 'panel',
xaxis: '[]',

View File

@ -49,11 +49,6 @@ export default {
},
mounted() {
this.preDraw()
//
eventBus.$on('resizing', (componentId) => {
this.chartResize()
})
},
methods: {
preDraw() {