CN-1145 fix: 指标统一增加<0.01处理

This commit is contained in:
chenjinsong
2023-08-04 11:00:37 +08:00
parent 2530168e44
commit 6b89d4346d
15 changed files with 76 additions and 64 deletions

View File

@@ -141,7 +141,7 @@ export function getUnitType (column) {
/* 单位转换,返回转换后的[value, unit]type=time时若value<1ms返回<1mstype=percent时若value<0.01%,返回<0.01% */
export function valueToRangeValue (value, unitType) {
const values = unitConvert(Number(value), unitType)
const values = unitConvert(_.isString(value) ? Number(value) : value, unitType)
if (values[0] || values[0] === 0) {
switch (unitType) {
case unitTypes.time: {
@@ -168,6 +168,12 @@ export function valueToRangeValue (value, unitType) {
}
break
}
case unitTypes.number: {
if (values[0] < 0.01) {
return ['<0.01', '']
}
break
}
default: break
}
}