forked from github/dataease
Merge pull request #12761 from dataease/pr@dev-v2@refactor_scroll
refactor(数据大屏): 优化数据大屏缩放逻辑,防止进行面板反复缩放时可能出现的卡顿现象
This commit is contained in:
commit
4083f64f18
@ -12,15 +12,21 @@ const dvMainStore = dvMainStoreWithOut()
|
|||||||
const { canvasStyleData, editMode } = storeToRefs(dvMainStore)
|
const { canvasStyleData, editMode } = storeToRefs(dvMainStore)
|
||||||
const snapshotStore = snapshotStoreWithOut()
|
const snapshotStore = snapshotStoreWithOut()
|
||||||
const scale = ref(60)
|
const scale = ref(60)
|
||||||
|
const scaleChangeReady = ref(true)
|
||||||
|
|
||||||
const handleScaleChange = () => {
|
const handleScaleChange = () => {
|
||||||
snapshotStore.recordSnapshotCache()
|
if (scaleChangeReady.value) {
|
||||||
// 画布比例设一个最小值,不能为 0
|
scaleChangeReady.value = false
|
||||||
scale.value = ~~scale.value || 10
|
setTimeout(() => {
|
||||||
scale.value = scale.value < 10 ? 10 : scale.value
|
snapshotStore.recordSnapshotCache()
|
||||||
scale.value = scale.value > 200 ? 200 : scale.value
|
// 画布比例设一个最小值,不能为 0
|
||||||
|
scale.value = ~~scale.value || 10
|
||||||
changeSizeWithScale(scale.value)
|
scale.value = scale.value < 10 ? 10 : scale.value
|
||||||
|
scale.value = scale.value > 200 ? 200 : scale.value
|
||||||
|
changeSizeWithScale(scale.value)
|
||||||
|
scaleChangeReady.value = true
|
||||||
|
}, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const scaleDecrease = (speed = 1) => {
|
const scaleDecrease = (speed = 1) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user