forked from github/dataease
Merge pull request #11804 from dataease/pr@dev-v2@fix_tab-title
fix(数据大屏、仪表板): 修复画布缩放偏离较大时Tab表头非激活字体和预设值偏离较大问题
This commit is contained in:
commit
45f70a54c2
@ -7,9 +7,17 @@ import { groupSizeStyleAdaptor } from '@/utils/style'
|
|||||||
const dvMainStore = dvMainStoreWithOut()
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
const { componentData, curComponentIndex, canvasStyleData } = storeToRefs(dvMainStore)
|
const { componentData, curComponentIndex, canvasStyleData } = storeToRefs(dvMainStore)
|
||||||
|
|
||||||
const needToChangeAttrs = ['top', 'left', 'width', 'height', 'fontSize', 'letterSpacing']
|
const needToChangeAttrs = [
|
||||||
|
'top',
|
||||||
|
'left',
|
||||||
|
'width',
|
||||||
|
'height',
|
||||||
|
'fontSize',
|
||||||
|
'activeFontSize',
|
||||||
|
'letterSpacing'
|
||||||
|
]
|
||||||
const needToChangeDirectionAttrs = {
|
const needToChangeDirectionAttrs = {
|
||||||
width: ['left', 'width', 'fontSize', 'letterSpacing'],
|
width: ['left', 'width', 'fontSize', 'activeFontSize', 'letterSpacing'],
|
||||||
height: ['top', 'height']
|
height: ['top', 'height']
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,7 +34,7 @@ export function changeComponentsSizeWithScale(scale, changeAttrs = needToChangeA
|
|||||||
componentDataCopy.forEach(component => {
|
componentDataCopy.forEach(component => {
|
||||||
Object.keys(component.style).forEach(key => {
|
Object.keys(component.style).forEach(key => {
|
||||||
if (changeAttrs.includes(key)) {
|
if (changeAttrs.includes(key)) {
|
||||||
if (key === 'fontSize' && component.style[key] === '') return
|
if (['fontSize', 'activeFontSize'].includes(key) && component.style[key] === '') return
|
||||||
// 根据原来的比例获取样式原来的尺寸
|
// 根据原来的比例获取样式原来的尺寸
|
||||||
// 再用原来的尺寸 * 现在的比例得出新的尺寸
|
// 再用原来的尺寸 * 现在的比例得出新的尺寸
|
||||||
component.style[key] = format(
|
component.style[key] = format(
|
||||||
|
Loading…
Reference in New Issue
Block a user