Merge pull request #3184 from dataease/pr@dev@fix_tabel-style

fix: 修复表格数字格式化不兼容导致表格样式显示异常问题
This commit is contained in:
Junjun 2022-09-26 15:26:41 +08:00 committed by GitHub
commit 43c08f95c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -654,20 +654,22 @@ export default {
pre[next['dataeaseName']] = next['name'] pre[next['dataeaseName']] = next['name']
return pre return pre
}, {}) }, {})
let yAxis = []
try {
yAxis = JSON.parse(chartDetails.yaxis)
} catch (err) {
yAxis = JSON.parse(JSON.stringify(chartDetails.yaxis))
}
let yDataeaseNames = []
let yDataeaseNamesCfg = []
yAxis.forEach(yItem => {
yDataeaseNames.push(yItem.dataeaseName)
yDataeaseNamesCfg[yItem.dataeaseName]=yItem.formatterCfg
})
const rowData = chartDetails.data.tableRow[0] const rowData = chartDetails.data.tableRow[0]
this.rowDataFormat(rowData,yDataeaseNames,yDataeaseNamesCfg) if(chartDetails.type === 'richTextView'){
let yAxis = []
try {
yAxis = JSON.parse(chartDetails.yaxis)
} catch (err) {
yAxis = JSON.parse(JSON.stringify(chartDetails.yaxis))
}
let yDataeaseNames = []
let yDataeaseNamesCfg = []
yAxis.forEach(yItem => {
yDataeaseNames.push(yItem.dataeaseName)
yDataeaseNamesCfg[yItem.dataeaseName]=yItem.formatterCfg
})
this.rowDataFormat(rowData,yDataeaseNames,yDataeaseNamesCfg)
}
for (const key in rowData) { for (const key in rowData) {
this.dataRowSelect[nameIdMap[key]] = rowData[key] this.dataRowSelect[nameIdMap[key]] = rowData[key]
this.dataRowNameSelect[sourceFieldNameIdMap[key]] = rowData[key] this.dataRowNameSelect[sourceFieldNameIdMap[key]] = rowData[key]