Merge pull request #7976 from dataease/pr@dev@refactor_v-text

refactor(仪表板): 文本组件PC端自适应优化,可根据屏幕尺寸伸缩
This commit is contained in:
王嘉豪 2024-02-02 11:24:42 +08:00 committed by GitHub
commit 7797c2ba5e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -816,10 +816,14 @@ export default {
component.style[key] = this.format(component.style[key], this.scaleWidth)
}
if (this.needToChangeInnerWidth.includes(key)) {
if ((key === 'fontSize' || key === 'activeFontSize') && (this.terminal === 'mobile' || ['custom', 'v-text'].includes(component.type))) {
if ((key === 'fontSize' || key === 'activeFontSize') && (this.terminal === 'mobile' || ['custom'].includes(component.type))) {
// do nothing ( v-text )
} else {
component.style[key] = this.formatPoint(component.style[key], this.previewCanvasScale.scalePointWidth)
if (key === 'fontSize') {
component.style[key] = this.formatPoint(component.style[key], this.previewCanvasScale.scalePointWidth * 1.6)
} else {
component.style[key] = this.formatPoint(component.style[key], this.previewCanvasScale.scalePointWidth)
}
}
}
})