mirror of
https://github.com/dataease/dataease.git
synced 2026-05-14 21:12:33 +08:00
refactor: 优化富文本数值格式适配 (#17608)
This commit is contained in:
@@ -74,6 +74,9 @@ const themeAttrChange = (custom, property, value) => {
|
||||
})
|
||||
}
|
||||
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
|
||||
if (viewInfo.type === 'rich-text') {
|
||||
useEmitt().emitter.emit('calcData-' + viewId, viewInfo)
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('themeAttrChange-error')
|
||||
}
|
||||
|
||||
@@ -83,6 +83,9 @@ const themeAttrChange = (custom, property, value) => {
|
||||
})
|
||||
}
|
||||
useEmitt().emitter.emit('renderChart-' + viewId, viewInfo)
|
||||
if (viewInfo.type === 'rich-text') {
|
||||
useEmitt().emitter.emit('calcData-' + viewId, viewInfo)
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('themeAttrChange-error')
|
||||
}
|
||||
|
||||
@@ -299,13 +299,25 @@ export const formatterViewInfo = (viewInfo, value) => {
|
||||
viewInfo['customAttr']['label']['totalFormatter'],
|
||||
value
|
||||
)
|
||||
viewInfo['customAttr']['tooltip']['tooltipFormatter'] = merge(
|
||||
viewInfo['customAttr']['tooltip']['tooltipFormatter'],
|
||||
value
|
||||
)
|
||||
viewInfo['customAttr']['tooltip']['seriesTooltipFormatter'].forEach(function (item) {
|
||||
item['formatterCfg'] = merge(item['formatterCfg'], value)
|
||||
})
|
||||
if (
|
||||
![
|
||||
'table-info',
|
||||
'table-normal',
|
||||
'table-pivot',
|
||||
'stock-line',
|
||||
'bullet-graph',
|
||||
'percentage-bar-stack-horizontal'
|
||||
].includes(viewInfo.type)
|
||||
) {
|
||||
viewInfo['customAttr']['tooltip']['tooltipFormatter'] = merge(
|
||||
viewInfo['customAttr']['tooltip']['tooltipFormatter'],
|
||||
value
|
||||
)
|
||||
viewInfo['customAttr']['tooltip']['seriesTooltipFormatter'].forEach(function (item) {
|
||||
item['formatterCfg'] = merge(item['formatterCfg'], value)
|
||||
})
|
||||
}
|
||||
|
||||
//customStyle
|
||||
viewInfo['customStyle']['xAxis']['axisLabelFormatter'] = merge(
|
||||
viewInfo['customStyle']['xAxis']['axisLabelFormatter'],
|
||||
|
||||
Reference in New Issue
Block a user