|
|
|
@ -9,14 +9,14 @@ var Line = React.createClass({
|
|
|
|
|
return {
|
|
|
|
|
percent: 0,
|
|
|
|
|
strokeWidth: 2,
|
|
|
|
|
status: "normal" // exception
|
|
|
|
|
status: 'normal' // exception
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
render() {
|
|
|
|
|
var statusColorMap = {
|
|
|
|
|
"normal": "#3FC7FA",
|
|
|
|
|
"exception": "#FE8C6A",
|
|
|
|
|
"success": "#85D262"
|
|
|
|
|
'normal': '#3FC7FA',
|
|
|
|
|
'exception': '#FE8C6A',
|
|
|
|
|
'success': '#85D262'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (parseInt(this.props.percent) === 100) {
|
|
|
|
@ -24,36 +24,36 @@ var Line = React.createClass({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var style = {
|
|
|
|
|
"width": this.props.width
|
|
|
|
|
'width': this.props.width
|
|
|
|
|
}
|
|
|
|
|
var wrapStyle = {
|
|
|
|
|
"font-size": this.props.width / 100 * this.props.strokeWidth
|
|
|
|
|
'font-size': this.props.width / 100 * this.props.strokeWidth
|
|
|
|
|
}
|
|
|
|
|
var textStyle = {
|
|
|
|
|
"color": statusColorMap[this.props.status]
|
|
|
|
|
'color': statusColorMap[this.props.status]
|
|
|
|
|
}
|
|
|
|
|
var progressInfo
|
|
|
|
|
if (this.props.status === 'exception') {
|
|
|
|
|
progressInfo = (
|
|
|
|
|
<span style={textStyle} className="ant-progress-line-text">
|
|
|
|
|
<i className="anticon anticon-exclamation-round"></i>
|
|
|
|
|
<span style={textStyle} className='ant-progress-line-text'>
|
|
|
|
|
<i className='anticon anticon-exclamation-round'></i>
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
} else if(this.props.status === 'success'){
|
|
|
|
|
progressInfo = (
|
|
|
|
|
<span style={textStyle} className="ant-progress-line-text">
|
|
|
|
|
<i className="anticon anticon-check-round"></i>
|
|
|
|
|
<span style={textStyle} className='ant-progress-line-text'>
|
|
|
|
|
<i className='anticon anticon-check-round'></i>
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
}else {
|
|
|
|
|
progressInfo = (
|
|
|
|
|
<span className="ant-progress-line-text">{this.props.percent}%</span>
|
|
|
|
|
<span className='ant-progress-line-text'>{this.props.percent}%</span>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="ant-progress-line-wrap" style={wrapStyle}>
|
|
|
|
|
<div className="ant-progress-line-inner" style={style}>
|
|
|
|
|
<div className='ant-progress-line-wrap' style={wrapStyle}>
|
|
|
|
|
<div className='ant-progress-line-inner' style={style}>
|
|
|
|
|
<Progressline percent={this.props.percent} strokeWidth={this.props.strokeWidth}
|
|
|
|
|
strokeColor={statusColorMap[this.props.status]}/>
|
|
|
|
|
</div>
|
|
|
|
@ -68,14 +68,14 @@ var Circle = React.createClass({
|
|
|
|
|
return {
|
|
|
|
|
percent: 0,
|
|
|
|
|
strokeWidth: 2,
|
|
|
|
|
status: "normal" // exception
|
|
|
|
|
status: 'normal' // exception
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
render() {
|
|
|
|
|
var statusColorMap = {
|
|
|
|
|
"normal": "#3FC7FA",
|
|
|
|
|
"exception": "#FE8C6A",
|
|
|
|
|
"success": "#85D262"
|
|
|
|
|
'normal': '#3FC7FA',
|
|
|
|
|
'exception': '#FE8C6A',
|
|
|
|
|
'success': '#85D262'
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (parseInt(this.props.percent) === 100) {
|
|
|
|
@ -83,20 +83,20 @@ var Circle = React.createClass({
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var style = {
|
|
|
|
|
"width": this.props.width,
|
|
|
|
|
"height": this.props.width
|
|
|
|
|
'width': this.props.width,
|
|
|
|
|
'height': this.props.width
|
|
|
|
|
}
|
|
|
|
|
var wrapStyle = {
|
|
|
|
|
"font-size": this.props.width * 0.3
|
|
|
|
|
'font-size': this.props.width * 0.3
|
|
|
|
|
}
|
|
|
|
|
var textStyle = {
|
|
|
|
|
"color": statusColorMap[this.props.status]
|
|
|
|
|
'color': statusColorMap[this.props.status]
|
|
|
|
|
}
|
|
|
|
|
var progressInfo
|
|
|
|
|
if (this.props.status === 'exception') {
|
|
|
|
|
progressInfo = (
|
|
|
|
|
<span style={textStyle} className="ant-progress-circle-text">
|
|
|
|
|
<i className="anticon anticon-exclamation"></i>
|
|
|
|
|
<span style={textStyle} className='ant-progress-circle-text'>
|
|
|
|
|
<i className='anticon anticon-exclamation'></i>
|
|
|
|
|
</span>
|
|
|
|
|
)
|
|
|
|
|
}else {
|
|
|
|
|