Merge pull request #1357 from dataease/pr@v1.5@refactor_panel-pdf

fix: 画布出现滚动条时,拖入的组件会靠上的问题
This commit is contained in:
王嘉豪 2021-12-01 15:15:00 +08:00 committed by GitHub
commit 93d8e58994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -813,6 +813,10 @@ export default {
y: 18 y: 18
} }
} }
},
scrollTop: {
type: Number,
default: 0
} }
}, },
data() { data() {
@ -1251,9 +1255,8 @@ export default {
} }
}, },
handleDragOver(e) { handleDragOver(e) {
// console.log('handleDragOver-Editor')
this.dragComponentInfo.shadowStyle.x = e.pageX - 220 this.dragComponentInfo.shadowStyle.x = e.pageX - 220
this.dragComponentInfo.shadowStyle.y = e.pageY - 90 this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop
this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth this.dragComponentInfo.style.left = this.dragComponentInfo.shadowStyle.x / this.scalePointWidth
this.dragComponentInfo.style.top = this.dragComponentInfo.shadowStyle.y / this.scalePointHeight this.dragComponentInfo.style.top = this.dragComponentInfo.shadowStyle.y / this.scalePointHeight
if (this.dragComponentInfo.auxiliaryMatrix) { if (this.dragComponentInfo.auxiliaryMatrix) {

View File

@ -106,7 +106,7 @@
@mouseup="deselectCurComponent" @mouseup="deselectCurComponent"
@scroll="canvasScroll" @scroll="canvasScroll"
> >
<Editor ref="canvasEditor" :matrix-count="pcMatrixCount" :out-style="outStyle" /> <Editor ref="canvasEditor" :matrix-count="pcMatrixCount" :out-style="outStyle" :scroll-top="scrollTop" />
</div> </div>
<!--移动端画布区域 保持宽高比2.5--> <!--移动端画布区域 保持宽高比2.5-->
<el-row v-if="mobileLayoutStatus" class="mobile_canvas_main"> <el-row v-if="mobileLayoutStatus" class="mobile_canvas_main">
@ -126,7 +126,7 @@
id="canvasInfoMobile" id="canvasInfoMobile"
class="this_mobile_canvas_main" class="this_mobile_canvas_main"
> >
<Editor ref="editorMobile" :matrix-count="mobileMatrixCount" :out-style="outStyle" /> <Editor ref="editorMobile" :matrix-count="mobileMatrixCount" :out-style="outStyle" :scroll-top="scrollTop" />
</el-row> </el-row>
<el-row class="this_mobile_canvas_bottom" /> <el-row class="this_mobile_canvas_bottom" />
</div> </div>