Merge pull request #10805 from dataease/pr@dev-v2@fix_scale-error

fix(数据大屏): 修复大屏预览右侧有部分空白问题
This commit is contained in:
王嘉豪 2024-07-04 18:27:30 +08:00 committed by GitHub
commit ccee171ab6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,7 +9,7 @@ import { storeToRefs } from 'pinia'
import elementResizeDetectorMaker from 'element-resize-detector'
import UserViewEnlarge from '@/components/visualization/UserViewEnlarge.vue'
import CanvasOptBar from '@/components/visualization/CanvasOptBar.vue'
import { isMainCanvas } from '@/utils/canvasUtils'
import { isDashboard, isMainCanvas } from '@/utils/canvasUtils'
import { activeWatermark } from '@/components/watermark/watermark'
import { personInfoApi } from '@/api/user'
import router from '@/router'
@ -153,7 +153,9 @@ const resetLayout = () => {
let canvasHeight = previewCanvas.value.clientHeight
scaleWidth.value = Math.floor((canvasWidth * 100) / canvasStyleData.value.width)
scaleHeight.value = Math.floor((canvasHeight * 100) / canvasStyleData.value.height)
scaleMin.value = Math.min(scaleWidth.value, scaleHeight.value)
scaleMin.value = isDashboard()
? Math.min(scaleWidth.value, scaleHeight.value)
: (canvasWidth * 100) / canvasStyleData.value.width
if (dashboardActive.value) {
cellWidth.value = canvasWidth / pcMatrixCount.value.x
cellHeight.value = canvasHeight / pcMatrixCount.value.y