style: 调整单值图单位位置

This commit is contained in:
chenjinsong
2022-04-06 15:04:55 +08:00
parent 42d6efa6ee
commit 45519a514b
2 changed files with 6 additions and 2 deletions

View File

@@ -1,4 +1,8 @@
.cn-chart__single-value {
.single-value__unit {
padding-left: 6px;
}
&.cn-chart__single-value--detail-overview.cn-chart__single-value--icon-left {
width: unset;
flex: 0 0 240px;
@@ -561,7 +565,6 @@
}
.single-value__unit {
font-weight: normal;
padding-right: 10px;
color: #333333;
font-size: 14px;
@@ -675,7 +678,6 @@
}
.single-value__unit {
font-weight: normal;
color: #333333;
font-size: 22px;
font-weight: bold;

View File

@@ -94,6 +94,8 @@ export default function unitConvert (value, unitType, sourceUnit, targetUnit, do
const r = (value * 100).toFixed(dot)
if (_.isNaN(r)) {
return ['-', '']
} else if (r == 0) {
return [0, '%']
} else {
return [r, '%']
}