优化触摸屏的百分比显示
This commit is contained in:
parent
2c91419e04
commit
77869921c0
|
|
@ -51,7 +51,7 @@
|
|||
style="width:50px;height:50px;margin-right: 10px;" :src="item.component_detail.image" />
|
||||
<span v-else></span>
|
||||
|
||||
<a-progress type="circle" :percent="item.progress" :width="50" />
|
||||
<a-progress type="circle" :percent="formatProgress(item.progress)" :width="50" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
style="width:50px;height:50px;margin-right: 10px;" :src="ditem.component_img" />
|
||||
<span v-else></span>
|
||||
|
||||
<a-progress type="circle" :percent="ditem.progress" :width="50" />
|
||||
<a-progress type="circle" :percent="formatProgress(ditem.progress)" :width="50" />
|
||||
</div>
|
||||
|
||||
|
||||
|
|
@ -925,7 +925,17 @@ export default {
|
|||
|
||||
|
||||
},
|
||||
// 将进度百分比取小数点后两位
|
||||
formatProgress(progress) {
|
||||
// 判断如果大于5个字符串,就截取前6个字符串
|
||||
if (progress.length > 5) {
|
||||
progress = progress.substring(0, 6);
|
||||
// 将百分比转换为小数点后两位
|
||||
progress = parseFloat(progress).toFixed(2);
|
||||
}
|
||||
return progress;
|
||||
|
||||
},
|
||||
|
||||
},
|
||||
// 监听属性
|
||||
|
|
|
|||
Loading…
Reference in New Issue