解决大屏拖拽卡顿的问题
This commit is contained in:
@@ -48,14 +48,13 @@
|
||||
v-model="dashboard.presetLine"
|
||||
class="vueRuler"
|
||||
:step-length="50"
|
||||
:parent="true"
|
||||
:position="'relative'"
|
||||
:is-scale-revise="true"
|
||||
parent
|
||||
is-scale-revise
|
||||
position="relative"
|
||||
:visible.sync="dashboard.presetLineVisible">
|
||||
<div
|
||||
id="workbench"
|
||||
class="workbench"
|
||||
:style="{
|
||||
<div id="workbench"
|
||||
class="workbench"
|
||||
:style="{
|
||||
transform: workbenchTransform,
|
||||
width: bigscreenWidth + 'px',
|
||||
height: bigscreenHeight + 'px'
|
||||
@@ -80,8 +79,8 @@
|
||||
:class="[activeIndex === index ? 'drag-active' : '']"
|
||||
class="draggable"
|
||||
@contextmenu.native.stop="e => onContextmenu(e, index)"
|
||||
@dragging="(x, y) => onDrag(x, y, index)"
|
||||
@resizing="(x, y, w, h) => onResizing(x, y, w, h, index, item.type)"
|
||||
@dragstop="(x, y) => onDrag(x, y,item)"
|
||||
@resizestop="(x, y, w, h) => onResizing(x, y, w, h, item)"
|
||||
@activated="onActivated(index)"
|
||||
@click.native.stop="activeIndex = index"
|
||||
v-for="(item, index) in componentList"
|
||||
@@ -587,22 +586,15 @@ export default {
|
||||
onActivated(index) {
|
||||
this.activeIndex = index
|
||||
},
|
||||
|
||||
|
||||
onDrag(x, y, index) {
|
||||
this.$set(this.componentList[index], 'left', x)
|
||||
this.$set(this.componentList[index], 'top', y)
|
||||
onDrag(x, y, item) {
|
||||
item.left = x
|
||||
item.top = y
|
||||
},
|
||||
|
||||
onResizing(x, y, w, h, index, type) {
|
||||
this.$set(this.componentList[index], 'left', x)
|
||||
this.$set(this.componentList[index], 'top', y)
|
||||
this.$set(this.componentList[index], 'width', w)
|
||||
this.$set(this.componentList[index], 'height', h)
|
||||
|
||||
if (type.indexOf('Chart') > -1) {
|
||||
// this.$refs[`chart${index}`][0].watchResize()
|
||||
}
|
||||
onResizing(x, y, w, h, item) {
|
||||
item.left = x
|
||||
item.top = y
|
||||
item.width = w
|
||||
item.height = h
|
||||
},
|
||||
|
||||
initCanvas() {
|
||||
@@ -1052,6 +1044,7 @@ export default {
|
||||
.draggable {
|
||||
position: absolute;
|
||||
border: none;
|
||||
transition: none;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
|
||||
Reference in New Issue
Block a user