Merge pull request #7475 from dataease/pr@dev@fix_chart_table

Pr@dev@fix chart table
This commit is contained in:
wisonic-s 2023-12-29 15:06:57 +08:00 committed by GitHub
commit 685060866e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -1045,7 +1045,10 @@ export default {
tableChart.customAttr.color.tableHeaderFontColor = '#7c7e81'
tableChart.customAttr.color.tableFontColor = '#7c7e81'
tableChart.customAttr.color.enableTableCrossBG = false
tableChart.customAttr.size.showTableHeader = true
}
tableChart.customAttr.size.tableColumnFreezeHead = 0
tableChart.customAttr.size.tableRowFreezeHead = 0
tableChart.customAttr.color.tableStripe = true
tableChart.customAttr.size.tablePageMode = 'pull'
tableChart.customStyle.text.show = false

View File

@ -576,7 +576,12 @@ function getConditions(chart) {
if (customAttr.color) {
const c = JSON.parse(JSON.stringify(customAttr.color))
valueColor = c.tableFontColor
valueBgColor = hexColorToRGBA(c.tableItemBgColor, c.alpha)
const enableTableCrossBG = c.enableTableCrossBG
if (!enableTableCrossBG) {
valueBgColor = hexColorToRGBA(c.tableItemBgColor, c.alpha)
} else {
valueBgColor = null
}
}
}
@ -594,9 +599,12 @@ function getConditions(chart) {
res.background.push({
field: field.field.dataeaseName,
mapping(value, rowData) {
return {
fill: mappingColor(value, valueBgColor, field, 'backgroundColor', filedValueMap, rowData)
const fill = mappingColor(value, valueBgColor, field, 'backgroundColor', filedValueMap, rowData)
if (fill) {
return { fill }
}
// 返回 null 会使用主题中的背景色
return null
}
})
}