Commit 3aec206a by zhaochengxiang

成长度保留两位小数

parent 56fe9935
...@@ -251,11 +251,11 @@ class Dashboard extends Component { ...@@ -251,11 +251,11 @@ class Dashboard extends Component {
return (level>2)?`${level}A`:'B'; return (level>2)?`${level}A`:'B';
} }
curDimensionConvert = (data, dimension) => { curDimensionConvert = (data, dimension, isCZD = false) => {
var validateDimension = []; var validateDimension = [];
dimension.map(item=>{ dimension.map(item=>{
if (data[item.key] != null) { if (data[item.key] != null) {
validateDimension.push({key:item.key,name:item.name,value:data[item.key]}); validateDimension.push({key:item.key,name:item.name,value:(isCZD===true)?parseFloat(data[item.key]).toFixed(2):data[item.key]});
} }
return item; return item;
}) })
...@@ -272,7 +272,7 @@ class Dashboard extends Component { ...@@ -272,7 +272,7 @@ class Dashboard extends Component {
} else if (index === 2) { } else if (index === 2) {
this.setState({ curDegree: '配合度', curDimension: this.curDimensionConvert(data,phdDimension)}); this.setState({ curDegree: '配合度', curDimension: this.curDimensionConvert(data,phdDimension)});
} else if (index === 3) { } else if (index === 3) {
this.setState({ curDegree: '成长度', curDimension: this.curDimensionConvert(data,czdDimension)}); this.setState({ curDegree: '成长度', curDimension: this.curDimensionConvert(data,czdDimension,true)});
} else if (index === 4) { } else if (index === 4) {
this.setState({ curDegree: '诚信度', curDimension: this.curDimensionConvert(data,cxdDimension)}); this.setState({ curDegree: '诚信度', curDimension: this.curDimensionConvert(data,cxdDimension)});
} }
......
...@@ -261,11 +261,11 @@ class mDashboard extends Component { ...@@ -261,11 +261,11 @@ class mDashboard extends Component {
return (level>2)?`${level}A`:'B'; return (level>2)?`${level}A`:'B';
} }
curDimensionConvert = (data, dimension) => { curDimensionConvert = (data, dimension, isCZD = false) => {
var validateDimension = []; var validateDimension = [];
dimension.map(item=>{ dimension.map(item=>{
if (data[item.key] != null) { if (data[item.key] != null) {
validateDimension.push({key:item.key,name:item.name,value:data[item.key]}); validateDimension.push({key:item.key,name:item.name,value:(isCZD===true)?parseFloat(data[item.key]).toFixed(2):data[item.key]});
} }
return item; return item;
}) })
...@@ -282,7 +282,7 @@ class mDashboard extends Component { ...@@ -282,7 +282,7 @@ class mDashboard extends Component {
} else if (index === 2) { } else if (index === 2) {
this.setState({ curDegree: '配合度', curDimension: this.curDimensionConvert(data,phdDimension)}); this.setState({ curDegree: '配合度', curDimension: this.curDimensionConvert(data,phdDimension)});
} else if (index === 3) { } else if (index === 3) {
this.setState({ curDegree: '成长度', curDimension: this.curDimensionConvert(data,czdDimension)}); this.setState({ curDegree: '成长度', curDimension: this.curDimensionConvert(data,czdDimension,true)});
} else if (index === 4) { } else if (index === 4) {
this.setState({ curDegree: '诚信度', curDimension: this.curDimensionConvert(data,cxdDimension)}); this.setState({ curDegree: '诚信度', curDimension: this.curDimensionConvert(data,cxdDimension)});
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment