fix:: 自定义指标数值格式化保留3位小数
This commit is contained in:
@@ -368,6 +368,9 @@ function fnGetListTitle() {
|
|||||||
width: 100,
|
width: 100,
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
maxWidth: 300,
|
maxWidth: 300,
|
||||||
|
customRender: (opt:any) => {
|
||||||
|
return parseFloat(opt.text).toFixed(3);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
columns.push({
|
columns.push({
|
||||||
@@ -463,8 +466,8 @@ function fnGetList() {
|
|||||||
kpiId: columns.key,
|
kpiId: columns.key,
|
||||||
title: columns.title,
|
title: columns.title,
|
||||||
unit: columns.unit,
|
unit: columns.unit,
|
||||||
max: values.length > 0 ? Math.max(...values) : 0,
|
max: values.length > 0 ? Math.max(...values).toFixed(3) : 0,
|
||||||
min: values.length > 0 ? Math.min(...values) : 0,
|
min: values.length > 0 ? Math.min(...values).toFixed(3) : 0,
|
||||||
avg,
|
avg,
|
||||||
total: total,
|
total: total,
|
||||||
});
|
});
|
||||||
@@ -639,7 +642,7 @@ function fnRanderChartData() {
|
|||||||
for (const y of chartDataYSeriesData) {
|
for (const y of chartDataYSeriesData) {
|
||||||
for (const key of keys) {
|
for (const key of keys) {
|
||||||
if (y.key === key) {
|
if (y.key === key) {
|
||||||
y.data.push(+item[key]);
|
y.data.push(parseFloat(item[key]).toFixed(3));
|
||||||
chartDataXAxisData.push(parseDateToStr(item['timeGroup']));
|
chartDataXAxisData.push(parseDateToStr(item['timeGroup']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user