forked from github/dataease
fix: 修复鼠标滚轮影响大屏画布放大问题
This commit is contained in:
parent
6314e75397
commit
f1cdab14f6
@ -42,6 +42,11 @@ const reposition = () => {
|
||||
let lastWheelNum = 0
|
||||
|
||||
const handleMouseWheel = e => {
|
||||
let dvMain = document.getElementById('dv-main-center')
|
||||
let dvMainLeftSlide = document.getElementById('dv-main-left-sidebar')
|
||||
let areaLeftWidth = dvMainLeftSlide.clientWidth
|
||||
let areaRight = dvMain.clientWidth + areaLeftWidth
|
||||
if (areaLeftWidth < e.clientX && e.clientX < areaRight) {
|
||||
const delta = e.wheelDelta ? e.wheelDelta : -e.detail
|
||||
if (lastWheelNum === 240 && delta === 240) {
|
||||
//放大
|
||||
@ -56,6 +61,7 @@ const handleMouseWheel = e => {
|
||||
e.preventDefault()
|
||||
}
|
||||
lastWheelNum = delta
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
@ -227,7 +227,7 @@ onMounted(() => {
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div class="mark-line">
|
||||
<div class="mark-line" id="canvas-mark-line">
|
||||
<div
|
||||
v-for="line in lines"
|
||||
v-show="lineStatus[line] || false"
|
||||
|
@ -236,14 +236,16 @@ eventBus.on('handleNew', handleNew)
|
||||
:aside-position="'left'"
|
||||
:side-name="'realTimeComponent'"
|
||||
class="left-sidebar"
|
||||
id="dv-main-left-sidebar"
|
||||
:class="{ 'preview-aside': previewStatus }"
|
||||
>
|
||||
<RealTimeComponentList />
|
||||
</dv-sidebar>
|
||||
<!-- 中间画布 -->
|
||||
<main class="center" ref="canvasCenterRef">
|
||||
<main id="dv-main-center" class="center" ref="canvasCenterRef">
|
||||
<el-scrollbar ref="canvasOut" class="content" :class="{ 'preview-content': previewStatus }">
|
||||
<div
|
||||
id="canvas-dv-outer"
|
||||
ref="canvasInner"
|
||||
:style="contentStyle"
|
||||
@drop="handleDrop"
|
||||
|
Loading…
Reference in New Issue
Block a user