forked from github/dataease
refactor(仪表板): 历史数据兼容优化
This commit is contained in:
parent
f77bc85c87
commit
9d0453e1ea
@ -120,24 +120,13 @@ function matrixAdaptor(componentItem) {
|
||||
}
|
||||
}
|
||||
|
||||
export function historyAdaptor(
|
||||
canvasStyleResult,
|
||||
canvasDataResult,
|
||||
canvasInfo,
|
||||
export function historyItemAdaptor(
|
||||
componentItem,
|
||||
reportFilterInfo,
|
||||
attachInfo,
|
||||
canvasVersion
|
||||
canvasVersion,
|
||||
canvasInfo
|
||||
) {
|
||||
//历史字段适配
|
||||
canvasStyleResult.component['seniorStyleSetting'] =
|
||||
canvasStyleResult.component['seniorStyleSetting'] || deepCopy(SENIOR_STYLE_SETTING_LIGHT)
|
||||
canvasStyleResult['screenAdaptor'] = canvasStyleResult['screenAdaptor'] || 'widthFirst'
|
||||
// 同步宽高比例(大屏使用)
|
||||
canvasStyleResult['scaleWidth'] = canvasStyleResult['scale']
|
||||
canvasStyleResult['scaleHeight'] = canvasStyleResult['scale']
|
||||
canvasStyleResult['popupAvailable'] =
|
||||
canvasStyleResult['popupAvailable'] === undefined ? true : canvasStyleResult['popupAvailable'] //兼容弹框区域开关
|
||||
const reportFilterInfo = canvasInfo.reportFilterInfo
|
||||
canvasDataResult.forEach(componentItem => {
|
||||
componentItem['canvasActive'] = false
|
||||
// 定时报告过滤组件适配 如果当前是定时报告默认切有设置对应的过滤组件默认值,则替换过滤组件
|
||||
if (
|
||||
@ -179,6 +168,39 @@ export function historyAdaptor(
|
||||
? componentItem.events
|
||||
: deepCopy(BASE_EVENTS)
|
||||
componentItem['category'] = componentItem['category'] || 'base'
|
||||
|
||||
if (componentItem.component === 'DeTabs') {
|
||||
componentItem.propValue.forEach(tabItem => {
|
||||
tabItem.componentData.forEach(tabComponent => {
|
||||
historyItemAdaptor(tabComponent, reportFilterInfo, attachInfo, canvasVersion, canvasInfo)
|
||||
})
|
||||
})
|
||||
} else if (componentItem.component === 'Group') {
|
||||
componentItem.propValue.forEach(groupItem => {
|
||||
historyItemAdaptor(groupItem, reportFilterInfo, attachInfo, canvasVersion, canvasInfo)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function historyAdaptor(
|
||||
canvasStyleResult,
|
||||
canvasDataResult,
|
||||
canvasInfo,
|
||||
attachInfo,
|
||||
canvasVersion
|
||||
) {
|
||||
//历史字段适配
|
||||
canvasStyleResult.component['seniorStyleSetting'] =
|
||||
canvasStyleResult.component['seniorStyleSetting'] || deepCopy(SENIOR_STYLE_SETTING_LIGHT)
|
||||
canvasStyleResult['screenAdaptor'] = canvasStyleResult['screenAdaptor'] || 'widthFirst'
|
||||
// 同步宽高比例(大屏使用)
|
||||
canvasStyleResult['scaleWidth'] = canvasStyleResult['scale']
|
||||
canvasStyleResult['scaleHeight'] = canvasStyleResult['scale']
|
||||
canvasStyleResult['popupAvailable'] =
|
||||
canvasStyleResult['popupAvailable'] === undefined ? true : canvasStyleResult['popupAvailable'] //兼容弹框区域开关
|
||||
const reportFilterInfo = canvasInfo.reportFilterInfo
|
||||
canvasDataResult.forEach(componentItem => {
|
||||
historyItemAdaptor(componentItem, reportFilterInfo, attachInfo, canvasVersion, canvasInfo)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user