优化触摸屏的百分比显示

This commit is contained in:
zxx 2023-10-23 17:26:43 +08:00
parent 2c91419e04
commit 77869921c0
1 changed files with 13 additions and 3 deletions

View File

@ -51,7 +51,7 @@
style="width:50px;height:50px;margin-right: 10px;" :src="item.component_detail.image" /> style="width:50px;height:50px;margin-right: 10px;" :src="item.component_detail.image" />
<span v-else></span> <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>
</div> </div>
@ -103,7 +103,7 @@
style="width:50px;height:50px;margin-right: 10px;" :src="ditem.component_img" /> style="width:50px;height:50px;margin-right: 10px;" :src="ditem.component_img" />
<span v-else></span> <span v-else></span>
<a-progress type="circle" :percent="ditem.progress" :width="50" /> <a-progress type="circle" :percent="formatProgress(ditem.progress)" :width="50" />
</div> </div>
@ -925,7 +925,17 @@ export default {
}, },
//
formatProgress(progress) {
// 56
if (progress.length > 5) {
progress = progress.substring(0, 6);
//
progress = parseFloat(progress).toFixed(2);
}
return progress;
},
}, },
// //