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
await this.conflictCheck()
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) {
this.dragging = false
@ -1484,6 +1486,12 @@ export default {
style.rotate = this.rotate
// this.hasMove = true
this.$store.commit('setShapeStyle', style)
// resize
const self = this
setTimeout(function() {
self.$emit('resizestop')
}, 200)
},
mountedFunction() {
// private

View File

@ -37,6 +37,7 @@
:linkage-active="linkageSettingStatus&&item===curLinkageView"
@refLineParams="getRefLineParams"
@showViewDetails="showViewDetails(index)"
@resizestop="resizestop(index,item)"
>
<component
:is="item.component"
@ -620,6 +621,11 @@ export default {
},
showViewDetails(index) {
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
},
//
//
outStyle: {
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
},
@ -381,6 +382,12 @@ export default {
}
}
}
// chart
chartResize() {
if (this.$refs[this.element.propValue.id]) {
this.$refs[this.element.propValue.id].chartResize()
}
}
}
}
</script>