fix: 修复一些问题;entity详情页调整;

This commit is contained in:
chenjinsong
2021-08-09 14:25:43 +08:00
parent d5742afe10
commit c08b0b58c1
4 changed files with 20 additions and 7 deletions

View File

@@ -65,7 +65,15 @@ export function timeUnitFormatter (time, sourceUnit = 'ms', targetUnit, dot = 2)
// unitType = time / number / byte
export default function unitConvert (value, unitType, sourceUnit, targetUnit, dot = 2) {
if (unitType === unitTypes.string) {
return [value, '']
if (value) {
if (typeof value === 'string') {
return [value, '']
} else {
return ['-', '']
}
} else {
return ['-', '']
}
}
if (!Number(value) && Number(value) !== 0) {
return ['-', '']