提交 4e69aa6e authored 作者: wangjiahao's avatar wangjiahao

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

上级 76bdbd71
......@@ -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 冲突检测 和水平设计值保持一致
......
......@@ -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()
}
}
}
}
......
......@@ -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>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论