|
楼主 |
发表于 2018-9-2 14:50:42
|
显示全部楼层
又研究了一下,两位小数的精度无法显示是因为系统定义的时候就取整了,所以要到UI2/system/components/bootstrap/progress/progress.js文件里面去修改,源代码是
propertyChangedHandler : function(key, oldVal, value) {
this.callParent(key, oldVal, value);
if(key == "valuenow"){
var progress = Math.round((parseFloat(value||0)*100.00)/this.valuemax);
$(">.progress-bar",this.$domNode).css("width",progress+"%");
var eData = { source : this, valuenow : this.value, progress : progress+"%" };
this.fireEvent('onRender', eData);
$(">.progress-bar>span",this.$domNode).html(eData.progress);
}else if(key == 'textVisible'){
$(">.progress-bar>span",this.$domNode)["false" == (""+value)?"addClass":"removeClass"]("sr-only");
}
}
});
只需要将第四行的var progress = Math.round((parseFloat(value||0)*100.00)/this.valuemax)里的Math.round()函数去掉就可以实现两位小数的文本显示了 |
|