forked from github/dataease
Merge pull request #7670 from dataease/pr@dev-v2@fix_screen
fix: 修复大尺寸数据大屏初始化未移动到中心点问题,可能吧位置坐标置空问题
This commit is contained in:
commit
9497a774ad
@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||
import { storeToRefs } from 'pinia'
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { ref, onMounted, onUnmounted, nextTick } from 'vue'
|
||||
import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapshot'
|
||||
import { changeSizeWithScale } from '@/utils/changeComponentsSizeWithScale'
|
||||
import { useEmitt } from '@/hooks/web/useEmitt'
|
||||
@ -71,6 +71,9 @@ onMounted(() => {
|
||||
window.addEventListener('mousewheel', handleMouseWheel, { passive: false })
|
||||
setTimeout(() => {
|
||||
scale.value = canvasStyleData.value.scale
|
||||
nextTick(() => {
|
||||
useEmitt().emitter.emit('initScroll')
|
||||
})
|
||||
}, 1000)
|
||||
})
|
||||
|
||||
|
@ -67,6 +67,9 @@ const positionKeysGroup = computed(() => {
|
||||
})
|
||||
|
||||
const onPositionChange = key => {
|
||||
if (!positionMounted.value[key]) {
|
||||
positionMounted.value[key] = 0
|
||||
}
|
||||
curComponent.value.style[key] = Math.round(
|
||||
(positionMounted.value[key] * canvasStyleData.value.scale) / 100
|
||||
)
|
||||
|
@ -83,6 +83,9 @@ function format(value, scale) {
|
||||
return multiply(value, divide(parseFloat(scale), 100))
|
||||
}
|
||||
|
||||
function getOriginStyle(value, scale) {
|
||||
function getOriginStyle(value = 0, scale) {
|
||||
if (!value) {
|
||||
value = 0
|
||||
}
|
||||
return divide(value, divide(parseFloat(scale), 100))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user