This commit is contained in:
sjl
2025-11-14 16:19:47 +08:00

View File

@@ -93,7 +93,11 @@ const tableStore: any = new TableStore({
minWidth: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.maxValue}</span>`
const extentValue =
row.maxValue !== null && row.maxValue !== undefined && row.maxValue !== ''
? Math.floor(row.maxValue * 100) / 100
: '/'
return `<span style='cursor: pointer;text-decoration: underline;'>${extentValue}</span>`
}
},
{
@@ -104,7 +108,16 @@ const tableStore: any = new TableStore({
{
title: '越限程度(%)',
field: 'extent',
minWidth: '60'
minWidth: '60',
render: 'customTemplate',
customTemplate: (row: any) => {
// 保留两个小数
const extentValue =
row.extent !== null && row.extent !== undefined && row.extent !== ''
? Math.floor(row.extent * 100) / 100
: '/'
return `<span>${extentValue}</span>`
}
},
{
title: '发生日期',
@@ -145,8 +158,9 @@ const tableStore: any = new TableStore({
const chartData = xAxisLabels.map(label => {
// 在表格数据中查找对应指标名称的数据项
const item = tableStore.table.data.find((row: any) => row.name === label)
// 如果找到对应项,则返回 extent 值,否则返回 0
return item ? item.extent || 0 : 0
// 如果找到对应项,则返回 extent 值,否则返回 0,并保留两位小数
const extentValue = item ? item.extent || 0 : 0
return Math.round(extentValue * 100) / 100
})
echartList.value = {
title: {