Merge pull request #7647 from dataease/pr@dev-v2@fix_canvas

fix: 修复通过仪表板配置设置历史仪表板的图表标题字号,只有个别图表生效问题
This commit is contained in:
王嘉豪 2024-01-16 11:30:06 +08:00 committed by GitHub
commit f3be8d6204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 19 deletions

View File

@ -54,16 +54,20 @@ const themeAttrChange = (custom, property, value) => {
if (canvasAttrInit) {
Object.keys(canvasViewInfo.value).forEach(function (viewId) {
const viewInfo = canvasViewInfo.value[viewId]
if (custom === 'customAttr') {
merge(viewInfo['customAttr'], value)
} else {
Object.keys(value).forEach(function (key) {
if (viewInfo[custom][property][key] !== undefined) {
viewInfo[custom][property][key] = value[key]
}
})
try {
if (custom === 'customAttr') {
merge(viewInfo['customAttr'], value)
} else {
Object.keys(value).forEach(function (key) {
if (viewInfo[custom][property][key] !== undefined) {
viewInfo[custom][property][key] = value[key]
}
})
}
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
} catch (e) {
console.warn('themeAttrChange-error')
}
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
})
snapshotStore.recordSnapshotCache('renderChart')
}

View File

@ -33,17 +33,21 @@ const onBaseChange = () => {
const themeAttrChange = (custom, property, value) => {
if (canvasAttrInit) {
Object.keys(canvasViewInfo.value).forEach(function (viewId) {
const viewInfo = canvasViewInfo.value[viewId]
if (custom === 'customAttr') {
merge(viewInfo['customAttr'], value)
} else {
Object.keys(value).forEach(function (key) {
if (viewInfo[custom][property][key] !== undefined) {
viewInfo[custom][property][key] = value[key]
}
})
try {
const viewInfo = canvasViewInfo.value[viewId]
if (custom === 'customAttr') {
merge(viewInfo['customAttr'], value)
} else {
Object.keys(value).forEach(function (key) {
if (viewInfo[custom][property][key] !== undefined) {
viewInfo[custom][property][key] = value[key]
}
})
}
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
} catch (e) {
console.warn('themeAttrChange-error')
}
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
})
snapshotStore.recordSnapshotCache('renderChart')
}