refactor:优化仪表板元素拖动,大小变动延迟渲染,移动使用原始dom

This commit is contained in:
wangjiahao 2021-08-13 13:58:27 +08:00
parent 76bdbd7170
commit 4e69aa6e1d
3 changed files with 26 additions and 5 deletions

View File

@ -1155,7 +1155,9 @@ export default {
this.resizing = false this.resizing = false
await this.conflictCheck() await this.conflictCheck()
this.$emit('refLineParams', refLine) this.$emit('refLineParams', refLine)
this.$emit('resizestop', this.left, this.top, this.width, this.height) // this.$emit('resizestop', this.left, this.top, this.width, this.height)
// private
// this.$emit('resizestop')
} }
if (this.dragging) { if (this.dragging) {
this.dragging = false this.dragging = false
@ -1484,6 +1486,12 @@ export default {
style.rotate = this.rotate style.rotate = this.rotate
// this.hasMove = true // this.hasMove = true
this.$store.commit('setShapeStyle', style) this.$store.commit('setShapeStyle', style)
// resize
const self = this
setTimeout(function() {
self.$emit('resizestop')
}, 200)
}, },
mountedFunction() { mountedFunction() {
// private // private

View File

@ -37,6 +37,7 @@
:linkage-active="linkageSettingStatus&&item===curLinkageView" :linkage-active="linkageSettingStatus&&item===curLinkageView"
@refLineParams="getRefLineParams" @refLineParams="getRefLineParams"
@showViewDetails="showViewDetails(index)" @showViewDetails="showViewDetails(index)"
@resizestop="resizestop(index,item)"
> >
<component <component
:is="item.component" :is="item.component"
@ -620,6 +621,11 @@ export default {
}, },
showViewDetails(index) { showViewDetails(index) {
this.$refs.wrapperChild[index].openChartDetailsDialog() this.$refs.wrapperChild[index].openChartDetailsDialog()
},
resizestop(index, item) {
if (item.type === 'view') {
this.$refs.wrapperChild[index].chartResize()
}
} }
} }
} }

View File

@ -159,12 +159,13 @@ export default {
}, },
deep: true deep: true
}, },
// //
outStyle: { outStyle: {
handler(newVal, oldVla) { handler(newVal, oldVla) {
if (this.$refs[this.element.propValue.id]) { //
this.$refs[this.element.propValue.id].chartResize() // if (this.$refs[this.element.propValue.id]) {
} // this.$refs[this.element.propValue.id].chartResize()
// }
}, },
deep: true deep: true
}, },
@ -381,6 +382,12 @@ export default {
} }
} }
} }
// chart
chartResize() {
if (this.$refs[this.element.propValue.id]) {
this.$refs[this.element.propValue.id].chartResize()
}
}
} }
} }
</script> </script>